/**
  * Monitors prefix mode changes.
  *
  * @param \Phergie\Irc\Event\UserEventInterface $event
  * @param \Phergie\Irc\Bot\React\EventQueueInterface $queue
  */
 public function changePrefixModes(UserEventInterface $event, EventQueueInterface $queue)
 {
     $logger = $this->getLogger();
     $params = $event->getParams();
     // Disregard mode changes that are not applicable
     if (!isset($params['channel'])) {
         $logger->debug('Not a channel mode change, skipping');
         return;
     }
     if (!isset($params['params'])) {
         $logger->debug('No trailing parameters, skipping');
         return;
     }
     $connection = $event->getConnection();
     if (!$this->channelLists->contains($connection)) {
         $this->channelLists->attach($connection, new \ArrayObject());
     }
     $modesArray = $this->channelLists[$connection];
     $channel = $params['channel'];
     $changes = $this->parseChannelModeChange($connection, $params['mode'], $params['params']);
     // Something went wrong...
     if (empty($changes)) {
         $logger->debug('Could not parse mode change, refreshing prefixes');
         if (isset($modesArray[$channel])) {
             unset($modesArray[$channel]);
         }
         $queue->ircNames($channel);
         return;
     }
     foreach ($changes as $change) {
         if (empty($change['prefix'])) {
             continue;
         }
         $operation = $change['operation'];
         $mode = $change['mode'];
         $prefix = $change['prefix'];
         $nick = $change['param'];
         switch ($operation) {
             case '+':
                 $logger->debug('Adding user mode', array('channel' => $channel, 'nick' => $nick, 'mode' => $mode, 'prefix' => $prefix));
                 $modesArray[$channel][$nick][$mode] = true;
                 break;
             case '-':
                 $logger->debug('Removing user mode', array('channel' => $channel, 'nick' => $nick, 'mode' => $mode, 'prefix' => $prefix));
                 unset($modesArray[$channel][$nick][$mode]);
                 break;
         }
     }
 }