public function startTracking($nick, $cls = '\\Erebot\\Module\\IrcTracker\\Token')
    {
        $identityCls = $this->getFactory('!Identity');
        $fmt = $this->getFormatter(null);
        if ($nick instanceof \Erebot\Interfaces\Identity) {
            $identity = $nick;
        } else {
            if (!is_string($nick)) {
                throw new \Erebot\InvalidValueException(
                    $fmt->_('Not a valid nick')
                );
            }
            $identity = new $identityCls($nick);
        }

        $collator   = $this->connection->getCollator();
        $nick       = $collator->normalizeNick($identity->getNick());
        $key        = array_search($nick, $this->nicks);

        if ($key === false) {
            throw new \Erebot\NotFoundException($fmt->_('No such user'));
        }
        return new $cls($this, $key);
    }
public function startTracking($nick, $cls = '\\Erebot\\Module\\IrcTracker\\Token')
    {
        $identityCls = $this->getFactory('!Identity');
        $fmt = $this->getFormatter(null);
        if ($nick instanceof \Erebot\Interfaces\Identity) {
            $identity = $nick;
        } else {
            if (!is_string($nick)) {
                throw new \Erebot\InvalidValueException(
                    $fmt->_('Not a valid nick')
                );
            }
            $identity = new $identityCls($nick);
        }

        $collator   = $this->connection->getCollator();
        $nick       = $collator->normalizeNick($identity->getNick());
        $key        = array_search($nick, $this->nicks);

        if ($key === false) {
            throw new \Erebot\NotFoundException($fmt->_('No such user'));
        }
        return new $cls($this, $key);
    }
public function startTracking ( $ nick , $ cls = '\\Erebot\\Module\\IrcTracker\\Token' ) { $ identityCls = $ this -> getFactory ( '!Identity' ) ; $ fmt = $ this -> getFormatter ( null ) ; if ( $ nick instanceof \ Erebot \ Interfaces \ Identity ) { $ identity = $ nick ; } else { if ( ! is_string ( $ nick ) ) { throw new \ Erebot \ InvalidValueException ( $ fmt -> _ ( 'Not a valid nick' ) ) ; } $ identity = new $ identityCls ( $ nick ) ; } $ collator = $ this -> connection -> getCollator ( ) ; $ nick = $ collator -> normalizeNick ( $ identity -> getNick ( ) ) ; $ key = array_search ( $ nick , $ this -> nicks ) ; if ( $ key === false ) { throw new \ Erebot \ NotFoundException ( $ fmt -> _ ( 'No such user' ) ) ; } return new $ cls ( $ this , $ key ) ; }
Returns a tracking token for some user.

\param string $nick
The nickname of some user we want to start tracking.

\param string $cls
(optional) Class to use to create the token.
Defaults to Erebot::Module::IrcTracker::Token.

\retval mixed
A token that can later be used to return information
on that user (such as his/her nickname, IRC identity,
hostname and whether that person is still online or
not).

\throw Erebot::NotFoundException
There is currently no user connected on an IRC channel
the bot is on matching the given nickname.

\throw Erebot::InvalidValueException
The given nick is invalid.
Returns a tracking token for some user .