public function processNick(UserEvent $event, Queue $queue)
    {
        $logger = $this->getLogger();

        $nick = $event->getNick();
        if ($nick == $event->getConnection()->getNickname()) {
            $logger->debug('Nickname of incoming NICK is ours, ignoring');
            return;
        }

        $server = strtolower($event->getConnection()->getServerHostname());
        $params = $event->getParams();
        $newnick = $params['nickname'];

        $logger->debug('Processing incoming NICK', array(
            'server' => $server,
            'nick' => $nick,
            'newnick' => $newnick,
        ));

        foreach ($this->channels[$server] as $channel => $users) {
            if (isset($users[$nick])) {
                $logger->debug('Processing channel nick change', array(
                    'server' => $server,
                    'channel' => $channel,
                    'nick' => $nick,
                    'newnick' => $newnick,
                ));

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

                try {
                    $this->db->fetchAssoc(self::SQL_UPDATE, array(
                        ':time' => time(),
                        ':server' => $server,
                        ':channel' => $channel,
                        ':nick' => $nick,
                        ':type' => self::TYPE_NICK,
                        ':text' => $newnick,
                    ));
                } catch (\Exception $e) {
                    $logger->error($e->getMessage());
                }
            }
        }
    }