src/Plugin.php
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);
    }
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);
    }
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 ) ; }
Nick is in use, pick another.

@param \Phergie\Irc\Event\EventInterface $event
@param \Phergie\Irc\Bot\React\EventQueueInterface $queue
Nick is in use pick another .