コード例 #1
0
        public async Task DeleteChatAsync(DeleteChatConfirmDialogDataTemplate confirmDialogModel, ChatDataTemplate Chat)
        {
            if (confirmDialogModel.Confirmed)
            {
                await Task.Run(async() =>
                {
                    if (Chat.Chat.chatType == ChatType.MUC)
                    {
                        SetChatBookmarked(Chat, false);

                        MUCDBManager.INSTANCE.setMUCChatInfo(Chat.MucInfo, true, false);
                        Logger.Info("Deleted MUC info for: " + Chat.Chat.id);
                    }
                    else
                    {
                        await SetChatInRosterAsync(Chat, false);
                    }

                    if (!confirmDialogModel.KeepChatMessages)
                    {
                        await ChatDBManager.INSTANCE.deleteAllChatMessagesForChatAsync(Chat.Chat.id);
                        Logger.Info("Deleted chat messages for: " + Chat.Chat.id);
                    }

                    ChatDBManager.INSTANCE.setChat(Chat.Chat, true, true);
                    Logger.Info("Deleted chat: " + Chat.Chat.id);
                });
            }
        }
コード例 #2
0
        public async Task DeleteChatAsync(DeleteChatConfirmDialogDataTemplate confirmDialogModel, ChatDataTemplate chat)
        {
            if (confirmDialogModel.Confirmed)
            {
                await Task.Run(async() =>
                {
                    if (chat.Chat.chatType == ChatType.MUC)
                    {
                        SetChatBookmarked(chat, false);

                        MUCDBManager.INSTANCE.setMUCChatInfo(chat.MucInfo, true, false);
                        Logger.Info("Deleted MUC info for: " + chat.Chat.id);
                    }
                    else
                    {
                        if (confirmDialogModel.RemoveFromRoster)
                        {
                            await SetChatInRosterAsync(chat, false);
                        }
                    }

                    if (!confirmDialogModel.KeepChatMessages)
                    {
                        await ChatDBManager.INSTANCE.deleteAllChatMessagesForChatAsync(chat.Chat.id);
                        Logger.Info("Deleted chat messages for: " + chat.Chat.id);
                    }

                    if (chat.Chat.chatType == ChatType.MUC || confirmDialogModel.RemoveFromRoster)
                    {
                        ChatDBManager.INSTANCE.setChat(chat.Chat, true, true);
                        Logger.Info("Deleted chat: " + chat.Chat.id);
                    }
                    else
                    {
                        chat.Chat.isChatActive = false;
                        ChatDBManager.INSTANCE.setChat(chat.Chat, false, true);
                        Logger.Info("Marked chat as not active: " + chat.Chat.id);
                    }
                });
            }
        }
コード例 #3
0
        public async Task DeleteChatAsync(DeleteChatConfirmDialogDataTemplate confirmDialogModel, ChatDataTemplate chat)
        {
            if (confirmDialogModel.Confirmed)
            {
                await Task.Run(async() =>
                {
                    if (chat.Chat.chatType == ChatType.MUC)
                    {
                        await SetChatBookmarkedAsync(chat, false);
                    }
                    else
                    {
                        if (confirmDialogModel.RemoveFromRoster)
                        {
                            await SetChatInRosterAsync(chat, false);
                        }
                    }

                    DataCache.INSTANCE.DeleteChat(chat.Chat, confirmDialogModel.RemoveFromRoster);
                });
            }
        }
コード例 #4
0
 //--------------------------------------------------------Constructor:----------------------------------------------------------------\\
 #region --Constructors--
 public DeleteChatConfirmDialogContext(ChatTable chat)
 {
     MODEL = new DeleteChatConfirmDialogDataTemplate(chat);
 }