From ded7aada5243dd05b535e9f9cc7969c2d1a37654 Mon Sep 17 00:00:00 2001 From: 23rd <23rd@vivaldi.net> Date: Fri, 15 Mar 2024 02:34:08 +0300 Subject: [PATCH] Slightly improved filter for choosing users requested by bot. --- Telegram/SourceFiles/api/api_bot.cpp | 8 ++++---- Telegram/SourceFiles/boxes/peers/choose_peer_box.cpp | 4 +++- 2 files changed, 7 insertions(+), 5 deletions(-) diff --git a/Telegram/SourceFiles/api/api_bot.cpp b/Telegram/SourceFiles/api/api_bot.cpp index d49f1bbf7..706b7a7cb 100644 --- a/Telegram/SourceFiles/api/api_bot.cpp +++ b/Telegram/SourceFiles/api/api_bot.cpp @@ -421,10 +421,10 @@ void ActivateBotCommand(ClickHandlerContext context, int row, int column) { MTP_int(itemId), MTP_int(id), MTP_vector_from_range( - result - | ranges::views::transform([]( - not_null peer) { - return MTPInputPeer(peer->input); })) + result | ranges::views::transform([]( + not_null peer) { + return MTPInputPeer(peer->input); + })) )).done([=](const MTPUpdates &result) { peer->session().api().applyUpdates(result); }).send(); diff --git a/Telegram/SourceFiles/boxes/peers/choose_peer_box.cpp b/Telegram/SourceFiles/boxes/peers/choose_peer_box.cpp index 7d4d74453..33ce09ac4 100644 --- a/Telegram/SourceFiles/boxes/peers/choose_peer_box.cpp +++ b/Telegram/SourceFiles/boxes/peers/choose_peer_box.cpp @@ -49,7 +49,7 @@ public: void submit(); QString savedMessagesChatStatus() const override { - return tr::lng_saved_forward_here(tr::now); + return {}; } private: @@ -295,6 +295,8 @@ object_ptr CreatePeerByQueryBox( case Type::User: { const auto user = peer->asUser(); return user + && !user->isInaccessible() + && !user->isNotificationsUser() && checkRestriction(query.userIsBot, user->isBot()) && checkRestriction(query.userIsPremium, user->isPremium()); }