]> git.mxchange.org Git - quix0rs-gnu-social.git/commitdiff
Always remove messages from waiting queue and requeue messages if one fails
authorLuke Fitzgerald <lw.fitzgerald@googlemail.com>
Wed, 4 Aug 2010 23:14:25 +0000 (16:14 -0700)
committerLuke Fitzgerald <lw.fitzgerald@googlemail.com>
Wed, 4 Aug 2010 23:14:25 +0000 (16:14 -0700)
plugins/Msn/msnmanager.php

index 1eac596df2d187d04ecc88fa723ac960b95c08cd..42eb18b9c464a7bb1c9aa6bdd2d1019e41d7badb 100644 (file)
@@ -170,15 +170,17 @@ class MsnManager extends ImManager {
     * @param array $data Data\r
     */\r
     public function handle_session_ready($data) {\r
+        $sessionFailed = false;\r
         $wm = Msn_waiting_message::top($data['to']);\r
         while ($wm != NULL) {\r
-            if ($this->conn->sendMessage($wm->screenname, $wm->message, $ignore)) {\r
-                $wm->delete();\r
-            } else {\r
-                // Requeue the message in the regular queue\r
+            if ($sessionFailed) {\r
+                $this->plugin->send_message($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
             }\r
 \r
+            $wm->delete();\r
             $wm = Msn_waiting_message::top($data['to']);\r
         }\r
     }\r