From: Luke Fitzgerald Date: Wed, 21 Jul 2010 14:37:10 +0000 (-0700) Subject: Rename Phergie_Plugin_Statusnet_Callback to Phergie_Plugin_StatusnetCallback X-Git-Url: https://git.mxchange.org/?a=commitdiff_plain;h=3cb51e182b014b0631b805376d1f673fe61f4ff0;p=quix0rs-gnu-social.git Rename Phergie_Plugin_Statusnet_Callback to Phergie_Plugin_StatusnetCallback --- diff --git a/plugins/Irc/extlib/phergie/Phergie/Plugin/StatusnetCallback.php b/plugins/Irc/extlib/phergie/Phergie/Plugin/StatusnetCallback.php new file mode 100644 index 0000000000..545ee343b8 --- /dev/null +++ b/plugins/Irc/extlib/phergie/Phergie/Plugin/StatusnetCallback.php @@ -0,0 +1,63 @@ +. + * + * Calls the given Statusnet IM architecture enqueuing method to enqueue + * a new incoming message + * + * @category Phergie + * @package Phergie_Plugin_StatusnetCallback + * @author Luke Fitzgerald + * @copyright 2010 StatusNet, Inc. + * @license http://www.fsf.org/licensing/licenses/agpl-3.0.html AGPL 3.0 + * @link http://status.net/ + */ + +class Phergie_Plugin_StatusnetCallback extends Phergie_Plugin_Abstract { + /** + * Callback details + * + * @var array + */ + protected $callback; + + /** + * Load callback from config + */ + public function onLoad() { + $callback = $this->config['statusnetcallback.callback']; + if (is_callable($callback)) { + $this->callback = $callback; + } else { + $this->callback = NULL; + } + } + + /** + * Passes incoming messages to StatusNet + * + * @return void + */ + public function onPrivmsg() { + if ($this->callback !== NULL) { + $event = $this->getEvent(); + $source = $event->getSource(); + $message = trim($event->getText()); + + call_user_func($this->callback, array('sender' => $source, 'message' => $message)); + } + } +} diff --git a/plugins/Irc/extlib/phergie/Phergie/Plugin/Statusnet_Callback.php b/plugins/Irc/extlib/phergie/Phergie/Plugin/Statusnet_Callback.php deleted file mode 100644 index 7bc287714b..0000000000 --- a/plugins/Irc/extlib/phergie/Phergie/Plugin/Statusnet_Callback.php +++ /dev/null @@ -1,63 +0,0 @@ -. - * - * Calls the given Statusnet IM architecture enqueuing method to enqueue - * a new incoming message - * - * @category Phergie - * @package Phergie_Plugin_Statusnet_Callback - * @author Luke Fitzgerald - * @copyright 2010 StatusNet, Inc. - * @license http://www.fsf.org/licensing/licenses/agpl-3.0.html AGPL 3.0 - * @link http://status.net/ - */ - -class Phergie_Plugin_Statusnet_Callback extends Phergie_Plugin_Abstract { - /** - * Callback details - * - * @var array - */ - protected $callback; - - /** - * Load callback from config - */ - public function onLoad() { - $callback = $this->config['statusnet_callback.callback']; - if (is_callable($callback)) { - $this->callback = $callback; - } else { - $this->callback = NULL; - } - } - - /** - * Passes incoming messages to StatusNet - * - * @return void - */ - public function onPrivmsg() { - if ($this->callback !== NULL) { - $event = $this->getEvent(); - $source = $event->getSource(); - $message = trim($event->getText()); - - call_user_func($this->callback, array('sender' => $source, 'message' => $message)); - } - } -} diff --git a/plugins/Irc/ircmanager.php b/plugins/Irc/ircmanager.php index ea98263a53..480d4c8f6c 100644 --- a/plugins/Irc/ircmanager.php +++ b/plugins/Irc/ircmanager.php @@ -123,7 +123,7 @@ class IrcManager extends ImManager { 'nickserv.password' => $nickservpassword, 'autojoin.channels' => $channels, - 'statusnet_callback.callback' => array($this, 'handle_irc_message') + 'statusnetcallback.callback' => array($this, 'handle_irc_message') ) );