mirror of
https://github.com/AyuGram/AyuGramDesktop.git
synced 2026-07-25 06:54:43 +00:00
fix: hide search ads
This commit is contained in:
@@ -13,6 +13,10 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL
|
||||
#include "dialogs/ui/chat_search_in.h" // IsHashOrCashtagSearchQuery
|
||||
#include "main/main_session.h"
|
||||
|
||||
// AyuGram includes
|
||||
#include "ayu/ayu_settings.h"
|
||||
|
||||
|
||||
namespace Api {
|
||||
namespace {
|
||||
|
||||
@@ -93,6 +97,11 @@ void PeerSearch::requestSponsored() {
|
||||
).done([=](
|
||||
const MTPcontacts_SponsoredPeers &result,
|
||||
mtpRequestId requestId) {
|
||||
const auto &settings = AyuSettings::getInstance();
|
||||
if (settings.disableAds) {
|
||||
finishSponsored(requestId, PeerSearchResult{});
|
||||
return;
|
||||
}
|
||||
result.match([&](const MTPDcontacts_sponsoredPeersEmpty &) {
|
||||
finishSponsored(requestId, PeerSearchResult{});
|
||||
}, [&](const MTPDcontacts_sponsoredPeers &data) {
|
||||
|
||||
Reference in New Issue
Block a user