Changeset 143
- Timestamp:
- 03/09/08 03:34:02 (9 months ago)
- Files:
-
- trunk/Phergie/Plugin/Quit.php (modified) (1 diff)
- trunk/Phergie/Plugin/Reconnect.php (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
trunk/Phergie/Plugin/Quit.php
r93 r143 23 23 * @return void 24 24 */ 25 public function handleQuit( )25 public function handleQuit($message='') 26 26 { 27 $reason = $this->getPluginIni('reason'); 28 if (empty($reason)) { 29 $reason = 'by request of %nick%'; 27 if ($this->fromAdmin(true)) { 28 $reason = trim(!empty($message) ? $message : $this->getPluginIni('reason')); 29 if(substr($reason, 0, 1) === '(' && substr($reason, -1) === ')') { 30 $reason = substr($reason, 1, -1); 31 } 32 if (empty($reason)) { 33 $reason = 'by request of %nick%'; 34 } 35 $reason = str_replace('%nick%', $this->event->getNick(), trim($reason)); 36 $this->doQuit($reason); 30 37 } 31 $reason = str_replace('%nick%', $this->event->getNick(), $reason);32 $this->doQuit($reason);33 38 } 34 39 35 public function onDoQuit( )40 public function onDoQuit($message='') 36 41 { 37 $this->handleQuit( );42 $this->handleQuit($message); 38 43 } 39 44 40 public function onDoDie( )45 public function onDoDie($message='') 41 46 { 42 $this->handleQuit( );47 $this->handleQuit($message); 43 48 } 44 49 } trunk/Phergie/Plugin/Reconnect.php
r122 r143 22 22 ); 23 23 24 public function onDoReconnect( )24 public function onDoReconnect($message='') 25 25 { 26 $this->doQuit($this->messages[array_rand($this->messages, 1)], true); 26 if ($this->fromAdmin(true)) { 27 $message = trim($message); 28 if(substr($message, 0, 1) === '(' && substr($message, -1) === ')') { 29 $message = substr($message, 1, -1); 30 } 31 $this->doQuit((!empty($message)?trim($message):$this->messages[array_rand($this->messages, 1)]), true); 32 } 27 33 } 28 34 }