From efdf9b6d4e3c6e8c4ce49a5d5f9e42658d1dc004 Mon Sep 17 00:00:00 2001 From: Luke Fitzgerald Date: Tue, 20 Jul 2010 11:16:59 -0700 Subject: Code now functional - lots of error checking and extras missing still though --- plugins/Irc/ircmanager.php | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) (limited to 'plugins/Irc/ircmanager.php') diff --git a/plugins/Irc/ircmanager.php b/plugins/Irc/ircmanager.php index 549936ae7..2157964f6 100644 --- a/plugins/Irc/ircmanager.php +++ b/plugins/Irc/ircmanager.php @@ -81,13 +81,14 @@ class IrcManager extends ImManager { */ public function connect() { if (!$this->conn) { - $this->conn = new Phergie_Extended_Bot; + $this->conn = new Phergie_ExtendedBot; - $password = isset($this->plugin->password) ? $this->plugin->password : ''; - $transport = isset($this->plugin->transport) ? $this->plugin->transport : 'tcp'; - $encoding = isset($this->plugin->encoding) ? $this->plugin->encoding : 'ISO-8859-1'; - $nickservpassword = isset($this->plugin->nickservpassword) ? $this->plugin->nickservpassword : ''; - $channels = isset($this->plugin->channels) ? $this->plugin->channels : array(); + $port = empty($this->plugin->port) ? 6667 : $this->plugin->port; + $password = empty($this->plugin->password) ? '' : $this->plugin->password; + $transport = empty($this->plugin->transporttype) ? 'tcp' : $this->plugin->transporttype; + $encoding = empty($this->plugin->encoding) ? 'ISO-8859-1' : $this->plugin->encoding; + $nickservpassword = empty($this->plugin->nickservpassword) ? '' : $this->plugin->nickservpassword; + $channels = empty($this->plugin->channels) ? array() : $this->plugin->channels; $config = new Phergie_Config; $config->readArray( @@ -95,10 +96,10 @@ class IrcManager extends ImManager { 'connections' => array( array( 'host' => $this->plugin->host, - 'port' => $this->plugin->port, + 'port' => $port, 'username' => $this->plugin->username, 'realname' => $this->plugin->realname, - 'nick' => $this->plugin->nickname, + 'nick' => $this->plugin->nick, 'password' => $password, 'transport' => $transport, 'encoding' => $encoding -- cgit v1.2.3-54-g00ecf