Skip to content

Commit

Permalink
fixed issue with chat self deletions
Browse files Browse the repository at this point in the history
  • Loading branch information
nikitasius committed Dec 23, 2021
1 parent 98c1022 commit a83fbff
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -4889,6 +4889,10 @@ public void deleteDialog(final long did, int onlyHistory, boolean revoke) {
deleteDialog(did, 1, onlyHistory, 0, revoke, null, 0);
}

public void deleteDialog(final long did, int onlyHistory, boolean revoke, boolean isSelf) {
deleteDialog(did, 1, onlyHistory, 0, revoke, null, 0, isSelf);
}

public void setDialogHistoryTTL(long did, int ttl) {
TLRPC.TL_messages_setHistoryTTL req = new TLRPC.TL_messages_setHistoryTTL();
req.peer = getInputPeer(did);
Expand Down Expand Up @@ -4965,7 +4969,7 @@ protected void deleteDialog(long did, int first, int onlyHistory, int max_id, bo
if (first == 1 && max_id == 0) {
TLRPC.InputPeer peerFinal = peer;
getMessagesStorage().getDialogMaxMessageId(did, (param) -> {
deleteDialog(did, 2, onlyHistory, Math.max(0, param), revoke, peerFinal, taskId);
deleteDialog(did, 2, onlyHistory, Math.max(0, param), revoke, peerFinal, taskId, true);
checkIfFolderEmpty(1);
});
return;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5630,7 +5630,7 @@ private void performSelectedDialogsAction(ArrayList<Long> selectedDialogs, int a

private void performDeleteOrClearDialogAction(int action, long selectedDialog, TLRPC.Chat chat, boolean isBot, boolean revoke) {
if (action == clear) {
getMessagesController().deleteDialog(selectedDialog, 1, revoke);
getMessagesController().deleteDialog(selectedDialog, 1, revoke, true);
} else {
if (chat != null) {
if (ChatObject.isNotInChat(chat)) {
Expand All @@ -5640,7 +5640,7 @@ private void performDeleteOrClearDialogAction(int action, long selectedDialog, T
getMessagesController().deleteParticipantFromChat((int) -selectedDialog, currentUser, null, null, revoke, false);
}
} else {
getMessagesController().deleteDialog(selectedDialog, 0, revoke);
getMessagesController().deleteDialog(selectedDialog, 0, revoke, true);
if (isBot) {
getMessagesController().blockPeer((int) selectedDialog);
}
Expand Down

0 comments on commit a83fbff

Please sign in to comment.