From 5e2a13d5810e4c95d36b24f0c72f94f87f8b3bf3 Mon Sep 17 00:00:00 2001 From: yehudah Date: Thu, 26 Sep 2019 15:01:25 +0000 Subject: stupid svn stuff - deleted by mistake --- script/post-smtp-hooks.js | 15 +++++++++++++++ 1 file changed, 15 insertions(+) create mode 100644 script/post-smtp-hooks.js (limited to 'script') 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; } + } +} -- cgit v1.2.3