Changeset 308
- Timestamp:
- 12/13/08 20:37:21 (5 years ago)
- Files:
-
- 1 modified
-
trunk/Phergie/Plugin/Remind.php (modified) (3 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/Phergie/Plugin/Remind.php
r289 r308 9 9 class Phergie_Plugin_Remind extends Phergie_Plugin_Abstract_Command 10 10 { 11 /** 12 * Number of reminders to show in public 13 */ 14 const PUBLIC_REMINDERS = 3; 15 11 16 /** 12 17 * Indicates that a local directory is required for this plugin … … 269 274 270 275 // fetch and deliver messages 271 foreach ($this->fetchMessages($channel, $nick) as $msg) { 276 $reminders = $this->fetchMessages($channel, $nick); 277 if (count($reminders) > self::PUBLIC_REMINDERS) { 278 $msgs = array_slice($reminders, 0, self::PUBLIC_REMINDERS); 279 $privmsgs = array_slice($reminders, self::PUBLIC_REMINDERS); 280 } else { 281 $msgs = $reminders; 282 $privmsgs = false; 283 } 284 foreach ($msgs as $msg) { 272 285 $this->doPrivmsg( 273 286 $channel, … … 277 290 $this->deleteMessage($msg['rowid'], $channel, $nick); 278 291 } 292 if ($privmsgs) { 293 foreach ($privmsgs as $msg) { 294 $this->doPrivmsg( 295 $nick, 296 "{$nick}: (from {$msg['sender']}, {$msg['time']}) " . 297 $msg['message'] 298 ); 299 $this->deleteMessage($msg['rowid'], $channel, $nick); 300 } 301 $this->doPrivmsg( 302 $channel, 303 "{$nick}: (" . count($privmsgs) . " more messages sent in private.)" 304 ); 305 } 279 306 } 280 307