public function isOn($chan, $nick = null)
    {
        if ($nick === null) {
            return isset($this->chans[$chan]);
        }

        $nick       = self::extractNick($nick);
        $collator   = $this->connection->getCollator();
        $nick       = $collator->normalizeNick($nick);
        $key        = array_search($nick, $this->nicks);
        if ($key === false) {
            return false;
        }
        return isset($this->chans[$chan][$key]);
    }