mirror of https://github.com/NekoX-Dev/NekoX.git
Fix wrong tabs after forward
This commit is contained in:
parent
0fd1f7ba12
commit
32097cc6e0
|
@ -98,6 +98,8 @@ public class MessagesController extends BaseController implements NotificationCe
|
|||
public ArrayList<TLRPC.Dialog> dialogsForBlock = new ArrayList<>();
|
||||
public ArrayList<TLRPC.Dialog> dialogsGroupsOnly = new ArrayList<>();
|
||||
public DialogFilter[] selectedDialogFilter = new DialogFilter[2];
|
||||
public DialogFilter[] selectedDialogFilterBackup = new DialogFilter[2];
|
||||
// Fix tabs after forward, when NekoConfig.showTabsOnForward is enabled
|
||||
private int dialogsLoadedTillDate = Integer.MAX_VALUE;
|
||||
public int unreadUnmutedDialogs;
|
||||
public ConcurrentHashMap<Long, Integer> dialogs_read_inbox_max = new ConcurrentHashMap<>(100, 1.0f, 2);
|
||||
|
|
|
@ -1847,9 +1847,14 @@ public class DialogsActivity extends BaseFragment implements NotificationCenter.
|
|||
}
|
||||
getNotificationCenter().addObserver(this, NotificationCenter.messagesDeleted);
|
||||
|
||||
|
||||
getNotificationCenter().addObserver(this, NotificationCenter.didClearDatabase);
|
||||
|
||||
if (initialDialogsType == 3 && NekoConfig.showTabsOnForward) {
|
||||
// Fix wrong tabs after forward
|
||||
getMessagesController().selectedDialogFilterBackup[0] = getMessagesController().selectedDialogFilter[0];
|
||||
getMessagesController().selectedDialogFilterBackup[1] = getMessagesController().selectedDialogFilter[1];
|
||||
}
|
||||
|
||||
loadDialogs(getAccountInstance());
|
||||
getMessagesController().loadPinnedDialogs(folderId, 0, null);
|
||||
return true;
|
||||
|
@ -1878,6 +1883,13 @@ public class DialogsActivity extends BaseFragment implements NotificationCenter.
|
|||
@Override
|
||||
public void onFragmentDestroy() {
|
||||
super.onFragmentDestroy();
|
||||
|
||||
if (initialDialogsType == 3 && NekoConfig.showTabsOnForward) {
|
||||
// Fix wrong tabs after forward
|
||||
getMessagesController().selectedDialogFilter[0] = getMessagesController().selectedDialogFilterBackup[0];
|
||||
getMessagesController().selectedDialogFilter[1] = getMessagesController().selectedDialogFilterBackup[1];
|
||||
}
|
||||
|
||||
if (searchString == null) {
|
||||
getNotificationCenter().removeObserver(this, NotificationCenter.dialogsNeedReload);
|
||||
NotificationCenter.getGlobalInstance().removeObserver(this, NotificationCenter.emojiLoaded);
|
||||
|
|
Loading…
Reference in New Issue