mirror of
https://github.com/AyuGram/AyuGramDesktop.git
synced 2025-07-27 07:52:57 +02:00
fix: disable video ads
This commit is contained in:
parent
608bcf7d42
commit
d98e6fd51e
1 changed files with 10 additions and 0 deletions
|
@ -249,6 +249,11 @@ bool SponsoredMessages::canHaveFor(not_null<History*> history) const {
|
|||
}
|
||||
|
||||
bool SponsoredMessages::canHaveFor(not_null<HistoryItem*> item) const {
|
||||
const auto &settings = AyuSettings::getInstance();
|
||||
if (settings.disableAds) {
|
||||
return false;
|
||||
}
|
||||
|
||||
return item->history()->peer->isBroadcast()
|
||||
&& item->isRegular();
|
||||
}
|
||||
|
@ -442,6 +447,11 @@ void SponsoredMessages::parseForVideo(
|
|||
|
||||
SponsoredForVideo SponsoredMessages::prepareForVideo(
|
||||
not_null<PeerData*> peer) {
|
||||
const auto &settings = AyuSettings::getInstance();
|
||||
if (settings.disableAds) {
|
||||
return {};
|
||||
}
|
||||
|
||||
const auto i = _dataForVideo.find(peer);
|
||||
if (i == end(_dataForVideo) || i->second.entries.empty()) {
|
||||
return {};
|
||||
|
|
Loading…
Add table
Reference in a new issue