Joins a channel if nickname and channel matches the own nickname
and a channel in 'channels' configuration respectively.

@param string $nickname
@param \Phergie\Irc\Event\UserEventInterface $event
@param \Phergie\Irc\Bot\React\EventQueueInterface $queue
500009
public function joinOnMatch($nickname, UserEventInterface $event, EventQueueInterface $queue)
    {
        if ($nickname == $event->getConnection()->getNickname()
            && ($index = array_search($event->getSource(), $this->channels)) !== false) {
            $queue->ircJoin($this->channels[$index],
                $this->keys ? $this->keys[$index] : null);
        }
    }
1296190
public function handleQuitCommand(CommandEvent $event, EventQueueInterface $queue)
    {
        $message = sprintf($this->message, $event->getNick());
        $queue->ircQuit($message);
    }
363355
public function handleActCommand(Event $event, Queue $queue)
    {
        $params = $event->getCustomParams();
        if (count($params) < 2) {
            $this->handleActHelp($event, $queue);
        } else {
            $channels = array_shift($params);
            $queue->ctcpAction($channels, implode(' ', $params));
        }
    }
26103
public function queueEvent($event)
    {
        $this->queue->enqueue($event);

        $class = get_class($event);
        foreach ($this->synchronousEventMap->getListenersForEvent($class) as $listener)
        {
            $this->invokeListener($listener, $event);
        }
    }
1163825
protected function matchEventQueue(
        /*# string */ $eventName,
        EventManagerInterface $manager
    )/*# : EventQueueInterface */ {
        $names = $this->globNames($eventName, $manager->getEventNames());

        // combine all globbing queue
        $queue = new EventQueue();
        foreach ($names as $n) {
            if ($manager->hasEventQueue($n)) {
                $queue = $queue->combine($manager->getEventQueue($n));
            }
        }

        return $queue;
    }
680432
public function ircWhowas($nickname, $count = null, $server = null)
    {
        return $this->getIrcMessage('WHOWAS', array($nickname, $count, $server));
    }
842167
public function join(Event $event)
    {
        $this->authorize('join', Event::class);
        $event->addUser(User::findOrfail(Auth::id()));

        return redirect()->route('laralum::events.index')
            ->with('success', __('laralum_events::general.joined_event', ['id' => $event->id]));
    }
831194
public function handleDnsCommand(CommandEventInterface $event, EventQueueInterface $queue)
    {
        if (get_class($event) !== '\Phergie\Irc\Plugin\React\Command\CommandEvent' &&
            get_class($event) !== 'Phergie\Irc\Plugin\React\Command\CommandEvent' &&
            !is_subclass_of($event, '\Phergie\Irc\Plugin\React\Command\CommandEvent')
        ) {
            throw new \BadMethodCallException(
                get_class($event) . ' given, expected: Phergie\Irc\Plugin\React\Command\CommandEvent'
            );
        }

        foreach ($event->getCustomParams() as $hostname) {
            $this->logDebug('Looking up: ' . $hostname);
            $this->resolveDnsQuery(
                new Query(
                    $hostname,
                    function ($ip, $hostname) use ($event, $queue) {
                        $message = $hostname . ': ' . $ip;
                        $this->logDebug($message);
                        foreach ($event->getTargets() as $target) {
                            $queue->ircPrivmsg($target, $message);
                        }
                    },
                    function ($error, $hostname) use ($event, $queue) {
                        $message = $hostname . ': error looking up hostname: ' . $error->getMessage();
                        $this->logDebug($message);
                        foreach ($event->getTargets() as $target) {
                            $queue->ircPrivmsg($target, $message);
                        }
                    }
                )
            );
        }
    }
1131608
public function ircUserhost($nickname1, $nickname2 = null, $nickname3 = null, $nickname4 = null, $nickname5 = null)
    {
        $this->queueIrcRequest('USERHOST', [ $nickname1, $nickname2, $nickname3, $nickname4, $nickname5 ]);
    }
1006167
public function subscribeQueueEvents(QueueManager $queue)
    {
        $queue->looping(function () {
            // Flush any and all events that were possibly generated by queue jobs
            Integration::flushEvents();

            // We have added a scope when a job starts processing
            Hub::getCurrent()->popScope();
        });

        foreach (static::$queueEventHandlerMap as $eventName => $handler) {
            $this->events->listen($eventName, [$this, $handler]);
        }
    }
1248274
protected function broadcastEvent($event)
    {
        $connection = ($event instanceof ShouldBroadcastNowInterface) ? 'sync' : null;

        $queue = method_exists($event, 'onQueue') ? $event->onQueue() : null;

        $this->resolveQueue()->connection($connection)->pushOn($queue, 'Nova\Broadcasting\BroadcastEvent', array(
            'event' => serialize(clone $event),
        ));
    }
651217
public function isVoiced($channel, $nickname = null)
    {
        if (!$this->_channelsyncing) {
            $this->log(SMARTIRC_DEBUG_NOTICE, 'WARNING: isVoiced() is called '
                .'and the required Channel Syncing is not activated!',
                __FILE__, __LINE__
            );
            return false;
        }

        if ($nickname === null) {
            $nickname = $this->_nick;
        }

        return ($this->isJoined($channel, $nickname)
            && $this->getUser($channel, $nickname)->voice
        );
    }
1194422
public function processKick(UserEvent $event, Queue $queue)
    {
        $logger = $this->getLogger();

        $server = strtolower($event->getConnection()->getServerHostname());
        $params = $event->getParams();
        $channel = $params['channel'];
        $nick = $params['user'];
        $message = isset($params['comment']) ? $params['comment'] : null;

        if ($nick == $event->getConnection()->getNickname()) {
            $logger->debug('Removing channel', array('server' => $server, 'channel' => $channel));
            unset($this->channels[$server][$channel]);
            return;
        }

        $logger->debug('Processing incoming KICK', array(
            'server' => $server,
            'channel' => $channel,
            'nick' => $nick,
            'message' => $message,
        ));

        unset($this->channels[$server][$channel][$nick]);

        try {
            $this->db->fetchAssoc(self::SQL_UPDATE, array(
                ':time' => time(),
                ':server' => $server,
                ':channel' => $channel,
                ':nick' => $nick,
                ':type' => self::TYPE_KICK,
                ':text' => $message,
            ));
        } catch (\Exception $e) {
            $logger->error($e->getMessage());
        }
    }
1017688
public function onLoadQueueListenerQuery(LoadQueueEvent $event, $eventName, EventDispatcherInterface $dispatcher)
    {
        $kind           = $event->getKind();
        $table          = $event->getQueueTable();
        $count          = $event->getCount();
        $query          = "SELECT * FROM $table WHERE ";
        $query         .= " kind = '$kind'";
        $query         .= " AND endworking = 0";
        $query         .= " AND startworking = 0";
        $query         .= " AND (intervaltorun != 0 OR intervaltorun = '')";
        $query         .= " ORDER BY priority, id";
        $query         .= " LIMIT 0,$count";
        $event->setQuery($query);
    }
945613
public function handleEvent(Event $event, Queue $queue)
    {
        $iterator = $this->getIterator($event->getConnection());

        if (!$iterator->valid()) {
            $queue->ircQuit('All specified alternate nicks are in use');
            return;
        }

        if ($this->recovery && $this->primaryNick === null) {
            $params = $event->getParams();
            $primaryNick = $params[1];
            $this->logger->debug("[AltNick] Saving '$primaryNick' as primary nick");
            $this->primaryNick = $primaryNick;
        }

        $nick = $iterator->current();
        $iterator->next();

        $this->logger->debug("[AltNick] Switching nick to '$nick'");
        $queue->ircNick($nick);
    }
1268146
public function helpCommand(CommandEventInterface $event, EventQueueInterface $queue)
    {
        $command = strpos($event->getCustomCommand(), '.help') !== false
            ? substr($event->getCustomCommand(), 0, -5)
            : $event->getCustomParams()[0];
        $this->helpMessages([ $queue, 'irc'.$event->getCommand() ], $event->getSource(), $command);
    }
373194
protected function sendIrcResponseLine(Event $event, Queue $queue, $ircResponseLine)
    {
        $queue->ircPrivmsg($event->getSource(), $ircResponseLine);
    }