Assembla home | Assembla project page
 

Changeset 129

Show
Ignore:
Timestamp:
03/05/08 23:40:26 (9 months ago)
Author:
Seldaek
Message:

* Nickserv: supports custom nickserv bot nick (thanks Slynderdale)
* Set: added "get <varName>" to get the current value

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • trunk/Phergie/Plugin/Nickserv.php

    r106 r129  
    2727    protected $nick; 
    2828 
     29 
     30    /** 
     31    * The name of the nickserv bot 
     32    * 
     33    * @var string 
     34    */ 
     35    protected $botNick; 
     36 
    2937    /** 
    3038    * Initializes instance variables. 
     
    3745 
    3846        $this->nick = $this->getIni('nick'); 
     47 
     48        // Get the name of the NickServ bot, defaults to NickServ 
     49        $this->botNick = $this->getIni('bot_nick'); 
     50        if (!$this->botNick) $this->botNick = 'NickServ'; 
    3951    } 
    4052 
     
    6375    public function onNotice() 
    6476    { 
    65         if ($this->event->getNick() == 'NickServ') { 
     77        if (strtolower($this->event->getNick()) == strtolower($this->botNick)) { 
    6678            $message = $this->event->getArgument(1); 
    6779            if ($message == 'This nickname is owned by someone else') { 
    6880                $password = $this->getPluginIni('password'); 
    6981                if (! empty($password)) { 
    70                     $this->doPrivmsg('NickServ', 'IDENTIFY ' . $password); 
     82                    $this->doPrivmsg($this->botNick, 'IDENTIFY ' . $password); 
    7183                } 
    7284            } elseif (preg_match('/^.*' . $this->nick . '.* has been killed/', $message)) { 
     
    102114            if (!empty ($password)) { 
    103115                $this->doPrivmsg( 
    104                     'NickServ'
     116                    $this->botNick
    105117                    'GHOST ' . $this->nick . ' ' . $password 
    106118                ); 
  • trunk/Phergie/Plugin/Set.php

    r128 r129  
    4040        file_put_contents($ini, $contents); 
    4141    } 
     42 
     43        public function onDoGet($var) 
     44        { 
     45                $val = $this->getIni($var); 
     46                $this->doPrivmsg($this->event->getSource(), $var.' = '.($val===null?'null':$val)); 
     47        } 
    4248 
    4349        /** 
  • trunk/Phergie/phergie.ini

    r107 r129  
    5656 
    5757; ignore : 
    58 ;   a comma- or space-delimited list of hostmasks (may contain wildcards  
    59 ;   using *) of users from which events should be ignored (i. e. not  
     58;   a comma- or space-delimited list of hostmasks (may contain wildcards 
     59;   using *) of users from which events should be ignored (i. e. not 
    6060;   processed by plugins), surrounded by double-quotes 
    61 ignore =  
     61ignore = 
    6262 
    6363; plugins : 
     
    175175 
    176176; nickserv.password : 
    177 ;    password to use when identifying the bot to NickServ where 
     177;    password to use when identifying the bot to the NickServ bot where 
    178178;    authentication will only take place if a non-empty password is specified 
    179179nickserv.password = 
     180 
     181; nickserv.bot_nick : 
     182;    The name of the bot that the server uses for Nickerv authentication. 
     183;    Defaults to NickServ is left blank. 
     184nickserv.bot_nick = "NickServ" 
    180185 
    181186;----------------------------------------------------------------------------- 
     
    190195; SpellCheck 
    191196;----------------------------------------------------------------------------- 
    192                                       
     197 
    193198; spellcheck.lang : 
    194 ;     dictionary language to use, defaults to en (English)  
     199;     dictionary language to use, defaults to en (English) 
    195200spellcheck.lang = "en" 
    196                                                                            
    197 ; spellcheck.limit :  
    198 ;     limit on the number of potential correct spellings to return, defaults  
     201 
     202; spellcheck.limit : 
     203;     limit on the number of potential correct spellings to return, defaults 
    199204;     to 5 
    200205spellcheck.limit = 5