]> git.mxchange.org Git - quix0rs-gnu-social.git/commitdiff
Messages with new lines split at plugin stage for reliability
authorLuke Fitzgerald <lw.fitzgerald@googlemail.com>
Wed, 4 Aug 2010 16:10:57 +0000 (09:10 -0700)
committerLuke Fitzgerald <lw.fitzgerald@googlemail.com>
Wed, 4 Aug 2010 16:10:57 +0000 (09:10 -0700)
plugins/Irc/IrcPlugin.php
plugins/Irc/ircmanager.php

index dec6d7e8328148b953d32908df7e037e919ae1fb..855aa3305ede9e87ae0e22271456bfb5bb82b6b8 100644 (file)
@@ -165,8 +165,11 @@ class IrcPlugin extends ImPlugin {
      * @return boolean success value
      */
     public function send_message($screenname, $body) {
-        $this->fake_irc->doPrivmsg($screenname, $body);
-        $this->enqueue_outgoing_raw(array('type' => 'message', 'data' => $this->fake_irc->would_be_sent));
+        $lines = explode("\n", $body);
+        foreach ($lines as $line) {
+            $this->fake_irc->doPrivmsg($screenname, $line);
+            $this->enqueue_outgoing_raw(array('type' => 'message', 'data' => $this->fake_irc->would_be_sent));
+        }
         return true;
     }
 
index 8d9cac885b3998a068036189744f666d74b0a317..51996bef9969595cccbe600ce15ea0fa4509304a 100644 (file)
@@ -240,12 +240,8 @@ class IrcManager extends ImManager {
             $this->regchecksLookup[$usernick] = $screenname;
         }
 
-        $args = $data['data']['args'];
-        $lines = explode("\n", $args[1]);
         try {
-            foreach ($lines as $line) {
-                $this->conn->send($data['data']['command'], array($args[0], $line));
-            }
+            $this->conn->send($data['data']['command'], $data['data']['args']);
         } catch (Phergie_Driver_Exception $e) {
             $this->conn->reconnect();
             return false;