diff --git a/TMessagesProj/src/main/java/org/telegram/ui/DialogsActivity.java b/TMessagesProj/src/main/java/org/telegram/ui/DialogsActivity.java index 5986838796..379eccb1fa 100644 --- a/TMessagesProj/src/main/java/org/telegram/ui/DialogsActivity.java +++ b/TMessagesProj/src/main/java/org/telegram/ui/DialogsActivity.java @@ -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; });