Skip to content

Commit

Permalink
Fix: immortal cache of sponsored messages
Browse files Browse the repository at this point in the history
  • Loading branch information
xtrime-ru committed Jan 1, 2022
1 parent 7fdc43f commit a05e11c
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/danog/MadelineProto/Wrappers/Ads.php
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ public function getSponsoredMessages($peer): \Generator
{
$peer = (yield from $this->getInfo($peer))['bot_api_id'];
$cache = yield $this->sponsoredMessages[$peer];
if ($cache && $cache[0] < \time()) {
if ($cache && $cache[0] > \time()) {
return $cache[1];
}
$result = (yield from $this->methodCallAsyncRead('channels.getSponsoredMessages', ['channel' => $peer]))['messages'];
Expand Down

0 comments on commit a05e11c

Please sign in to comment.