Skip to content

Commit

Permalink
fix: Open correct saved message view from search top button
Browse files Browse the repository at this point in the history
  • Loading branch information
omg-xtao committed Feb 17, 2024
1 parent 69aac4e commit 8c87384
Showing 1 changed file with 12 additions and 3 deletions.
15 changes: 12 additions & 3 deletions TMessagesProj/src/main/java/org/telegram/ui/DialogsActivity.java
Original file line number Diff line number Diff line change
Expand Up @@ -3210,9 +3210,18 @@ public boolean canToggleSearch() {

// na: Added ability to open Saved Messages on long click on search top button
searchItem.setOnLongClickListener(v -> {
Bundle args = new Bundle();
args.putLong("user_id", getUserConfig().getClientUserId());
presentFragment(new ChatActivity(args));
if (MessagesController.getInstance(UserConfig.selectedAccount).savedViewAsChats) {
Bundle args = new Bundle();
args.putLong("dialog_id", UserConfig.getInstance(currentAccount).getClientUserId());
args.putInt("type", MediaActivity.TYPE_MEDIA);
args.putInt("start_from", SharedMediaLayout.TAB_SAVED_DIALOGS);
MediaActivity mediaActivity = new MediaActivity(args, null);
presentFragment(mediaActivity);
} else {
Bundle args = new Bundle();
args.putLong("user_id", UserConfig.getInstance(currentAccount).getClientUserId());
presentFragment(new ChatActivity(args));
}
return true;
});

Expand Down

0 comments on commit 8c87384

Please sign in to comment.