From c5a1579c80daddb0b3e8e3e8773b316e5316c1c3 Mon Sep 17 00:00:00 2001 From: xrogaan Date: Tue, 23 Dec 2008 05:22:27 +0100 Subject: [PATCH] fix a change name bug --- sources/Event.php | 21 +++++++++++++++++---- sources/IRCMain/Adapter.php | 4 ++-- 2 files changed, 19 insertions(+), 6 deletions(-) diff --git a/sources/Event.php b/sources/Event.php index e8120a7..339f6c6 100644 --- a/sources/Event.php +++ b/sources/Event.php @@ -66,6 +66,8 @@ class Event { */ protected $extraData; + public $onMOTD = false; + function __construct (IRCMain $ircmain) { $this->_ircmain = $ircmain; } @@ -96,7 +98,7 @@ class Event { */ function getAction() { - echo debug() ? "Event:: -> ".$this->incoming."\n" : ''; + echo debug() ? "Raw:: -> ".$this->incoming."\n" : ''; if (preg_match("`^ERROR :(Closing Link: )?(.*)$`i", $this->incoming)) { return self::ACT_DISCONNECT; @@ -117,8 +119,13 @@ class Event { case 313: return self::ACT_313; break; - case 372: case 375: case 376: // motd + case 372: case 375: // motd + $this->onMOTD = true; echo $this->incoming; + break; + case 376: + $this->onMOTD = false; + break; case 432: $this->_ircmain->newNick('NoNameBot'.rand(0,9).rand(0,9)); return self::ACT_432; @@ -135,8 +142,9 @@ class Event { break; } } else { - echo "Geeeh, I do not known what this mean ...\n"; - echo "Event::DEBUG :>".$this->incoming; + echo "\n"; + echo "Event::DEBUG(Line not grabbed) :>".$this->incoming; + echo "\n"; } // : PRIVMSG : @@ -221,6 +229,11 @@ class Event { return false; } } + + public function onPrivmsg() {} + public function onCtcp() {} + public function onMotd() {} + //public function } ?> \ No newline at end of file diff --git a/sources/IRCMain/Adapter.php b/sources/IRCMain/Adapter.php index 81f12bc..26ce60c 100644 --- a/sources/IRCMain/Adapter.php +++ b/sources/IRCMain/Adapter.php @@ -147,8 +147,8 @@ abstract class IRCMain_Adapter { } final protected function nick_change() { - echo "New nick : ".self::$myBotName."\n"; - if ($this->put('NICK :'.self::$myBotName)) { + echo "New nick : ".self::getConfig('nick')."\n"; + if ($this->put('NICK :'.self::getConfig('nick'))) { return true; } return false; -- 2.11.4.GIT