Assembla home | Assembla project page
 

Changeset 93

Show
Ignore:
Timestamp:
03/01/08 18:10:58 (9 months ago)
Author:
tobias382
Message:

Fixes #28 Added support for custom reason messages to the Quit plugin

Files:

Legend:

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

    r76 r93  
    2323    * @return void 
    2424    */ 
     25    public function handleQuit() 
     26    { 
     27        $reason = $this->getPluginIni('reason'); 
     28        if (empty($reason)) { 
     29            $reason = 'by request of %nick%'; 
     30        } 
     31        $reason = str_replace('%nick%', $this->event->getNick(), $reason); 
     32        $this->doQuit($reason); 
     33    } 
     34 
    2535    public function onDoQuit() 
    2636    { 
    27         $this->doQuit('by request of ' . $this->event->getNick()); 
     37        $this->handleQuit(); 
    2838    } 
    2939 
    3040    public function onDoDie() 
    3141    { 
    32         $this->doQuit('bows to ' . $this->event->getNick() .' and commits seppuku'); 
     42        $this->handleQuit();  
    3343    } 
    3444} 
  • trunk/Phergie/phergie.ini

    r92 r93  
    158158 
    159159;----------------------------------------------------------------------------- 
     160; Quit  
     161;----------------------------------------------------------------------------- 
     162 
     163; quit.reason : 
     164;    custom reason message to use when quitting 
     165quit.reason =  
     166 
     167;----------------------------------------------------------------------------- 
    160168; URL 
    161169;-----------------------------------------------------------------------------