diff options
author | Luke Fitzgerald <lw.fitzgerald@googlemail.com> | 2010-08-04 09:10:57 -0700 |
---|---|---|
committer | Luke Fitzgerald <lw.fitzgerald@googlemail.com> | 2010-08-04 09:10:57 -0700 |
commit | 65a741cce2a02057e858ab4bbf8b5e8ae8c4a73e (patch) | |
tree | 57a4cf437dde77a474b5dbdd692773e00be841c0 | |
parent | 2250273942aadbdf8ec4603eb693259c359d1b79 (diff) |
Messages with new lines split at plugin stage for reliability
-rw-r--r-- | plugins/Irc/IrcPlugin.php | 7 | ||||
-rw-r--r-- | plugins/Irc/ircmanager.php | 6 |
2 files changed, 6 insertions, 7 deletions
diff --git a/plugins/Irc/IrcPlugin.php b/plugins/Irc/IrcPlugin.php index dec6d7e83..855aa3305 100644 --- a/plugins/Irc/IrcPlugin.php +++ b/plugins/Irc/IrcPlugin.php @@ -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; } diff --git a/plugins/Irc/ircmanager.php b/plugins/Irc/ircmanager.php index 8d9cac885..51996bef9 100644 --- a/plugins/Irc/ircmanager.php +++ b/plugins/Irc/ircmanager.php @@ -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; |