mirror of https://github.com/NekoX-Dev/NekoX.git
Fix read on non-current tabs
This commit is contained in:
parent
7eac5f48ef
commit
3587c48fec
|
@ -13647,6 +13647,29 @@ public class MessagesController extends BaseController implements NotificationCe
|
|||
return clearingHistoryDialogs.get(did) != null;
|
||||
}
|
||||
|
||||
public void loadTabDialogs(MessagesController.DialogFilter dialogFilter) {
|
||||
sortingDialogFilter = dialogFilter;
|
||||
Collections.sort(allDialogs, dialogDateComparator);
|
||||
ArrayList<TLRPC.Dialog> dialogsByFilter = sortingDialogFilter.dialogs;
|
||||
for (int a = 0, N = allDialogs.size(); a < N; a++) {
|
||||
TLRPC.Dialog d = allDialogs.get(a);
|
||||
if (d instanceof TLRPC.TL_dialog) {
|
||||
int high_id = (int) (d.id >> 32);
|
||||
int lower_id = (int) d.id;
|
||||
if (lower_id == 0 && high_id != 0) {
|
||||
TLRPC.EncryptedChat encryptedChat = getEncryptedChat(high_id);
|
||||
if (encryptedChat != null) {
|
||||
lower_id = encryptedChat.user_id;
|
||||
}
|
||||
}
|
||||
if (sortingDialogFilter.includesDialog(getAccountInstance(), lower_id, d)) {
|
||||
dialogsByFilter.add(d);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
public void sortDialogs(SparseArray<TLRPC.Chat> chatsDict) {
|
||||
dialogsServerOnly.clear();
|
||||
dialogsCanAddUsers.clear();
|
||||
|
|
|
@ -2228,9 +2228,12 @@ public class DialogsActivity extends BaseFragment implements NotificationCenter.
|
|||
showDeleteAlert(dialogFilter);
|
||||
} else {
|
||||
if (dialogFilter == null) {
|
||||
int folderId = tabView.getId() == Integer.MAX_VALUE ? -1 : -1;
|
||||
int folderId = tabView.getId() == Integer.MAX_VALUE ? 0 : -1;
|
||||
getMessagesStorage().readAllDialogs(folderId);
|
||||
} else {
|
||||
if (dialogFilter.dialogs.isEmpty()) {
|
||||
getMessagesController().loadTabDialogs(dialogFilter);
|
||||
}
|
||||
for (TLRPC.Dialog dialog : dialogFilter.dialogs) {
|
||||
if (dialog.unread_count == 0 && dialog.unread_mentions_count == 0)
|
||||
continue;
|
||||
|
@ -2244,6 +2247,7 @@ public class DialogsActivity extends BaseFragment implements NotificationCenter.
|
|||
}
|
||||
});
|
||||
}
|
||||
|
||||
scrollView.addView(linearLayout, LayoutHelper.createScroll(LayoutHelper.WRAP_CONTENT, LayoutHelper.WRAP_CONTENT, Gravity.LEFT | Gravity.TOP));
|
||||
scrimPopupWindow = new ActionBarPopupWindow(popupLayout, LayoutHelper.WRAP_CONTENT, LayoutHelper.WRAP_CONTENT) {
|
||||
@Override
|
||||
|
|
Loading…
Reference in New Issue