/** * Constructs a new event related to a notification. * * \param Erebot::Interfaces::Connection $connection * Connection the event originated from. * * \param string $source * Nickname of the IRC user this notification is about. * * \param string $ident * Identity of the IRC user this notification is about. * * \param string $host * Hostname of the IRC user this notification is about. * * \param DateTime $timestamp * Object that keeps track of when the notification * was issued. * * \param string $text * Message explaining why the notification was triggered. */ public function __construct(\Erebot\Interfaces\Connection $connection, $source, $ident, $host, \DateTime $timestamp, $text) { if ($ident !== null && $host !== null) { $source .= '!' . $ident . '@' . $host; } parent::__construct($connection, $source, $text); $this->timestamp = $timestamp; }
/** * Creates a new event representing a CTCP message. * * \param Erebot::Interface::Connection $connection * The connection this event came from. * * \param string $source * Source identified for this event. * * \param string $ctcpType * Type of CTCP message being represented. * * \param string $text * Text contained in this CTCP message. */ public function __construct(\Erebot\Interfaces\Connection $connection, $source, $ctcpType, $text) { parent::__construct($connection, $source, $text); $this->ctcpType = $ctcpType; }