mirror of
https://github.com/NekoX-Dev/NekoX.git
synced 2025-01-22 14:40:10 +01:00
fix wrong tab dialogs after forward (credit. satouriko)
This commit is contained in:
parent
c5989d43ca
commit
255bb50555
@ -98,8 +98,6 @@ 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);
|
||||
|
@ -1849,12 +1849,6 @@ public class DialogsActivity extends BaseFragment implements NotificationCenter.
|
||||
|
||||
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;
|
||||
@ -1883,13 +1877,6 @@ 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);
|
||||
@ -6507,7 +6494,15 @@ public class DialogsActivity extends BaseFragment implements NotificationCenter.
|
||||
layoutManager.scrollToPositionWithOffset(1, 0);
|
||||
}
|
||||
|
||||
if (viewPages[a].dialogsAdapter.isDataSetChanged() || args.length > 0) {
|
||||
if (viewPages[a].selectedType >= 0 &&
|
||||
viewPages[a].selectedType < getMessagesController().dialogFilters.size() &&
|
||||
getMessagesController().dialogFilters.get(viewPages[a].selectedType) != null &&
|
||||
getMessagesController().selectedDialogFilter[viewPages[a].dialogsType == 8 ? 1 : 0] != null &&
|
||||
getMessagesController().dialogFilters.get(viewPages[a].selectedType).id !=
|
||||
getMessagesController().selectedDialogFilter[viewPages[a].dialogsType == 8 ? 1 : 0].id) {
|
||||
getMessagesController().selectDialogFilter(getMessagesController().dialogFilters.get(viewPages[a].selectedType), viewPages[a].dialogsType == 8 ? 1 : 0);
|
||||
viewPages[a].dialogsAdapter.notifyDataSetChanged();
|
||||
} else if (viewPages[a].dialogsAdapter.isDataSetChanged() || args.length > 0) {
|
||||
viewPages[a].dialogsAdapter.notifyDataSetChanged();
|
||||
int newItemCount = viewPages[a].dialogsAdapter.getItemCount();
|
||||
if (newItemCount > oldItemCount && initialDialogsType != 11 && initialDialogsType != 12 && initialDialogsType != 13) {
|
||||
|
Loading…
x
Reference in New Issue
Block a user