From e9995b0f6ab0788162e22c996e5ee0af416dd519 Mon Sep 17 00:00:00 2001 From: Craig Andrews Date: Sat, 23 Jan 2010 01:25:27 -0500 Subject: Create IM plugin, Pluginize XMPP, Create AIM plugin --- lib/imqueuehandler.php | 48 ++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 48 insertions(+) create mode 100644 lib/imqueuehandler.php (limited to 'lib/imqueuehandler.php') diff --git a/lib/imqueuehandler.php b/lib/imqueuehandler.php new file mode 100644 index 000000000..b42d8e7c0 --- /dev/null +++ b/lib/imqueuehandler.php @@ -0,0 +1,48 @@ +. + */ + +if (!defined('STATUSNET') && !defined('LACONICA')) { exit(1); } + +/** + * Common superclass for all IM sending queue handlers. + */ + +class ImQueueHandler extends QueueHandler +{ + function __construct($plugin) + { + $this->plugin = $plugin; + } + + /** + * Handle a notice + * @param Notice $notice + * @return boolean success + */ + function handle($notice) + { + $this->plugin->broadcast_notice($notice); + if ($notice->is_local == Notice::LOCAL_PUBLIC || + $notice->is_local == Notice::LOCAL_NONPUBLIC) { + $this->plugin->public_notice($notice); + } + return true; + } + +} -- cgit v1.2.3