Skip to content

Commit

Permalink
Don't show full query in "nothing found" info.
Browse files Browse the repository at this point in the history
  • Loading branch information
john-preston committed Oct 3, 2024
1 parent 440ebfc commit b60c7e9
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion Telegram/SourceFiles/dialogs/dialogs_inner_widget.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -87,6 +87,7 @@ namespace {

constexpr auto kHashtagResultsLimit = 5;
constexpr auto kStartReorderThreshold = 30;
constexpr auto kQueryPreviewLimit = 32;

[[nodiscard]] int FixedOnTopDialogsCount(not_null<Dialogs::IndexedList*> list) {
auto result = 0;
Expand Down Expand Up @@ -145,11 +146,14 @@ constexpr auto kStartReorderThreshold = 30;
tr::now,
Ui::Text::Bold));
if (!trimmed.isEmpty()) {
const auto preview = (trimmed.size() > kQueryPreviewLimit + 3)
? (trimmed.mid(0, kQueryPreviewLimit) + Ui::kQEllipsis)
: trimmed;
text.append("\n").append(
tr::lng_search_tab_no_results_text(
tr::now,
lt_query,
trimmed));
trimmed.mid(0, kQueryPreviewLimit)));
if (hashtag) {
text.append("\n").append(
tr::lng_search_tab_no_results_retry(tr::now));
Expand Down

0 comments on commit b60c7e9

Please sign in to comment.