Assembla home | Assembla project page
 

Changeset 207

Show
Ignore:
Timestamp:
04/04/08 19:25:17 (8 months ago)
Author:
Slynderdale
Message:

Changed it so ops can mute passive plugins, that there is a delat of 5 minutes between Feedticker postings which can be configured in the ini, made CTCP non-passive and added a quit alias called exit.

Files:

Legend:

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

    r204 r207  
    66class Phergie_Plugin_Ctcp extends Phergie_Plugin_Abstract_Base 
    77{ 
    8     /** 
    9     * Determines if the plugin is a passive plugin or not 
    10     * 
    11     * @var bool 
    12     */ 
    13     public $passive = true; 
    14  
    158    public function onTime() 
    169    { 
  • trunk/Phergie/Plugin/FeedTicker.php

    r204 r207  
    2121 
    2222    /** 
     23    * Delay in minutes between checking the queue, set to 5 minutes 
     24    * 
     25    * @var int 
     26    */ 
     27    protected $postThrottle = 5; 
     28 
     29    /** 
    2330    * Feed data 
    2431    * 
     
    93100    public function init() 
    94101    { 
     102        // Delay between feed syndications 
     103        $fetchDelay = intval($this->getPluginIni('fetch')); 
     104        if ($fetchDelay  > 0) { 
     105            $this->defaultDelay = $fetchDelay * 60; 
     106        } 
     107 
     108        // Post throttle 
     109        $postThrottle = intval($this->getPluginIni('post')); 
     110        if ($postThrottle  > 0) { 
     111            $this->postThrottle  = $postThrottle; 
     112        } 
     113 
    95114        // Global Feed Title, Feed URL and Article Title Filters 
    96115        $globalTitle = trim($this->getPluginIni('filter_title')); 
     
    175194                ); 
    176195            } 
    177             $this->nextOutput = time() + 60
     196            $this->nextOutput = time() + ($this->postThrottle * 60)
    178197        } 
    179198    } 
  • trunk/Phergie/Plugin/Quit.php

    r204 r207  
    207207 
    208208    /** 
     209    * Processes requests for the bot to disconnect from the server. 
     210    * 
     211    * @return void 
     212    */ 
     213    public function onDoExit($message = '') 
     214    { 
     215        $user = $this->event->getNick(); 
     216        if ($this->fromAdmin(false)) { 
     217            $this->handleQuit($message); 
     218        } else { 
     219            $this->doNotice($user, 'You do not have permission to use exit.'); 
     220        } 
     221    } 
     222 
     223    /** 
    209224    * Reconnects to the server and rehashes the ini data 
    210225    * 
  • trunk/Phergie/Plugin/Toggle.php

    r205 r207  
    203203            if ($instance = $this->getPlugin($plugin)) { 
    204204                $for = ($target==strtolower($this->event->getSource())?'for this channel':($target=='global'?'globally':'for '.$target)); 
    205                 if ($instance->passive && !$this->fromAdmin(false)) { 
    206                     $this->doNotice($user, 'You do not have permission to mute passive plugins.'); 
    207                 } else { 
    208                     if (empty($instance->muted[$target])) { 
    209                         $instance->muted[$target] = true; 
    210                         $this->updateToggleState($plugin, $target, true); 
    211                         $this->doNotice($user, 'Muted '.$plugin.' '.$for.'.'); 
    212                     } else { 
    213                         $this->doNotice($user, $plugin.' is already muted '.$for.'.'); 
    214                     } 
     205                if (empty($instance->muted[$target])) { 
     206                    $instance->muted[$target] = true; 
     207                    $this->updateToggleState($plugin, $target, true); 
     208                    $this->doNotice($user, 'Muted '.$plugin.' '.$for.'.'); 
     209                } else { 
     210                    $this->doNotice($user, $plugin.' is already muted '.$for.'.'); 
    215211                } 
    216212            } else { 
  • trunk/Phergie/phergie.ini

    r204 r207  
    150150;----------------------------------------------------------------------------- 
    151151 
    152 ; feedticker.delay
     152; feedticker.fetch
    153153;    the frequency, in seconds, at which the feeds are checked for new data; 
    154 ;    the default is 1800 (every 30 minutes) 
    155 feedticker.delay = 1800 
     154;    the default is 30 minutes 
     155feedticker.fetch = 30 
     156 
     157; feedticker.post : 
     158;    the frequency, in minutes, at which new feed entries in the queue will be 
     159;    sent to the channel; the default is 5 minutes 
     160feedticker.post = 5 
    156161 
    157162; feedticker.format :