enanobot.php
changeset 49 4c4d69b2cd4d
parent 41 1d854f22ac5a
child 50 45164bc2567a
equal deleted inserted replaced
48:d793361a27ec 49:4c4d69b2cd4d
   187   else if ( in_array($message['nick'], $privileged_list) && preg_match('/^re(?:hash|load)?(?:config)?(?: |$)/', $message['message']) )
   187   else if ( in_array($message['nick'], $privileged_list) && preg_match('/^re(?:hash|load)?(?:config)?(?: |$)/', $message['message']) )
   188   {
   188   {
   189     require('config.php');
   189     require('config.php');
   190     $GLOBALS['privileged_list'] = $privileged_list;
   190     $GLOBALS['privileged_list'] = $privileged_list;
   191     $GLOBALS['alert_list'] = $alert_list;
   191     $GLOBALS['alert_list'] = $alert_list;
   192     $irc->privmsg($message['nick'], "Reloaded privileged_list and alert_list. privileged = " . str_replace("\n", '', print_r($privileged_list, true)) . "; alert = " . str_replace("\n", '', print_r($alert_list, true)));
   192     $GLOBALS['channels'] = $channels;
       
   193     print_r($channels);
       
   194     $in = array();
       
   195     foreach ( $irc->channels as $channel )
       
   196     {
       
   197       $channame = $channel->get_channel_name();
       
   198       if ( !in_array($channame, $channels) )
       
   199       {
       
   200         $channel->part("Leaving");
       
   201       }
       
   202       else
       
   203       {
       
   204         $in[] = $channame;
       
   205       }
       
   206     }
       
   207     unset($channel);
       
   208     foreach ( $channels as $channel )
       
   209     {
       
   210       if ( !in_array($channel, $in) )
       
   211       {
       
   212         $GLOBALS[ preg_replace('/^(#|&)/', '', $channel) ] = $irc->join($channel, 'enanobot_channel_event');
       
   213       }
       
   214     }
       
   215     $irc->privmsg($message['nick'], "Config has been reloaded.");
   193   }
   216   }
   194   else if ( substr($message['message'], 0, 1) == "\x01" && substr($message['message'], -1) == "\x01" )
   217   else if ( substr($message['message'], 0, 1) == "\x01" && substr($message['message'], -1) == "\x01" )
   195   {
   218   {
   196     $msg = trim($message['message'], "\x01");
   219     $msg = trim($message['message'], "\x01");
   197     list($ctcp) = explode(' ', $msg);
   220     list($ctcp) = explode(' ', $msg);