public WhatsApp(string phoneNum, string imei, string nick, bool debug = false)
{
this.messageQueue = new List<ProtocolTreeNode>();
this.sysEncoding = Encoding.GetEncoding("ISO-8859-1");
this.challengeArray = new Dictionary<string, string>();
this.phoneNumber = phoneNum;
this.imei = imei;
this.name = nick;
this.debug = debug;
string[] dict = DecodeHelper.getDictionary();
this.writer = new BinTreeNodeWriter(dict);
this.reader = new BinTreeNodeReader(dict);
this.loginStatus = disconnectedStatus;
this.whatsNetwork = new WhatsNetwork(WhatsConstants.WhatsAppHost, WhatsConstants.WhatsPort, this.sysEncoding, this.timeout);
this.WhatsParser = new WhatsParser(this.whatsNetwork);
this.WhatsSendHandler = this.WhatsParser.WhatsSendHandler;
}