projects
/
KiwiIRC.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
f0f0673
)
Re-implementing PluginInterface event.wait
author
Darren
<darren@darrenwhitlen.com>
Sat, 18 Oct 2014 01:02:08 +0000
(
02:02
+0100)
committer
Darren
<darren@darrenwhitlen.com>
Sat, 18 Oct 2014 01:02:08 +0000
(
02:02
+0100)
server/plugininterface.js
patch
|
blob
|
blame
|
history
diff --git
a/server/plugininterface.js
b/server/plugininterface.js
index d74ec6c6ddcceda2a5d56b987a0bdc9bcc28d7b8..e9ec2f95c794da642cb74faeabe926ef514334b1 100644
(file)
--- a/
server/plugininterface.js
+++ b/
server/plugininterface.js
@@
-72,16
+72,23
@@
PluginInterface.prototype.emit = function emit(type, data) {
var event_data = {
callback: function () {
resolve(data);
+ event_data.callback = null;
},
preventDefault: function (reason) {
rejected = true;
if (reason) {
rejected_reasons.push(reason);
}
- }
+ },
+ wait: false
};
listener(event_data, data);
+
+ // If the module has not specified that we should wait, callback now
+ if (!event_data.wait && event_data.callback) {
+ event_data.callback();
+ }
});
});
}, Promise.resolve(data));