src/Plugin.php
public function processKick(UserEvent $event, Queue $queue)
    {
        $logger = $this->getLogger();

        $server = strtolower($event->getConnection()->getServerHostname());
        $params = $event->getParams();
        $channel = $params['channel'];
        $nick = $params['user'];
        $message = isset($params['comment']) ? $params['comment'] : null;

        if ($nick == $event->getConnection()->getNickname()) {
            $logger->debug('Removing channel', array('server' => $server, 'channel' => $channel));
            unset($this->channels[$server][$channel]);
            return;
        }

        $logger->debug('Processing incoming KICK', array(
            'server' => $server,
            'channel' => $channel,
            'nick' => $nick,
            'message' => $message,
        ));

        unset($this->channels[$server][$channel][$nick]);

        try {
            $this->db->fetchAssoc(self::SQL_UPDATE, array(
                ':time' => time(),
                ':server' => $server,
                ':channel' => $channel,
                ':nick' => $nick,
                ':type' => self::TYPE_KICK,
                ':text' => $message,
            ));
        } catch (\Exception $e) {
            $logger->error($e->getMessage());
        }
    }
public function processKick(UserEvent $event, Queue $queue)
    {
        $logger = $this->getLogger();

        $server = strtolower($event->getConnection()->getServerHostname());
        $params = $event->getParams();
        $channel = $params['channel'];
        $nick = $params['user'];
        $message = isset($params['comment']) ? $params['comment'] : null;

        if ($nick == $event->getConnection()->getNickname()) {
            $logger->debug('Removing channel', array('server' => $server, 'channel' => $channel));
            unset($this->channels[$server][$channel]);
            return;
        }

        $logger->debug('Processing incoming KICK', array(
            'server' => $server,
            'channel' => $channel,
            'nick' => $nick,
            'message' => $message,
        ));

        unset($this->channels[$server][$channel][$nick]);

        try {
            $this->db->fetchAssoc(self::SQL_UPDATE, array(
                ':time' => time(),
                ':server' => $server,
                ':channel' => $channel,
                ':nick' => $nick,
                ':type' => self::TYPE_KICK,
                ':text' => $message,
            ));
        } catch (\Exception $e) {
            $logger->error($e->getMessage());
        }
    }
public function processKick ( UserEvent $ event , Queue $ queue ) { $ logger = $ this -> getLogger ( ) ; $ server = strtolower ( $ event -> getConnection ( ) -> getServerHostname ( ) ) ; $ params = $ event -> getParams ( ) ; $ channel = $ params [ 'channel' ] ; $ nick = $ params [ 'user' ] ; $ message = isset ( $ params [ 'comment' ] ) ? $ params [ 'comment' ] : null ; if ( $ nick == $ event -> getConnection ( ) -> getNickname ( ) ) { $ logger -> debug ( 'Removing channel' , array ( 'server' => $ server , 'channel' => $ channel ) ) ; unset ( $ this -> channels [ $ server ] [ $ channel ] ) ; return ; } $ logger -> debug ( 'Processing incoming KICK' , array ( 'server' => $ server , 'channel' => $ channel , 'nick' => $ nick , 'message' => $ message , ) ) ; unset ( $ this -> channels [ $ server ] [ $ channel ] [ $ nick ] ) ; try { $ this -> db -> fetchAssoc ( self :: SQL_UPDATE , array ( ':time' => time ( ) , ':server' => $ server , ':channel' => $ channel , ':nick' => $ nick , ':type' => self :: TYPE_KICK , ':text' => $ message , ) ) ; } catch ( \ Exception $ e ) { $ logger -> error ( $ e -> getMessage ( ) ) ; } }
Monitor channel kicks.

@param \Phergie\Irc\Event\UserEventInterface $event
@param \Phergie\Irc\Bot\React\EventQueueInterface $queue
Monitor channel kicks .