/// <summary>
        /// Bản tin đăng bài từ Server trả về
        /// </summary>
        /// <param name="msg"></param>
        public void UpdateContent(QHMessage msg)
        {
            long errorCode  = 0;
            long contentId  = 0;
            long homePageId = 0;
            long CreateDate = 0;

            msg.TryGetAt((byte)MsgHomePageAddContentAck.Error, ref errorCode);
            if (errorCode == 0)
            {
                if (msg.TryGetAt((byte)MsgHomePageAddContentAck.ContentID, ref contentId))
                {
                }
                if (msg.TryGetAt((byte)MsgHomePageAddContentAck.HomePageID, ref homePageId))
                {
                }
                var contentInfo = new ContentInfo();
                contentInfo.Accounts = Helper.Instance().MyAccount;
                if (msg.TryGetAt((byte)MsgHomePageAddContentAck.CreateDate, ref CreateDate))
                {
                    contentInfo.Detail.Created = CreateDate;
                }
                contentInfo.Detail.Id      = contentId;
                contentInfo.Detail.Content = JsonConvert.SerializeObject(json);
                // Thêm vào cached content để lần sau lấy ra dùng
                if (!Helper.Instance().ListContent.ContainsKey(contentId))
                {
                    lock (Helper.Instance().ListContent)
                    {
                        Helper.Instance().ListContent.Add(contentId, contentInfo);
                    }
                }

                else
                {
                    Helper.Instance().ListContent[contentId] = contentInfo;
                }
                Device.BeginInvokeOnMainThread(() =>
                {
                    Services.Service.Instiance().NewsSiteVM.ListNews.Insert(0, Helper.Instance().ListContent[contentId]);
                });
            }
            else
            {
                Debug.WriteLine("Error code: " + msg.JSONString());
            }
        }
        /// <summary>
        /// Nhận bản tin trả lời thách đấu từ server trả về cho người nhận được
        /// </summary>
        /// <param name="msg"></param>
        public async void OnReciveCancelChallengeInd(QHMessage msg)
        {
            long   SenderID    = 0;  // QHNumber
            long   TargetType  = 0;  // QHNumber{ 0 : Player, 1:Club }
            long   TargetID    = 0;  // QHNumber ID of TargetType
            string Content     = ""; // QHString (Nội dung text hoặc json của Challenges)
            long   StartTime   = 0;  // QHNumber Thời gian thách đấu bắt đầu
            long   EndTime     = 0;  // QHNumber Thời gian thách đấu kết thúc
            long   ChallengeID = 0;  // QHNumber ID của lời mời thách đấu
            long   Accept      = 0;

            if (msg.TryGetAt((byte)MsgInviteChallengeCnfIndArg.SenderID, ref SenderID))
            {
            }
            if (msg.TryGetAt((byte)MsgInviteChallengeCnfIndArg.TargetType, ref TargetType))
            {
            }
            if (msg.TryGetAt((byte)MsgInviteChallengeCnfIndArg.TargetID, ref TargetID))
            {
            }
            if (msg.TryGetAt((byte)MsgInviteChallengeCnfIndArg.Content, ref Content))
            {
            }
            if (msg.TryGetAt((byte)MsgInviteChallengeCnfIndArg.StartTime, ref StartTime))
            {
            }
            if (msg.TryGetAt((byte)MsgInviteChallengeCnfIndArg.EndTime, ref EndTime))
            {
            }
            if (msg.TryGetAt((byte)MsgInviteChallengeCnfIndArg.ChallengeID, ref ChallengeID))
            {
            }
            if (msg.TryGetAt((byte)MsgInviteChallengeCnfIndArg.Accept, ref Accept))
            {
            }
            if (Accept == 0)
            {
                if (TargetType == 0)
                {
                    if (ChallengeAction.ListAccRecive.ContainsKey(TargetID))
                    {
                        ListChallAcc.Remove(ChallengeAction.ListAccRecive[TargetID]);
                        ChallengeAction.ListAccRecive.Remove(TargetID);
                        ChallengeAction.SeqIDsAccTarget.Remove(TargetID);
                        if (Helpers.Helper.Instance().ListAcclocal.ContainsKey(TargetID))
                        {
                            Helpers.Helper.Instance().ListAcclocal[TargetID].Challenge = "pingpong.png";
                        }
                    }
                }
                else
                {
                    if (ChallengeAction.ListClubRecive.ContainsKey(TargetID))
                    {
                        ListChallAcc.Remove(ChallengeAction.ListClubRecive[TargetID]);
                        ChallengeAction.ListClubRecive.Remove(TargetID);
                        ChallengeAction.SeqIDsClubTarget.Remove(TargetID);
                        if (Helpers.Helper.Instance().ListClub.ContainsKey(TargetID))
                        {
                            Helpers.Helper.Instance().ListClub[TargetID].Challenge = "pingpong.png";
                        }
                    }
                }
            }
            else
            {
                if (TargetType == 0)
                {
                    if (ChallengeAction.ListAccRecive.ContainsKey(TargetID))
                    {
                        ChallengeAction.ListAccRecive.Remove(TargetID);
                        ChallengeAction.SeqIDsAccTarget.Remove(TargetID);
                        if (Helpers.Helper.Instance().ListAcclocal.ContainsKey(TargetID))
                        {
                            Helpers.Helper.Instance().ListAcclocal[TargetID].Challenge = "pingpong.png";
                        }
                    }
                    // Yêu cầu Server trả về fullName để hiển thị thông báo
                    var accTarget = await Helpers.Helper.Instance().CheckExistAccount(TargetID);

                    Device.BeginInvokeOnMainThread(() =>
                    {
                        DependencyService.Get <ILocalNotificationService>().LocalNotification("AppBongBan", accTarget.fullname + " đã chấp nhận mời thách đấu của bạn", (int)Helpers.Notifi.Challenge, 0);
                    });
                }
                else
                {
                    if (ChallengeAction.ListClubRecive.ContainsKey(TargetID))
                    {
                        ChallengeAction.ListClubRecive.Remove(TargetID);
                        ChallengeAction.SeqIDsClubTarget.Remove(TargetID);
                        if (Helpers.Helper.Instance().ListClub.ContainsKey(TargetID))
                        {
                            Helpers.Helper.Instance().ListClub[TargetID].Challenge = "pingpong.png";
                        }
                    }
                    var club = await Helpers.Helper.Instance().CheckExistClub(TargetID);

                    Device.BeginInvokeOnMainThread(() =>
                    {
                        DependencyService.Get <ILocalNotificationService>().LocalNotification("AppBongBan", "Câu lạc bộ " + club.ClubName + " đã chấp nhận mời thách đấu của bạn", (int)Helpers.Notifi.Challenge, 0);
                    });
                }
            }
        }
        /// <summary>
        /// Xử lý bản tin login từ hệ thóng trả vế
        /// </summary>
        /// <param name="msg"></param>
        public void LoginAckProcess(QHMessage msg)
        {
            //try
            //{
            Chat.LoginErrorCode login_error = (Chat.LoginErrorCode)(msg.GetAt((byte)Chat.MsgLoginAckArg.ErrorCode) as QHNumber).value;
            switch (login_error)
            {
            case Chat.LoginErrorCode.SUCCESS:

                if (!Helper.Instance().CheckLogin())
                {
                    Helper.Instance().MyAccount = new Accounts();
                }
                long   sessionId = 0;
                string phone     = "";
                string fullname  = "";
                string email     = "";
                long   numberId  = 0;
                string avarta    = "";
                string address   = "";
                long   birthday  = 0;
                if (msg.TryGetAt((byte)Chat.MsgLoginAckArg.SessionID, ref sessionId))
                {
                    App.SessionID = sessionId;
                }
                if (msg.TryGetAt((byte)Chat.MsgLoginAckArg.PhoneNumber, ref phone))
                {
                    Helper.Instance().MyAccount.Phone = phone;
                }
                if (msg.TryGetAt((byte)Chat.MsgLoginAckArg.FullName, ref fullname))
                {
                    Helper.Instance().MyAccount.fullname = fullname;
                }
                if (msg.TryGetAt((byte)Chat.MsgLoginAckArg.Email, ref email))
                {
                    Helper.Instance().MyAccount.Email = email;
                }
                if (msg.TryGetAt((byte)Chat.MsgLoginAckArg.NumberID, ref numberId))
                {
                    Helper.Instance().MyAccount.Number_Id = (uint)numberId;
                }
                if (msg.TryGetAt((byte)Chat.MsgLoginAckArg.AvatarURI, ref avarta))
                {
                    Helper.Instance().MyAccount.Avatar_Uri = avarta;
                }
                if (msg.TryGetAt((byte)Chat.MsgLoginAckArg.Address, ref address))
                {
                    Helper.Instance().MyAccount.Address = address;
                }
                if (msg.TryGetAt((byte)Chat.MsgLoginAckArg.BirthDay, ref birthday))
                {
                    Helper.Instance().MyAccount.Birthday = birthday;
                }
                //Kiểm tra filename
                Helper.Instance().ConvertPingPongToChat();
                Helper.Instance().MyAccount.Last_Time_Sync_Contact = 0;
                //  Services.Service.Instiance().Namefile = Helper.Instance().MyAccount.Number_Id.ToString();
                AppChat.Helpers.Helper.Instiance().nameDataBase = Helper.Instance().AccountChat.NumberId.ToString();
                //   AppChat.Helpers.Helper.Instiance().database.InsertOrReAccount(account);
                AppChat.Helpers.Helper.Instiance().database.InsertOrReAccount(Helper.Instance().AccountChat);
                // Thay layout ảnh đại diện
                HomePage.avartaChange();
                if (AppChat.Helpers.Helper.Instiance().database != null)
                {
                    if (Helper.Instance().MyAccount.Avatar_Uri.Equals("") || Helper.Instance().MyAccount.Avatar_Uri == null)
                    {
                        Helper.Instance().MyAccount.Avatar_Uri = "account.png";
                    }
                    if (Page != null)
                    {
                        Device.BeginInvokeOnMainThread(async() =>
                        {
                            Xamarin.Forms.DependencyService.Get <AppChat.Dependency.ILocalCache>().SetData(CrossDeviceInfo.Current.Id, Helper.Instance().AccountChat);
                            //   MessagingCenter.Send<App>((App)Xamarin.Forms.Application.Current, "Login");
                            Helper.Instance().GetContactGroupChat = true;
                            MessagingCenter.Send <App>((App)Xamarin.Forms.Application.Current, "Login1");
                            await Page.Navigation.PopToRootAsync();
                        });
                    }
                }
                Debug.WriteLine("LoginJson: " + msg.JSONString());
                break;

            case Chat.LoginErrorCode.ERR_PHONE_NOT_EXIST:
            {
                // Login in fale thì xoa file
                Xamarin.Forms.DependencyService.Get <ILocalCache>().RemoveData <Accounts>(CrossDeviceInfo.Current.Id);
                if (Page != null)
                {
                    Device.BeginInvokeOnMainThread(() =>
                        {
                            Page.DisplayAlert("Thông báo", "Số điện thoại không tồn tại", "Ok");
                        });
                }
                break;
            }

            case Chat.LoginErrorCode.ERR_PASSWORD_MISMATCH:
            {
                Xamarin.Forms.DependencyService.Get <ILocalCache>().RemoveData <Accounts>(CrossDeviceInfo.Current.Id);
                if (Page != null)
                {
                    Device.BeginInvokeOnMainThread(() =>
                        {
                            Page.DisplayAlert("Thông báo", "Mật khẩu không đúng", "Ok");
                        });
                }
                break;
            }

            case Chat.LoginErrorCode.ERR_USERNAME_NOT_EXIST:
            {
                Xamarin.Forms.DependencyService.Get <ILocalCache>().RemoveData <Accounts>(CrossDeviceInfo.Current.Id);
                if (Page != null)
                {
                    Device.BeginInvokeOnMainThread(() =>
                        {
                            Page.DisplayAlert("Thông báo", "Tài khoản đăng nhập không đúng", "Ok");
                        });
                }
                break;
            }
            }
            //}
            //catch (Exception ex)
            //{
            //    if (Page != null)
            //    {
            //        Device.BeginInvokeOnMainThread(() =>
            //        {
            //            Page.DisplayAlert("Lỗi Login", ex.Message, "Ok");
            //        });
            //    }
            //}
        }
Beispiel #4
0
        public static void OnReciveAckChall(QHMessage msg)
        {
            long Error       = 0; // QHNumber
            long ChallengeID = 0; // QHNumber(ID của lời mời)
            long SeqID       = 0; // QHNumber(ID tự sinh do client gửi lên trong MsgInviteChallengeReqArg)
            long RemainTime  = 0; // QHNumber (Thời gian đếm ngược tính bằng giây khi có thể gửi lời mời thách đấu tiếp theo)

            if (msg.TryGetAt((byte)MsgInviteChallengeAckArg.Error, ref Error))
            {
            }
            if (msg.TryGetAt((byte)MsgInviteChallengeAckArg.ChallengeID, ref ChallengeID))
            {
            }
            if (msg.TryGetAt((byte)MsgInviteChallengeAckArg.SeqID, ref SeqID))
            {
            }
            if (msg.TryGetAt((byte)MsgInviteChallengeAckArg.RemainTime, ref RemainTime))
            {
            }
            var ChallengeError = (InviteChallengeError)Error;

            switch (ChallengeError)
            {
            case InviteChallengeError.SUCCESS:
                if (SeqIDs.ContainsKey(SeqID))
                {
                    var Chall = SeqIDs[SeqID];
                    //thực hiện thách đấu với cá nhân
                    if (Chall.TargetType == 0)
                    {
                        if (Helpers.Helper.Instance().ListAcclocal.ContainsKey(Chall.TargetID))
                        {
                            Helpers.Helper.Instance().ListAcclocal[Chall.TargetID].Challenge = "pingpong_invi.png";
                            NotifiDialog.Initiance().DialogChallengePer(Helpers.Helper.Instance().ListAcclocal[Chall.TargetID].fullname);
                            if (!SeqIDsAccTarget.ContainsKey(Chall.TargetID))
                            {
                                SeqIDsAccTarget.Add(Chall.TargetID, SeqID);
                                ListAccRecive.Add(Chall.TargetID, Chall);
                            }
                        }
                    }
                    //thực hiện thách đấu với club
                    else
                    {
                        if (Helpers.Helper.Instance().ListClub.ContainsKey(Chall.TargetID))
                        {
                            Helpers.Helper.Instance().ListClub[Chall.TargetID].Challenge = "pingpong_invi.png";
                            NotifiDialog.Initiance().DialogChallengeClub(Helpers.Helper.Instance().ListClub[Chall.TargetID].ClubName);
                            if (!SeqIDsClubTarget.ContainsKey(Chall.TargetID))
                            {
                                SeqIDsClubTarget.Add(Chall.TargetID, SeqID);
                                ListClubRecive.Add(Chall.TargetID, Chall);
                            }
                        }
                    }
                    AppChat.Helpers.Helper.Instiance().UpdateProfileFinish?.Invoke();
                }
                break;

            case InviteChallengeError.ERR_TOO_FREQUENTLY:
                break;
            }
        }
Beispiel #5
0
        /// <summary>
        /// Bản tin Indicator khi người dùng nhận được
        /// </summary>
        /// <param name="msg"></param>
        public void ClubJoinAck(QHMessage msg)
        {
            int  sampleId = 0;
            long Accept   = -1;
            long NumberID = 0;
            long ClubId   = 0;

            if (msg.TryGetAt((byte)MsgClubJoinAcceptIndArg.Accept, ref Accept))
            {
                if (msg.TryGetAt((byte)MsgClubJoinAcceptIndArg.ClubID, ref ClubId))
                {
                }
                if (Accept == 1)
                {
                    if (msg.TryGetAt((byte)MsgClubJoinAcceptIndArg.NumberID, ref NumberID))
                    {
                        Services.Service.Instiance().ClubModel.MyClub.Numbers.Add(NumberID);
                        Services.Service.Instiance().ClubModel.MyClub.Requests.Remove(NumberID);
                        Services.Service.Instiance().ClubModel.MyClub.ReloadReative();
                    }
                    string Title    = "AppBongBan";
                    string nameclub = "";
                    string notifi   = "";
                    if (msg.TryGetAt((byte)MsgClubJoinAcceptIndArg.ClubName, ref nameclub))
                    {
                        notifi = nameclub;
                    }
                    if (msg.TryGetAt((byte)MsgClubJoinAcceptIndArg.FullName, ref nameclub))
                    {
                        notifi += " đã chấp nhận tham gia của " + nameclub;
                    }
                    // Thay đổi Icon trong ListClub
                    foreach (var club in Helper.Instance().ListClub)
                    {
                        if (club.Value.ClubID == ClubId)
                        {
                            club.Value.Relation = 0;
                        }
                    }
                    Device.BeginInvokeOnMainThread(() =>
                    {
                        DependencyService.Get <ILocalNotificationService>().LocalNotification(Title, notifi, sampleId, 0);
                    });
                }
                else if (Accept == 0)
                {
                    if (msg.TryGetAt((byte)MsgClubJoinAcceptIndArg.NumberID, ref NumberID))
                    {
                        Services.Service.Instiance().ClubModel.MyClub.Requests.Remove(NumberID);
                        Services.Service.Instiance().ClubModel.MyClub.ReloadReative();
                    }
                    // Thay đổi Icon trong ListClub
                    foreach (var club in Helper.Instance().ListClub)
                    {
                        if (club.Value.ClubID == ClubId)
                        {
                            club.Value.Relation = -1;
                        }
                    }
                }
            }
        }
        /// <summary>
        /// nhận indicator thách đấu từ server trả về
        /// </summary>
        /// <param name="msg"></param>
        public async void OnReciveChallengeInd(QHMessage msg)
        {
            long   SenderID    = 0;  // QHNumber
            long   TargetType  = 0;  // QHNumber{ 0 : Player, 1:Club }
            long   TargetID    = 0;  // QHNumber ID of TargetType
            string Content     = ""; // QHString (Nội dung text hoặc json của Challenges)
            long   StartTime   = 0;  // QHNumber Thời gian thách đấu bắt đầu
            long   EndTime     = 0;  // QHNumber Thời gian thách đấu kết thúc
            long   ChallengeID = 0;  // QHNumber ID của lời mời thách đấu

            if (msg.TryGetAt((byte)MsgInviteChallengeIndArg.SenderID, ref SenderID))
            {
            }
            if (msg.TryGetAt((byte)MsgInviteChallengeIndArg.TargetType, ref TargetType))
            {
            }
            if (msg.TryGetAt((byte)MsgInviteChallengeIndArg.TargetID, ref TargetID))
            {
            }
            if (msg.TryGetAt((byte)MsgInviteChallengeIndArg.Content, ref Content))
            {
            }
            if (msg.TryGetAt((byte)MsgInviteChallengeIndArg.StartTime, ref StartTime))
            {
            }
            if (msg.TryGetAt((byte)MsgInviteChallengeIndArg.EndTime, ref EndTime))
            {
            }
            if (msg.TryGetAt((byte)MsgInviteChallengeIndArg.ChallengeID, ref ChallengeID))
            {
            }
            var Chall = new ChallengeInfo();

            Chall.SenderID    = SenderID;
            Chall.TargetType  = TargetType;
            Chall.TargetID    = TargetID;
            Chall.Content     = Content;
            Chall.StartTime   = StartTime;
            Chall.EndTime     = EndTime;
            Chall.ChallengeID = ChallengeID;
            Accountlocal AccLocal = new Accountlocal();

            if (Helper.Instance().ListAcclocal.ContainsKey(SenderID))
            {
                AccLocal = Helpers.Helper.Instance().ListAcclocal[SenderID];
            }
            else
            {
                var accounOwner = await Helper.Instance().CheckExistAccount(SenderID);

                if (accounOwner != null)
                {
                    var acccount = new Accountlocal();
                    acccount.Challenge        = "pingpong.png";
                    acccount.Blade            = "Cốt A - Hãng A";
                    acccount.Facebat          = "Mặt A - Hãng A";
                    acccount.Level            = "Hạng A";
                    acccount.AccepLevel       = "Đã Duyệt";
                    acccount.AddFriend        = Helper.Instance().IsFriendImg(accounOwner.Number_Id);
                    acccount.TextStatusFriend = Helper.Instance().IsFriend(accounOwner.Number_Id);
                    acccount.TextAcceptFriend = Helper.Instance().TextAcceptFriend;
                    acccount.Number_Id        = accounOwner.Number_Id;
                    acccount.fullname         = accounOwner.fullname;
                    acccount.Avatar_Uri       = accounOwner.Avatar_Uri;
                    Helper.Instance().ListAcclocal.Add(SenderID, acccount);
                    AccLocal = acccount;
                }
            }
            // Thách đấu cá nhân
            if (TargetType == 0)
            {
                Device.BeginInvokeOnMainThread(() =>
                {
                    DependencyService.Get <ILocalNotificationService>().LocalNotification("AppBongBan", AccLocal.fullname + " đã gửi lời mời thách đấu đến bạn", (int)Helpers.Notifi.Challenge, 0);
                });
                Chall.Acc = AccLocal;
                if (!ChallengeAction.ListSendAcc.ContainsKey(SenderID))
                {
                    ChallengeAction.ListSendAcc.Add(SenderID, Chall);
                }
                Device.BeginInvokeOnMainThread(() =>
                {
                    ListChallengesPer.Add(Chall);
                    count += ListChallengesPer.Count;
                    notify = count.ToString();
                    //  Helper.Instance().challengeNotify?.Invoke();
                });
            }
            // Thách đấu Club
            else
            {
                var club = await Helper.Instance().CheckExistClub(TargetID);

                Chall.Clubs = club;
                Chall.Acc   = AccLocal;
                Device.BeginInvokeOnMainThread(() =>
                {
                    DependencyService.Get <ILocalNotificationService>().LocalNotification("AppBongBan", AccLocal.fullname + " đã gửi lời mời thách đấu đến " + club.ClubName, (int)Helpers.Notifi.Challenge, 0);
                });
                if (!ChallengeAction.ListSendClub.ContainsKey(SenderID))
                {
                    ChallengeAction.ListSendClub.Add(SenderID, Chall);
                }
                Device.BeginInvokeOnMainThread(() =>
                {
                    ListChallengesClub.Add(Chall);
                    count += ListChallengesClub.Count;
                    notify = count.ToString();
                });
            }

            // Thông báo để thêm vào chuông cho người dùng biết
            Helper.Instance().CountChallengeNotifi++;
            //Helper.Instance().challengeNotify?.Invoke();
            AppChat.Helpers.Helper.Instiance().NotifiAction?.Invoke();
        }
        /// <summary>
        /// Nhận danh sách các thách đấu từ server trả về liên quan đến người dùng và quản lý Club
        /// </summary>
        /// <param name="msg"></param>
        public async void OnReciveListChallenge(QHMessage msg)
        {
            long    Error            = 0;             // QHNumber
            QHTable ClubChallenges   = new QHTable(); // QHTable{ChallengeID(0):QHNumber, SenderID(1):QHNumber, TargetID(2):QHNumber, Content(3):QHString, CreateTime(4):QHNumber,StartTime(5):QHNumber,EndTime(6):QHNumber}
            QHTable PlayerChallenges = new QHTable(); // QHTable{ChallengeID(0):QHNumber, SenderID(1):QHNumber, TargetID(2):QHNumber, Content(3):QHString, CreateTime(4):QHNumber,StartTime(5):QHNumber,EndTime(6):QHNumber}

            if (msg.TryGetAt((byte)MsgListChallengeAckArg.Error, ref Error))
            {
            }
            if (msg.TryGetAt((byte)MsgListChallengeAckArg.ClubChallenges, ref ClubChallenges))
            {
            }
            if (msg.TryGetAt((byte)MsgListChallengeAckArg.PlayerChallenges, ref PlayerChallenges))
            {
            }
            var acc = Helper.Instance().MyAccount;

            //Debug.WriteLine("row: "+ ClubChallenges.GetRowCount());
            //Debug.WriteLine("row: " + PlayerChallenges.GetRowCount());
            if (Error == 0)
            {
                var rowCount   = ClubChallenges.GetRowCount();
                var columCount = ClubChallenges.GetColumnCount();
                //danh sách các thách đấu mà admin nhận được hoặc từ các
                for (int i = 0; i < rowCount; i++)
                {
                    long   ChallengeID = 0;
                    long   SenderID    = 0;
                    long   TargetID    = 0;
                    string Content     = "";
                    long   CreateTime  = 0;
                    long   StartTime   = 0;
                    long   EndTime     = 0;

                    if (ClubChallenges.TryGetAt(i, 0, ref ChallengeID))
                    {
                    }
                    if (ClubChallenges.TryGetAt(i, 1, ref SenderID))
                    {
                    }
                    if (ClubChallenges.TryGetAt(i, 2, ref TargetID))
                    {
                    }
                    if (ClubChallenges.TryGetAt(i, 3, ref Content))
                    {
                    }
                    if (ClubChallenges.TryGetAt(i, 4, ref CreateTime))
                    {
                    }
                    if (ClubChallenges.TryGetAt(i, 5, ref StartTime))
                    {
                    }
                    if (ClubChallenges.TryGetAt(i, 6, ref EndTime))
                    {
                    }

                    var Chall = new ChallengeInfo();
                    Chall.ChallengeID = ChallengeID;
                    Chall.SenderID    = SenderID;
                    Chall.TargetID    = TargetID;
                    Chall.Content     = Content;
                    Chall.CreateTime  = CreateTime;
                    Chall.StartTime   = StartTime;
                    Chall.EndTime     = EndTime;
                    if (!Helper.Instance().ListClub.TryGetValue(TargetID, out Club clubContent))
                    {
                        clubContent = new Club()
                        {
                            ClubID = TargetID
                        };
                        Helper.Instance().ListClub.Add(TargetID, clubContent);
                    }

                    var club = Helper.Instance().ListClub[TargetID];
                    //  Lấy thông tin club
                    Helper.Instance().CheckExistClubAsync(TargetID);
                    Chall.Clubs = club;
                    if (acc.Number_Id == SenderID)
                    {
                        if (!ChallengeAction.ListClubRecive.ContainsKey(TargetID))
                        {
                            ChallengeAction.ListClubRecive.Add(TargetID, Chall);
                        }
                    }
                    else
                    {
                        if (!ChallengeAction.ListSendClub.ContainsKey(SenderID))
                        {
                            ChallengeAction.ListSendClub.Add(SenderID, Chall);
                            if (Helpers.Helper.Instance().ListAcclocal.ContainsKey(SenderID))
                            {
                                var AccLocal = Helpers.Helper.Instance().ListAcclocal[SenderID];
                                Chall.Acc = AccLocal;
                                Device.BeginInvokeOnMainThread(() =>
                                {
                                    ListChallengesClub.Add(Chall);
                                    // Cập nhật lại số lượng thông báo cho chuông
                                    Helper.Instance().CountChallengeNotifi++;
                                    count += ListChallengesClub.Count;
                                    notify = count.ToString();
                                    // Thông báo để thêm vào chuông cho người dùng biết
                                    // Helper.Instance().challengeNotify?.Invoke();
                                    AppChat.Helpers.Helper.Instiance().NotifiAction?.Invoke();
                                });
                            }
                            else
                            {
                                var accounOwner = await Helpers.Helper.Instance().CheckExistAccount(SenderID);

                                if (accounOwner != null)
                                {
                                    var acccount = new Accountlocal();
                                    acccount.Challenge        = "pingpong.png";
                                    acccount.Blade            = "Cốt A - Hãng A";
                                    acccount.Facebat          = "Mặt A - Hãng A";
                                    acccount.Level            = "Hạng A";
                                    acccount.AccepLevel       = "Đã Duyệt";
                                    acccount.AddFriend        = Helper.Instance().IsFriendImg(accounOwner.Number_Id);
                                    acccount.TextStatusFriend = Helper.Instance().IsFriend(accounOwner.Number_Id);
                                    acccount.TextAcceptFriend = Helper.Instance().TextAcceptFriend;
                                    acccount.Number_Id        = accounOwner.Number_Id;
                                    acccount.fullname         = accounOwner.fullname;
                                    acccount.Avatar_Uri       = accounOwner.Avatar_Uri;
                                    Chall.Acc = acccount;
                                    Helpers.Helper.Instance().ListAcclocal.Add(acccount.Number_Id, acccount);
                                    Device.BeginInvokeOnMainThread(() =>
                                    {
                                        ListChallengesClub.Add(Chall);
                                        // Cập nhật lại số lượng thông báo cho chuông
                                        Helper.Instance().CountChallengeNotifi++;
                                        count += ListChallengesClub.Count;
                                        notify = count.ToString();
                                        // Thông báo để thêm vào chuông cho người dùng biết
                                        // Helper.Instance().challengeNotify?.Invoke();
                                        AppChat.Helpers.Helper.Instiance().NotifiAction?.Invoke();
                                    });
                                }
                            }
                        }
                    }
                }
                //danh sách các thách đấu mà người dùng gửi lên hoặc người dùng nhận được
                for (int i = 0; i < PlayerChallenges.GetRowCount(); i++)
                {
                    //Debug.WriteLine("Colum: " + PlayerChallenges.GetColumnCount());
                    long   ChallengeID = 0;
                    long   SenderID    = 0;
                    long   TargetID    = 0;
                    string Content     = "";
                    long   CreateTime  = 0;
                    long   StartTime   = 0;
                    long   EndTime     = 0;

                    if (PlayerChallenges.TryGetAt(i, 0, ref ChallengeID))
                    {
                    }
                    if (PlayerChallenges.TryGetAt(i, 1, ref SenderID))
                    {
                    }
                    if (PlayerChallenges.TryGetAt(i, 2, ref TargetID))
                    {
                    }
                    if (PlayerChallenges.TryGetAt(i, 3, ref Content))
                    {
                    }
                    if (PlayerChallenges.TryGetAt(i, 4, ref CreateTime))
                    {
                    }
                    if (PlayerChallenges.TryGetAt(i, 5, ref StartTime))
                    {
                    }
                    if (PlayerChallenges.TryGetAt(i, 6, ref EndTime))
                    {
                    }

                    var Chall = new ChallengeInfo();
                    Chall.ChallengeID = ChallengeID;
                    Chall.SenderID    = SenderID;
                    Chall.TargetID    = TargetID;
                    Chall.Content     = Content;
                    Chall.CreateTime  = CreateTime;
                    Chall.StartTime   = StartTime;
                    Chall.EndTime     = EndTime;

                    //var club = await Helpers.Helper.Instance().CheckExistClub(TargetID);
                    //Chall.Clubs = club;
                    if (acc == null)
                    {
                        return;
                    }
                    if (acc.Number_Id == SenderID)
                    {
                        Debug.WriteLine("Tra ve true");
                        Debug.WriteLine("Number_Id: " + acc.Number_Id);
                        Debug.WriteLine("SenderID: " + SenderID);
                        if (!ChallengeAction.ListAccRecive.ContainsKey(TargetID))
                        {
                            ChallengeAction.ListAccRecive.Add(TargetID, Chall);
                        }
                    }
                    else
                    {
                        Debug.WriteLine("Tra ve false");
                        if (!ChallengeAction.ListSendAcc.ContainsKey(SenderID))
                        {
                            ChallengeAction.ListSendAcc.Add(SenderID, Chall);
                            if (Helper.Instance().ListAcclocal.ContainsKey(SenderID))
                            {
                                var AccLocal = Helper.Instance().ListAcclocal[SenderID];
                                Chall.Acc = AccLocal;
                                Device.BeginInvokeOnMainThread(() =>
                                {
                                    ListChallengesPer.Add(Chall);
                                    // Cập nhật lại số lượng thông báo cho chuông
                                    Helper.Instance().CountChallengeNotifi++;
                                    count += ListChallengesPer.Count;
                                    notify = count.ToString();
                                    // Thông báo để thêm vào chuông cho người dùng biết
                                    // Helper.Instance().challengeNotify?.Invoke();
                                    AppChat.Helpers.Helper.Instiance().NotifiAction?.Invoke();
                                });
                            }
                            else
                            {
                                var accounOwner = await Helper.Instance().CheckExistAccount(SenderID);

                                if (accounOwner != null)
                                {
                                    var acccount = new Accountlocal();
                                    acccount.Challenge        = "pingpong.png";
                                    acccount.Blade            = "Cốt A - Hãng A";
                                    acccount.Facebat          = "Mặt A - Hãng A";
                                    acccount.Level            = "Hạng A";
                                    acccount.AccepLevel       = "Đã Duyệt";
                                    acccount.AddFriend        = Helper.Instance().IsFriendImg(accounOwner.Number_Id);
                                    acccount.TextStatusFriend = Helper.Instance().IsFriend(accounOwner.Number_Id);
                                    acccount.TextAcceptFriend = Helper.Instance().TextAcceptFriend;
                                    acccount.Number_Id        = accounOwner.Number_Id;
                                    acccount.fullname         = accounOwner.fullname;
                                    Debug.WriteLine("Name: " + accounOwner.fullname);
                                    Debug.WriteLine("Avatar: " + accounOwner.Avatar_Uri);
                                    acccount.Avatar_Uri = accounOwner.Avatar_Uri;
                                    Chall.Acc           = acccount;

                                    Helper.Instance().ListAcclocal.Add(acccount.Number_Id, acccount);
                                    Device.BeginInvokeOnMainThread(() =>
                                    {
                                        ListChallengesPer.Add(Chall);
                                        count += ListChallengesPer.Count;
                                        notify = count.ToString();
                                        // Cập nhật lại số lượng thông báo cho chuông
                                        Helper.Instance().CountChallengeNotifi++;
                                        // Thông báo để thêm vào chuông cho người dùng biết
                                        //Helper.Instance().challengeNotify?.Invoke();
                                        AppChat.Helpers.Helper.Instiance().NotifiAction?.Invoke();
                                    });
                                }
                            }
                        }
                    }
                }
            }
        }
Beispiel #8
0
        /// <summary>
        /// UnLike Indicator trong content, comment, reply
        /// </summary>
        /// <param name="msg"></param>
        public static void UnLikeInd(QHMessage msg)
        {
            long NumberID  = 0;
            long ContentID = 0;
            long CommentID = 0;
            long ReplyID   = 0;

            if (msg.TryGetAt((byte)MsgUnlikeAckArg.ContentID, ref ContentID))
            {
                if (msg.TryGetAt((byte)MsgUnlikeAckArg.CommentID, ref CommentID))
                {
                    if (msg.TryGetAt((byte)MsgUnlikeAckArg.ReplyID, ref ReplyID))
                    {
                    }
                }
            }
            //Reply
            if (ReplyID > 0)
            {
                if (Helper.Instance().ListReplyComment.ContainsKey(ReplyID))
                {
                    var item = Helper.Instance().ListReplyComment[ReplyID];
                    if (msg.TryGetAt((byte)MsgUnlikeAckArg.NumberID, ref NumberID))
                    {
                        if (item.Likes.IndexOf(NumberID) > 0)
                        {
                            item.Likes.Remove(NumberID);
                            item.Owner = NumberID;
                            item.Reset();
                        }
                    }
                }
                return;
            }
            //Comment
            if (CommentID > 0)
            {
                if (Helper.Instance().ListComment.ContainsKey(CommentID))
                {
                    var item = Helper.Instance().ListComment[CommentID];
                    if (msg.TryGetAt((byte)MsgUnlikeAckArg.NumberID, ref NumberID))
                    {
                        if (item.likes.IndexOf(NumberID) > 0)
                        {
                            item.likes.Remove(NumberID);
                            item.Reset();
                        }
                    }
                }
                return;
            }
            //Content
            if (ContentID > 0)
            {
                if (Helper.Instance().ListContent.ContainsKey(ContentID))
                {
                    var item = Helper.Instance().ListContent[ContentID];

                    if (msg.TryGetAt((byte)MsgUnlikeAckArg.NumberID, ref NumberID))
                    {
                        //tìm kiếm và xóa danh sách item like trong danh sách like
                        if (item.LikeContent.LikeContent.ContainsKey("" + NumberID))
                        {
                            item.LikeContent.LikeContent.Remove("" + NumberID);
                            item.LikeContent.Reset();
                        }
                    }
                }
                return;
            }
        }
Beispiel #9
0
        /// <summary>
        /// Like indicator
        /// </summary>
        /// <param name="msg"></param>
        public async static void LikeInd(QHMessage msg)
        {
            long   NumberId  = 0;
            string FullName  = "";
            string avatar    = "";
            long   ContentID = 0;
            long   CommentID = 0;
            long   ReplyID   = 0;
            long   OwnerID   = 0;

            if (msg.TryGetAt((byte)MsgLikeIndArg.FullName, ref FullName))
            {
            }
            if (msg.TryGetAt((byte)MsgLikeIndArg.OwnerID, ref OwnerID))
            {
            }
            if (msg.TryGetAt((byte)MsgLikeIndArg.NumberID, ref NumberId))
            {
            }
            if (msg.TryGetAt((byte)MsgLikeIndArg.ContentID, ref ContentID))
            {
                if (msg.TryGetAt((byte)MsgLikeIndArg.CommentID, ref CommentID))
                {
                    if (msg.TryGetAt((byte)MsgLikeIndArg.ReplyID, ref ReplyID))
                    {
                    }
                }
            }
            if (msg.TryGetAt((byte)MsgLikeIndArg.CommentID, ref CommentID))
            {
            }
            if (msg.TryGetAt((byte)MsgLikeIndArg.ReplyID, ref ReplyID))
            {
            }
            //LikeReply
            if (ReplyID > 0)
            {
                if (Helper.Instance().ListReplyComment.ContainsKey(ReplyID))
                {
                    var item = Helper.Instance().ListReplyComment[ReplyID];
                    item.Owner = Helper.Instance().MyAccount.Number_Id;
                    if (item.Likes.IndexOf(NumberId) < 0)
                    {
                        item.Likes.Add(NumberId);
                        item.Reset();
                    }
                    if (Helper.IdNews == CommentID && Helper.IndexPage == Helpers.IsDetailNews.Reply)
                    {
                    }
                    else
                    {
                        if (OwnerID == Helper.Instance().MyAccount.Number_Id)
                        {
                            Device.BeginInvokeOnMainThread(() =>
                            {
                                DependencyService.Get <ILocalNotificationService>().LocalNotification("AppBongBan", FullName + " đã thích trả lời bình luận của bạn", (int)Helpers.Notifi.LikeReply, 0);
                            });
                        }
                        else
                        {
                            var acc = await Helper.Instance().CheckExistAccount(OwnerID);

                            if (acc.Number_Id > 0)
                            {
                                Device.BeginInvokeOnMainThread(() =>
                                {
                                    DependencyService.Get <ILocalNotificationService>().LocalNotification("AppBongBan", FullName + " đã thích trả lời bình luận của " + acc.fullname, (int)Helpers.Notifi.LikeReply, 0);
                                });
                            }
                        }
                    }
                }
                else
                {
                    if (OwnerID == Helper.Instance().MyAccount.Number_Id)
                    {
                        Device.BeginInvokeOnMainThread(() =>
                        {
                            DependencyService.Get <ILocalNotificationService>().LocalNotification("AppBongBan", FullName + " đã thích trả lời bình luận của bạn", (int)Helpers.Notifi.LikeReply, 0);
                        });
                    }
                    else
                    {
                        var acc = await Helper.Instance().CheckExistAccount(OwnerID);

                        if (acc.Number_Id > 0)
                        {
                            Device.BeginInvokeOnMainThread(() =>
                            {
                                DependencyService.Get <ILocalNotificationService>().LocalNotification("AppBongBan", FullName + " đã thích trả lời bình luận của " + acc.fullname, (int)Helpers.Notifi.LikeReply, 0);
                            });
                        }
                    }
                }

                return;
            }
            //LikeComment
            if (CommentID > 0)
            {
                if (Helper.Instance().ListComment.ContainsKey(CommentID))
                {
                    var item = Helper.Instance().ListComment[CommentID];
                    if (item.likes.IndexOf(NumberId) < 0)
                    {
                        item.likes.Add(NumberId);
                        item.Reset();
                    }
                    if (Helper.IdNews == ContentID && Helper.IndexPage == Helpers.IsDetailNews.Comment)
                    {
                    }
                    //nếú chưa có trong danh sách comment
                    else
                    {
                        if (OwnerID == Helper.Instance().MyAccount.Number_Id)
                        {
                            Device.BeginInvokeOnMainThread(() =>
                            {
                                DependencyService.Get <ILocalNotificationService>().LocalNotification("AppBongBan", FullName + " đã thích bình luận của bạn", (int)Helpers.Notifi.LikeComment, 0);
                            });
                        }
                        else
                        {
                            var accounOwner = await Helper.Instance().CheckExistAccount(OwnerID);

                            if (accounOwner != null && accounOwner.Number_Id > 0)
                            {
                                Device.BeginInvokeOnMainThread(() =>
                                {
                                    DependencyService.Get <ILocalNotificationService>().LocalNotification("AppBongBan", FullName + " đã thích bài viết của" + accounOwner.fullname, (int)Helpers.Notifi.LikeComment, 0);
                                });
                            }
                        }
                    }
                }
                else
                {
                    if (OwnerID == Helper.Instance().MyAccount.Number_Id)
                    {
                        Device.BeginInvokeOnMainThread(() =>
                        {
                            DependencyService.Get <ILocalNotificationService>().LocalNotification("AppBongBan", FullName + " đã thích bình luận của bạn", (int)Helpers.Notifi.LikeComment, 0);
                        });
                    }
                    else
                    {
                        var accounOwner = await Helper.Instance().CheckExistAccount(OwnerID);

                        if (accounOwner != null && accounOwner.Number_Id > 0)
                        {
                            Device.BeginInvokeOnMainThread(() =>
                            {
                                DependencyService.Get <ILocalNotificationService>().LocalNotification("AppBongBan", FullName + " đã thích bài viết của" + accounOwner.fullname, (int)Helpers.Notifi.LikeComment, 0);
                            });
                        }
                    }
                }
                return;
            }
            //LikeContent
            if (ContentID > 0)
            {
                if (Helper.Instance().ListContent.ContainsKey(ContentID))
                {
                    var item = Helper.Instance().ListContent[ContentID];
                    var Like = new LikeContent {
                        Content_Id = ContentID, Owner = NumberId
                    };
                    if (!item.LikeContent.LikeContent.ContainsKey("" + NumberId))
                    {
                        item.LikeContent.LikeContent.Add("" + NumberId, Like);
                        item.LikeContent.Reset();
                    }

                    if (Helper.IdNews == ContentID && Helper.IndexPage == Helpers.IsDetailNews.Content)
                    {
                    }
                    //Nếu người dùng chưa vào giao diện chi tiết content
                    else
                    {
                        var id = Helper.Instance().MyAccount.Number_Id;
                        if (id == OwnerID)
                        {
                            Device.BeginInvokeOnMainThread(() =>
                            {
                                DependencyService.Get <ILocalNotificationService>().LocalNotification("AppBongBan", FullName + " đã thích bài viết của bạn", (int)Notifi.LikeContent, 0);
                            });
                        }

                        else
                        {
                            var accounOwner = await Helper.Instance().CheckExistAccount(OwnerID);

                            if (accounOwner != null && accounOwner.Number_Id > 0)
                            {
                                Device.BeginInvokeOnMainThread(() =>
                                {
                                    DependencyService.Get <ILocalNotificationService>().LocalNotification("AppBongBan", FullName + " đã thích bài viết của " + accounOwner.fullname, (int)Notifi.LikeContent, 0);
                                });
                            }
                        }
                    }
                }
                else
                {
                    var id = Helper.Instance().MyAccount.Number_Id;
                    if (id == OwnerID)
                    {
                        Device.BeginInvokeOnMainThread(() =>
                        {
                            DependencyService.Get <ILocalNotificationService>().LocalNotification("AppBongBan", FullName + " đã thích bài viết của bạn", (int)Notifi.LikeContent, 0);
                        });
                    }

                    else
                    {
                        var accounOwner = await Helper.Instance().CheckExistAccount(OwnerID);

                        if (accounOwner != null && accounOwner.Number_Id > 0)
                        {
                            Device.BeginInvokeOnMainThread(() =>
                            {
                                DependencyService.Get <ILocalNotificationService>().LocalNotification("AppBongBan", FullName + " đã thích bài viết của " + accounOwner.fullname, (int)Notifi.LikeContent, 0);
                            });
                        }
                    }
                }
                return;
            }
        }
Beispiel #10
0
        /// <summary>
        /// Unlike Content Ack
        /// </summary>
        /// <param name="msg"></param>
        public static void UnlikeContentAck(QHMessage msg)
        {
            long error = -1;

            if (msg.TryGetAt((byte)MsgUnlikeAckArg.Error, ref error))
            {
                switch ((UnlikeError)error)
                {
                case UnlikeError.SUCCESS:
                    long NumberID  = 0;
                    long ContentID = 0;
                    long CommentID = 0;
                    long ReplyID   = 0;
                    if (msg.TryGetAt((byte)MsgUnlikeAckArg.ContentID, ref ContentID))
                    {
                        if (msg.TryGetAt((byte)MsgUnlikeAckArg.CommentID, ref CommentID))
                        {
                            if (msg.TryGetAt((byte)MsgUnlikeAckArg.ReplyID, ref ReplyID))
                            {
                            }
                        }
                    }
                    //unlike Reply
                    if (ReplyID > 0)
                    {
                        if (Helper.Instance().ListReplyComment.ContainsKey(ReplyID))
                        {
                            var item = Helper.Instance().ListReplyComment[ReplyID];
                            if (msg.TryGetAt((byte)MsgUnlikeAckArg.NumberID, ref NumberID))
                            {
                                if (item.Likes.IndexOf(NumberID) >= 0)
                                {
                                    item.Likes.Remove(NumberID);
                                    item.Owner = NumberID;
                                    item.Reset();
                                }
                            }
                        }
                        return;
                    }
                    //unlike Comment
                    if (CommentID > 0)
                    {
                        if (Helper.Instance().ListComment.ContainsKey(CommentID))
                        {
                            var item = Helper.Instance().ListComment[CommentID];
                            if (msg.TryGetAt((byte)MsgUnlikeAckArg.NumberID, ref NumberID))
                            {
                                if (item.likes.IndexOf(NumberID) >= 0)
                                {
                                    item.likes.Remove(NumberID);
                                    item.Reset();
                                }
                            }
                        }
                        return;
                    }
                    //unlike Content
                    if (ContentID > 0)
                    {
                        if (Helper.Instance().ListContent.ContainsKey(ContentID))
                        {
                            var item = Helper.Instance().ListContent[ContentID];

                            if (msg.TryGetAt((byte)MsgUnlikeAckArg.NumberID, ref NumberID))
                            {
                                //tìm kiếm và xóa danh sách item like trong danh sách like
                                if (item.LikeContent.LikeContent.ContainsKey("" + NumberID))
                                {
                                    item.LikeContent.LikeContent.Remove("" + NumberID);
                                    item.LikeContent.Reset();
                                }
                            }
                        }
                        return;
                    }
                    break;

                case UnlikeError.ERR_PERMISSION_DENIED:
                    break;

                case UnlikeError.ERR_NOT_EXIST_REPLY:
                    break;

                case UnlikeError.ERR_NOT_EXIST_CONTENT:
                    break;

                case UnlikeError.ERR_NOT_EXIST_COMMENT:
                    break;
                }
            }
        }
Beispiel #11
0
        /// <summary>
        /// Like Content Ack
        /// </summary>
        /// <param name="msg"></param>
        public static void LikeContentAck(QHMessage msg)
        {
            var error = (LikeError)(msg.GetAt((byte)MsgLikeAckArg.Error) as QHNumber).value;

            switch (error)
            {
            case LikeError.SUCCESS:
                //Debug.WriteLine("Thành công");
                long ContentID = 0;
                long CommentID = 0;
                long ReplyID   = 0;
                if (msg.TryGetAt((byte)MsgLikeAckArg.ContentID, ref ContentID))
                {
                    if (msg.TryGetAt((byte)MsgLikeAckArg.CommentID, ref CommentID))
                    {
                        if (msg.TryGetAt((byte)MsgLikeAckArg.ReplyID, ref ReplyID))
                        {
                        }
                    }
                }
                //Like Reply
                if (ReplyID > 0)
                {
                    if (Helper.Instance().ListReplyComment.ContainsKey(ReplyID))
                    {
                        var id = Helper.Instance().MyAccount.Number_Id;

                        if (id > 0)
                        {
                            if (Helper.Instance().ListReplyComment[ReplyID].Likes.IndexOf(id) < 0)
                            {
                                Helper.Instance().ListReplyComment[ReplyID].Likes.Add(id);
                                Helper.Instance().ListReplyComment[ReplyID].Owner = id;
                                Helper.Instance().ListReplyComment[ReplyID].Reset();
                            }
                        }
                    }
                    return;
                }
                //Like Comment
                if (CommentID > 0)
                {
                    if (Helper.Instance().ListComment.ContainsKey(CommentID))
                    {
                        var id   = Helper.Instance().MyAccount.Number_Id;
                        var item = Helper.Instance().ListComment[CommentID];
                        if (id > 0)
                        {
                            item.NumberId = id;
                            if (item.likes.IndexOf(id) < 0)
                            {
                                item.likes.Add(id);
                                item.Reset();
                            }
                        }
                    }
                    return;
                }
                //Like Content
                if (ContentID > 0)
                {
                    if (Helper.Instance().ListContent.ContainsKey(ContentID))
                    {
                        var item = Helper.Instance().ListContent[ContentID];
                        var like = (new LikeContent
                        {
                            Content_Id = ContentID,
                            Owner = Helper.Instance().MyAccount.Number_Id
                        });
                        item.LikeContent.Owner = Helper.Instance().MyAccount.Number_Id;
                        if (!item.LikeContent.LikeContent.ContainsKey("" + item.LikeContent.Owner))
                        {
                            item.LikeContent.LikeContent.Add("" + item.LikeContent.Owner, like);
                            item.LikeContent.Reset();
                        }
                    }
                    return;
                }
                break;

            case LikeError.ERR_PERMISSION_DENIED:
                Debug.WriteLine("");
                break;

            case LikeError.ERR_NOT_EXIST_REPLY:
                break;

            case LikeError.ERR_NOT_EXIST_CONTENT:
                break;

            case LikeError.ERR_NOT_EXIST_COMMENT:
                break;
            }
        }