public function handleLeaving(
        \Erebot\Interfaces\EventHandler         $handler,
        \Erebot\Interfaces\Event\Base\Generic   $event
    ) {
        if ($event instanceof \Erebot\Interfaces\Event\Kick) {
            $nick = (string) $event->getTarget();
        } else {
            $nick = (string) $event->getSource();
        }

        $collator   = $this->connection->getCollator();
        $nick       = $collator->normalizeNick($nick);
        $key        = array_search($nick, $this->nicks);

        if ($event instanceof \Erebot\Interfaces\Event\Quit) {
            foreach ($this->chans as $chan => $data) {
                if (isset($data[$key])) {
                    unset($this->chans[$chan][$key]);
                }
            }
        } else {
            unset($this->chans[$event->getChan()][$key]);
        }

        if (!count($this->getCommonChans($nick))) {
            $this->ial[$key]['ison'] = false;
            $delay = $this->parseInt('expire_delay', 60);
            if ($delay < 0) {
                $delay = 0;
            }

            if (!$delay) {
                $this->realRemoveUser($nick);
            } else {
                $timerCls       = $this->getFactory('!Timer');
                $timer = new $timerCls(
                    array($this, 'removeUser'),
                    $delay,
                    false,
                    array($nick)
                );
                $this->addTimer($timer);
            }
        }
    }