Skip to content

Commit

Permalink
fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
pBlueG committed Apr 23, 2014
1 parent 363e7b4 commit da1be81
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 11 deletions.
2 changes: 1 addition & 1 deletion classes/bot.class.php
Original file line number Diff line number Diff line change
Expand Up @@ -322,7 +322,7 @@ public function _EventHandler($in_buffer)
if($this->_isChild())
return;
if(is_numeric($sSplit[1])) {
$sSplit[3] = substr($sSplit[3], 1);
//$sSplit[3] = substr($sSplit[3], 1);
$ptr->_triggerEvent($this, "onRawEvent", $sSplit[1], array_slice($sSplit, 3), $sIdent);
}
break;
Expand Down
3 changes: 2 additions & 1 deletion configuration/general.ini
Original file line number Diff line number Diff line change
Expand Up @@ -11,4 +11,5 @@ Ping = 45 ; specifies the bot ping timeout check in seconds
;Plugins[] = test ; plugins loaded on startup, use !load/!unload when the bot is connected
Plugins[] = ctcp
Plugins[] = dcc
Plugins[] = "auto_perform"
Plugins[] = "auto_perform"
Plugins[] = "channel_log"
19 changes: 10 additions & 9 deletions plugins/channel_log.plugin.php
Original file line number Diff line number Diff line change
Expand Up @@ -130,27 +130,28 @@ public function onUserQuit($bot, $user, $quitmsg, $ident)
public function onChannelMode($bot, $channel, $user, $mode, $option, $ident)
{
if(in_array(strtolower($channel), $this->m_aChannels)) {
$szFormat = sprintf('%s %s sets mode %s %s', date('[H:i:s]'), $user, $mode, $option);
$szFormat = sprintf('%s * %s sets mode %s %s', date('[H:i:s]'), $user, $mode, $option);
Log::_Log(self::LOG_PATH.$channel, $szFormat);
}
}

public function onChannelTopic($bot, $channel, $user, $topic, $ident)
{
if(in_array(strtolower($channel), $this->m_aChannels)) {
$szFormat = sprintf('%s %s changed topic to: %s', date('[H:i:s]'), $user, $topic);
$szFormat = sprintf('%s * %s changed topic to: %s', date('[H:i:s]'), $user, $topic);
Log::_Log(self::LOG_PATH.$channel, $szFormat);
}
}

public onRawEvent($bot, $rawcode, $data, $server_ident)
public function onRawEvent($bot, $rawcode, $data, $server_ident)
{
switch($rawcode) {
case 332:
// TODO:
// Now talking in #chan
// Topic is...
break;
if($rawcode == 332) {
if(in_array(strtolower($data[0]), $this->m_aChannels)) {
$time = date('[H:i:s]');
$sTopic = substr(implode(' ', array_slice($data, 1)), 1);
$szFormat = sprintf("%s * Now talking in %s\r\n%s * Topic is: %s", $time, $data[0], $time, $sTopic);
Log::_Log(self::LOG_PATH.$data[0], $szFormat);
}
}
}

Expand Down

0 comments on commit da1be81

Please sign in to comment.