Assembla home | Assembla project page
 

Changeset 224

Show
Ignore:
Timestamp:
04/13/08 00:45:20 (7 months ago)
Author:
Slynderdale
Message:

Added it so the bot has the ability to join a channel if invited to it by an OP and also added the ability to rejoin the channel if kicked by an op.

Files:

Legend:

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

    r217 r224  
    1616     */ 
    1717    public $passive = true; 
     18 
     19    /** 
     20     * Determines if the bot will autojoin a channel on an invite request 
     21     * 
     22     * @var bool 
     23     */ 
     24    public $joinInvite = true; 
     25 
     26    /** 
     27     * Determines if the bot will rejoin the channel when kicked 
     28     * 
     29     * @var bool 
     30     */ 
     31    public $joinKick = true; 
     32 
     33    /** 
     34     * Initializes settings 
     35     * 
     36     * @return void 
     37     */ 
     38    public function init() 
     39    { 
     40        $joinInvite = $this->getPluginIni('invite'); 
     41        if (isset($joinInvite)) { 
     42            $this->joinInvite = $joinInvite; 
     43        } 
     44 
     45        $joinKick = $this->getPluginIni('kick'); 
     46        if (isset($joinKick)) { 
     47            $this->joinKick = $joinKick; 
     48        } 
     49    } 
    1850 
    1951    /** 
     
    5688        } 
    5789    } 
     90 
     91    /** 
     92     * Intercepts invite requests and will have the bot join the channel if set 
     93     * in the configuration. 
     94     * 
     95     * @return void 
     96     */ 
     97    public function onInvite() 
     98    { 
     99        if ($this->joinInvite) { 
     100            $this->doJoin($this->event->getArgument(1)); 
     101        } 
     102    } 
     103 
     104    /** 
     105     * Intercepts kick requests and will have the bot rejoin the channel if set 
     106     * in the configuration. 
     107     * 
     108     * @return void 
     109     */ 
     110    public function onKick() 
     111    { 
     112        if ($this->joinKick && 
     113            $this->event->getArgument(1) == $this->getIni('nick')) { 
     114            $this->doJoin($this->event->getArgument(0)); 
     115        } 
     116    } 
    58117} 
  • trunk/Phergie/phergie.ini

    r221 r224  
    146146autojoin.channels = "" 
    147147 
     148; autojoin.invite : 
     149;    whether or not the bot will join a channel if an OP sent an invite request 
     150;    from that channel 
     151autojoin.invite = true 
     152 
     153; autojoin.kick : 
     154;    whether or not to have the bot will rejoin a channel automatically when it 
     155;    is kicked. 
     156;    Note: The bot will not rejoin a channel if part is used 
     157autojoin.kick = true 
     158 
    148159;----------------------------------------------------------------------------- 
    149160; Feed Ticker