summaryrefslogtreecommitdiff
path: root/script
diff options
context:
space:
mode:
authoryehudah <yehudah@b8457f37-d9ea-0310-8a92-e5e31aec5664>2019-09-26 15:01:25 +0000
committeryehudah <yehudah@b8457f37-d9ea-0310-8a92-e5e31aec5664>2019-09-26 15:01:25 +0000
commit5e2a13d5810e4c95d36b24f0c72f94f87f8b3bf3 (patch)
treee3d5f8dd7f80c9e5e7874dd8b7cdb2e606bbd481 /script
parent388eeb5b4dfd246bfddf8ea4b7172696646ad702 (diff)
downloadPost-SMTP-5e2a13d5810e4c95d36b24f0c72f94f87f8b3bf3.zip
stupid svn stuff - deleted by mistake
Diffstat (limited to 'script')
-rw-r--r--script/post-smtp-hooks.js15
1 files changed, 15 insertions, 0 deletions
diff --git a/script/post-smtp-hooks.js b/script/post-smtp-hooks.js
new file mode 100644
index 0000000..6607f68
--- /dev/null
+++ b/script/post-smtp-hooks.js
@@ -0,0 +1,15 @@
+var Hook = {
+ hooks: [],
+
+ register: function ( name, callback ) {
+ if( 'undefined' == typeof( Hook.hooks[name] ) )
+ Hook.hooks[name] = []
+ Hook.hooks[name].push( callback )
+ },
+
+ call: function ( name, arguments ) {
+ if( 'undefined' != typeof( Hook.hooks[name] ) )
+ for( i = 0; i < Hook.hooks[name].length; ++i )
+ if( true != Hook.hooks[name][i]( arguments ) ) { break; }
+ }
+}