Ejemplo n.º 1
0
        public override async Task RemoveAndClearDialog()
        {
            try {
                await ClearDialogHistory();

                if (dialog.peer.Constructor == Constructor.peerChat)
                {
                    InputPeer peer = InputPeer;
                    InputPeerChatConstructor peerChat = (InputPeerChatConstructor)peer;
                    InputUser user = TL.inputUserSelf();

                    messages_StatedMessage message =
                        await session.Api.messages_deleteChatUser(peerChat.chat_id, user);

                    switch (message.Constructor)
                    {
                    case Constructor.messages_statedMessage:
                        session.Updates.processUpdatePtsSeq(((Messages_statedMessageConstructor)message).pts, ((Messages_statedMessageConstructor)message).seq);
                        break;

                    case Constructor.messages_statedMessageLink:
                        session.Updates.processUpdatePtsSeq(((Messages_statedMessageLinkConstructor)message).pts, ((Messages_statedMessageLinkConstructor)message).seq);
                        break;
                    }
                }

                session.Dialogs.Model.Dialogs.Remove(this);
            }
            catch (Exception ex) {
                logger.error("exception: {0}", ex);
            }
        }