X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=plugins%2FMsn%2Fmsnmanager.php;h=82d40d69c92e80eff7d5e42d51b76b159d75ba82;hb=fee9ddf84115bfa1062d7661fd439c5f8ddf985e;hp=bdae9f2b6fea581a2b27ba566fcbfe4e4ebe696b;hpb=79a81e5d5409575df47bde4dc0ad2880b40aefa5;p=quix0rs-gnu-social.git diff --git a/plugins/Msn/msnmanager.php b/plugins/Msn/msnmanager.php index bdae9f2b6f..82d40d69c9 100644 --- a/plugins/Msn/msnmanager.php +++ b/plugins/Msn/msnmanager.php @@ -29,7 +29,6 @@ if (!defined('STATUSNET') && !defined('LACONICA')) { exit(1); } * In a multi-site queuedaemon.php run, one connection will be instantiated * for each site being handled by the current process that has MSN enabled. */ - class MsnManager extends ImManager { public $conn = null; protected $lastPing = null; @@ -109,7 +108,8 @@ class MsnManager extends ImManager { 'user' => $this->plugin->user, 'password' => $this->plugin->password, 'alias' => $this->plugin->nickname, - 'psm' => 'Send me a message to post a notice', + // TRANS: MSN bot status message. + 'psm' => _m('Send me a message to post a notice'), 'debug' => false ) ); @@ -161,7 +161,7 @@ class MsnManager extends ImManager { * @return boolean */ public function handle_msn_message($data) { - $this->plugin->enqueue_incoming_raw($data); + $this->plugin->enqueueIncomingRaw($data); return true; } @@ -175,10 +175,10 @@ class MsnManager extends ImManager { $wm = Msn_waiting_message::top($data['to']); while ($wm != NULL) { if ($sessionFailed) { - $this->plugin->send_message($wm->screenname, $wm->message); + $this->plugin->sendMessage($wm->screenname, $wm->message); $sessionFailed = true; } elseif (!$this->conn->sendMessage($wm->screenname, $wm->message, $ignore)) { - $this->plugin->send_message($wm->screenname, $wm->message); + $this->plugin->sendMessage($wm->screenname, $wm->message); } $wm->delete(); @@ -195,7 +195,7 @@ class MsnManager extends ImManager { protected function requeue_waiting_messages() { $wm = Msn_waiting_message::top(); while ($wm != NULL) { - $this->plugin->send_message($wm->screenname, $wm->message); + $this->plugin->sendMessage($wm->screenname, $wm->message); $wm->delete(); $wm = Msn_waiting_message::top(); } @@ -204,11 +204,11 @@ class MsnManager extends ImManager { /** * Called by callback to log failure during connect * - * @param void $data Not used (there to keep callback happy) + * @param string $message error message reported * @return void */ - public function handle_connect_failed($data) { - common_log(LOG_NOTICE, 'MSN connect failed, retrying'); + public function handle_connect_failed($message) { + common_log(LOG_NOTICE, 'MSN connect failed, retrying: ' . $message); } /** @@ -240,7 +240,8 @@ class MsnManager extends ImManager { if (!$result) { common_log_db_error($wm, 'INSERT', __FILE__); - throw new ServerException('DB error inserting queue item'); + // TRANS: Server exception thrown when a message to be sent through MSN cannot be added to the database queue. + throw new ServerException(_m('Database error inserting queue item.')); } return true;