/**
  * Filters events that are not user-specific or are from the specified users.
  *
  * @param \Phergie\Irc\Event\EventInterface $event
  * @return boolean|null TRUE if the event originated from a user with a matching mask
  *         associated with this filter, FALSE if it originated from a user without a
  *         matching mask, or NULL if it did not originate from a user.
  */
 public function filter(EventInterface $event)
 {
     if (!$event instanceof UserEventInterface) {
         return null;
     }
     $nick = $event->getNick();
     if ($nick === null) {
         return null;
     }
     $userMask = sprintf('%s!%s@%s', $nick, $event->getUsername(), $event->getHost());
     foreach ($this->masks as $mask) {
         $pattern = '/^' . str_replace('*', '.*', $mask) . '$/';
         if (preg_match($pattern, $userMask)) {
             return true;
         }
     }
     return false;
 }