Fix delete for all checkes

This commit is contained in:
tehcneko 2021-03-24 18:28:01 +08:00
parent 1e5b2de9d1
commit 48d1195bf6
No known key found for this signature in database
GPG Key ID: 280D6CCCF95715F9

View File

@ -1274,7 +1274,7 @@ public class AlertsCreator {
revokeTimeLimit = MessagesController.getInstance(account).revokeTimeLimit;
}
boolean canDeleteInbox = !secret && user != null && canRevokeInbox && revokeTimeLimit == 0x7fffffff;
final boolean[] deleteForAll = { true };
final boolean[] deleteForAll = new boolean[1];
boolean deleteChatForAll = false;
if (!second && (secret && !clear || canDeleteInbox) && !UserObject.isDeleted(user) || (deleteChatForAll = checkDeleteForAll && !clear && chat != null && chat.creator)) {
@ -1287,8 +1287,10 @@ public class AlertsCreator {
cell[0].setText(LocaleController.getString("DeleteGroupForAll", R.string.DeleteGroupForAll), "", false, false);
}
} else if (clear) {
deleteForAll[0] = true;
cell[0].setText(LocaleController.formatString("ClearHistoryOptionAlso", R.string.ClearHistoryOptionAlso, UserObject.getFirstName(user)), "", true, false);
} else {
deleteForAll[0] = true;
cell[0].setText(LocaleController.formatString("DeleteMessagesOptionAlso", R.string.DeleteMessagesOptionAlso, UserObject.getFirstName(user)), "", true, false);
}
cell[0].setPadding(LocaleController.isRTL ? AndroidUtilities.dp(16) : AndroidUtilities.dp(8), 0, LocaleController.isRTL ? AndroidUtilities.dp(8) : AndroidUtilities.dp(16), 0);