コード例 #1
0
        private async Task LoadLastMessagesApi(string x)
        {
            if (IsChatMessageLoaded)
            {
                return;
            }

            UserDetails.OffsetLastChat = MAdapter.MLastMessagesUser.Count > 0 ? MAdapter.MLastMessagesUser.LastOrDefault()?.ChatTime ?? "0" : "0";

            var(apiStatus, respond) = await RequestsAsync.Message.Get_users_list_Async(UserDetails.UserId, UserDetails.UserId, "35", x);

            if (apiStatus == 200 && respond is GetUsersListObject result)
            {
                if (result.Users.Count > 0)
                {
                    GlobalContext.LoadUserMessagesDuringScroll(result);
                    IsChatMessageLoaded = false;
                }
                else
                {
                    IsChatMessageLoaded = true;
                }
            }
            else
            {
                Methods.DisplayReportResult(Activity, respond);
            }
        }