function __construct($Number, $imei, $Nickname, $debug = false)
 {
     $this->_debug = $debug;
     $dict = getDictionary();
     $this->_writer = new BinTreeNodeWriter($dict);
     $this->_reader = new BinTreeNodeReader($dict);
     $this->_phoneNumber = $Number;
     $this->_imei = $imei;
     $this->_name = $Nickname;
     $this->_loginStatus = $this->_disconnectedStatus;
 }
Exemple #2
0
 /**
  * Default class constructor.
  *
  * @param string $number
  *   The user phone number including the country code without '+' or '00'.
  * @param string $identity
  *  The Device Identity token. Obtained during registration with this API
  *  or using Missvenom to sniff from your phone.
  * @param string $nickname
  *   The user name.
  * @param $debug
  *   Debug on or off, false by default.
  */
 public function __construct($number, $identity, $nickname, $debug = false)
 {
     $dict = getDictionary();
     $this->writer = new BinTreeNodeWriter($dict);
     $this->reader = new BinTreeNodeReader($dict);
     $this->debug = $debug;
     $this->phoneNumber = $number;
     if (!$this->checkIdentity($identity)) {
         //compute sha identity hash
         $this->identity = $this->buildIdentity($identity);
     } else {
         //use provided identity hash
         $this->identity = $identity;
     }
     $this->name = $nickname;
     $this->loginStatus = static::DISCONNECTED_STATUS;
 }
Exemple #3
0
function getToken($token)
{
    $dic = getDictionary();
    return $dic[$token];
}