* @return true if processing completed, false if message should be reprocessed
*/
public function receive_raw_message($data) {
- $this->handle_incoming($data['sender'], $data['message']);
+ if (strpos($data['source'], '#') === 0) {
+ $message = $data['message'];
+ $nickpos = strpos($message, $this->nick);
+ $colonpos = strpos($message, ':', $nickpos);
+ if ($nickpos === 0 && $colonpos == strlen($this->nick)) {
+ $this->handle_incoming($data['sender'], substr($message, $colonpos+1));
+ }
+ } else {
+ $this->handle_incoming($data['sender'], $data['message']);
+ }
return true;
}
if ($this->messageCallback !== NULL) {\r
$event = $this->getEvent();\r
$source = $event->getSource();\r
+ $sender = $event->getNick();\r
$message = trim($event->getText());\r
\r
- call_user_func($this->messageCallback, array('sender' => $source, 'message' => $message));\r
+ call_user_func($this->messageCallback, array('source' => $source, 'sender' => $sender, 'message' => $message));\r
}\r
}\r
\r
}
}
- /**
- * Idle processing for io manager's execution loop.
- * Send keepalive pings to server.
- *
- * @return void
- */
- public function idle() {
- // Call Phergie's doTick methods if necessary
- try {
- $this->conn->handleEvents();
- } catch (Phergie_Driver_Exception $e) {
- $this->conn->reconnect();
- }
- }
-
/**
* Process IRC events that have come in over the wire.
*