]> git.mxchange.org Git - quix0rs-gnu-social.git/commitdiff
Reset message to non-delay type before requeuing
authorLuke Fitzgerald <lw.fitzgerald@googlemail.com>
Wed, 11 Aug 2010 01:34:12 +0000 (18:34 -0700)
committerLuke Fitzgerald <lw.fitzgerald@googlemail.com>
Wed, 11 Aug 2010 01:34:12 +0000 (18:34 -0700)
plugins/Irc/ircmanager.php

index 7e2b32b23e7aa1e50c76d45a428a44a10a8cc65a..aa0ff3539f9c27fa393a8b5d841eedb419136a08 100644 (file)
@@ -69,8 +69,17 @@ class IrcManager extends ImManager {
         }
     }
 
+    /**
+     * Request a maximum timeout for listeners before the next idle period.
+     *
+     * @return integer Maximum timeout
+     */
     public function timeout() {
-        return 1;
+        if ($this->messageWaiting) {
+            return 1;
+        } else {
+            return 120;
+        }
     }
 
     /**
@@ -95,7 +104,13 @@ class IrcManager extends ImManager {
                 $data = unserialize($wm->data);
 
                 if (!$this->send_raw_message($data)) {
-                    $this->plugin->enqueue_outgoing_raw($data);
+                    $this->plugin->enqueue_outgoing_raw(
+                        array(
+                            'type' => 'message',
+                            'prioritise' => $data['prioritise'],
+                            'data' => $data['data']
+                        )
+                    );
                 }
 
                 $wm->delete();