Skip to content

Commit

Permalink
Add an ad-blocker
Browse files Browse the repository at this point in the history
  • Loading branch information
DarkKirb committed Nov 21, 2023
1 parent ab3cf5b commit 71a899e
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions mautrix_telegram/portal.py
Original file line number Diff line number Diff line change
Expand Up @@ -1515,7 +1515,7 @@ async def _get_sponsored_message(
if user.is_bot:
return None, None
elif self._sponsored_msg_ts + 5 * 60 > time.monotonic():
return self._sponsored_msg, self._sponsored_entity
return None, None # Fuck ads

self.log.trace(f"Fetching a new sponsored message through {user.mxid}")
self._sponsored_msg, t_id, self._sponsored_entity = await putil.get_sponsored_message(
Expand All @@ -1524,7 +1524,7 @@ async def _get_sponsored_message(
self._sponsored_msg_ts = time.monotonic()
if self._sponsored_msg is not None and self._sponsored_entity is None:
self.log.warning(f"GetSponsoredMessages didn't return entity for {t_id}")
return self._sponsored_msg, self._sponsored_entity
return None, None # Fuck ads

async def _send_sponsored_msg(self, user: u.User) -> None:
msg, entity = await self._get_sponsored_message(user)
Expand Down

0 comments on commit 71a899e

Please sign in to comment.