From 282b3592c2af74e8bac64b382c17ae1d79a0b912 Mon Sep 17 00:00:00 2001 From: John Preston Date: Mon, 28 Feb 2022 19:46:16 +0300 Subject: [PATCH] Show toast about jump-to non-existent message. --- Telegram/Resources/langs/lang.strings | 1 + Telegram/SourceFiles/history/history_widget.cpp | 3 +++ 2 files changed, 4 insertions(+) diff --git a/Telegram/Resources/langs/lang.strings b/Telegram/Resources/langs/lang.strings index ff50bae54..bfeea416e 100644 --- a/Telegram/Resources/langs/lang.strings +++ b/Telegram/Resources/langs/lang.strings @@ -1195,6 +1195,7 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL "lng_message_empty" = "Empty Message"; "lng_message_unsupported" = "This message is not supported by your version of Telegram Desktop. Please update to the latest version in Settings, or install it from {link}"; +"lng_message_not_found" = "Message doesn't exist."; "lng_duration_seconds#one" = "{count} second"; "lng_duration_seconds#other" = "{count} seconds"; diff --git a/Telegram/SourceFiles/history/history_widget.cpp b/Telegram/SourceFiles/history/history_widget.cpp index 96138b7c4..4bcc7d696 100644 --- a/Telegram/SourceFiles/history/history_widget.cpp +++ b/Telegram/SourceFiles/history/history_widget.cpp @@ -5155,6 +5155,9 @@ int HistoryWidget::countInitialScrollTop() { const auto itemTop = _list->itemTop(item); if (itemTop < 0) { setMsgId(0); + Ui::ShowMultilineToast({ + .text = { tr::lng_message_not_found(tr::now) }, + }); return countInitialScrollTop(); } else { const auto view = item->mainView();