private void ReceiveMessageHandler()
        {
            while (true)
            {
                try
                {
                    var result = _messManager.FetchLongNotification(_seq + 1);
                    //logger.Info("Send long Notification request");
                    //if (_debug) logger.Info("Request seq: " + (_seq + 1));

                    JObject o = JObject.Parse(result.Trim());
                    JArray a = JArray.Parse(o["responses"].ToString());
                    for (int i = 0; i < a.Count; i++)
                    {
                        try // message
                        {
                            o = JObject.Parse(a[i].ToString());
                            var message = JObject.Parse(o["message"].ToString());
                            var mNewSeq = int.Parse(message["sequence"].ToString());

                            if (mNewSeq > _seq) _seq = mNewSeq;
                            Message messObj = new Message(message["sender"].ToString(), message["receiver"].ToString(),
                                                          message["msg"].ToString(), mNewSeq);
                            //logger.Info("============================================");
                            //logger.Info("Received an message from " + messObj.Sender + ": " + messObj.Msg);
                            //logger.Info("============================================");
                            ProcessRequest(messObj);
                        }
                        catch (Exception e) { }

                        try
                        {
                            //requestBuddy
                            var requestBuddy = JObject.Parse(o["buddyAuthorize"].ToString());
                            var rbNewSeq = int.Parse(requestBuddy["sequence"].ToString());
                            if (rbNewSeq > _seq) _seq = rbNewSeq;
                            BuddyRequest buddyReq =
                                new BuddyRequest(_fetchData, _signManager, rbNewSeq, requestBuddy["sender"].ToString(),
                                                 requestBuddy["receiver"].ToString());
                            buddyReq.ResponseContact(true, "");
                            //logger.Info("============================================");
                            //logger.Info("Received add friend request from " + buddyReq.Sender);
                            //logger.Info("============================================");
                        }
                        catch (Exception e) { }
                    }

                }
                catch (Exception e)
                {
                    if (_debug)
                    {
                        //logger.Info(e.Message);
                    }
                    if (e.Message.Contains("(403)"))
                    {
                        if (_debug)
                        {
                            //logger.Info("============================================");
                            //logger.Info("Re-LogOn");
                            //logger.Info("============================================");
                        }
                        LogOn();
                        return;
                    }
                }
                Thread.Sleep(5000);
            }
        }
        private void ProcessRequest(Message message)
        {
            var tmp = GetCommand(message.Msg);
            var command = tmp[0];
            var content = tmp[1];

            try
            {
                if (_menu.Cmd.ContainsKey(command))
                {
                    foreach (var s in _menu.ContentMenu)
                    {
                        if(s.Trim() == "") continue;
                        _messManager.SendMessage(message.Sender, message.MakeJsonMessage(s));
                    }
                    return;
                }

                if(_pluginContainer.ContainsKey(command))
                {
                    var plugin = _pluginContainer[command];
                    var result = plugin.Process(content);

                    foreach (string s in result)
                    {
                        if(s.Trim() == "") continue;
                        _messManager.SendMessage(message.Sender, message.MakeJsonMessage(s));
                    }
                    return;
                }

                if(_menu.NotExsisStr != "")
                    _messManager.SendMessage(message.Sender, message.MakeJsonMessage(_menu.NotExsisStr));

            }catch(Exception e){}
        }