public function filter(EventInterface $event)
    {
        if (!$event instanceof UserEventInterface) {
            return null;
        }

        $channels = $this->getChannels($event);
        $nick = $event->getNick();
        if (empty($channels) || $nick === null) {
            return null;
        }

        $connection = $event->getConnection();

        foreach ($channels as $channel) {
            $userModes = $this->userMode->getUserModes($connection, $channel, $nick);
            $commonModes = array_intersect($userModes, $this->modes);
            if ($commonModes) {
                return true;
            }
        }

        return false;
    }