How to properly leave a group chat and remove this chat from chats list
Hi,
I use LeaveChat function to leave a group chat. This call removes user from the chat but leaves this chat in the chats list. I mean this chat remains visible in my application and official telegram client, at least for some time. It looks this way.
I tried to call DeleteChatHistory(chatId = xxx, removeFromChatList = true, revoke = false) function as soon as LeaveChat call completes. It removes the chat from the list and works well except some rare cases when DeleteChatHistory function fails with Chat info not found message.
I don't have any idea what is wrong in this case. Should I call DeleteChatHistory function when LeaveChat completes to remove chat from the list? Is it just a problem with DeleteChatHistory function call?
Yes, if you want to delete the chat completely, you need to call DeleteChatHistory after LeaveChat is finished. If it returns "Chat info not found", then chat history can't be deleted, because it is already inaccessible.
In fact, DeleteChatHistory is needed only for basic groups.
Ok, thanks, I will just ignore this Chat info not found error, hope it will work without side effects. I think we can close this ticket.
In fact,
DeleteChatHistoryis needed only for basic groups.
What about private supergroups?
@zevlg It is impossible to keep access to messages in left supergroups regardless of their type.