fix file protection dialogs loading

This commit is contained in:
vivabelarus 2025-01-28 03:36:42 +03:00
parent c87f8a8228
commit 1c5f02c707
No known key found for this signature in database
GPG key ID: 49D91FD306D1018E

View file

@ -12314,8 +12314,7 @@ public class MessagesController extends BaseController implements NotificationCe
FileLog.d("loaded folderId " + folderId + " loadType " + loadType + " count " + dialogsRes.dialogs.size());
}
long[] dialogsLoadOffset = getUserConfig().getDialogLoadOffsets(folderId);
if (loadType == DIALOGS_LOAD_TYPE_CACHE && (dialogsRes.dialogs.size() == 0 || getMessagesStorage().fileProtectionEnabled() && !fileProtectedDialogsLoaded)) {
fileProtectedDialogsLoaded = true;
if (loadType == DIALOGS_LOAD_TYPE_CACHE && dialogsRes.dialogs.size() == 0) {
AndroidUtilities.runOnUIThread(() -> {
putUsers(dialogsRes.users, true);
if (fullUsers != null) {
@ -12338,6 +12337,11 @@ public class MessagesController extends BaseController implements NotificationCe
getNotificationCenter().postNotificationName(NotificationCenter.dialogsNeedReload);
});
return;
} else if (loadType == DIALOGS_LOAD_TYPE_CACHE && getMessagesStorage().fileProtectionEnabled() && !fileProtectedDialogsLoaded) {
fileProtectedDialogsLoaded = true;
AndroidUtilities.runOnUIThread(() -> {
loadDialogs(folderId, 0, count, false);
});
}
LongSparseArray<TLRPC.Dialog> new_dialogs_dict = new LongSparseArray<>();