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