patch 0d2a17b54534226b14e45db9a6f5116bd2c3c41b
Author: E. Bosch <presidev@AT@gmail.com>
Date: Sun Apr 30 00:53:29 CEST 2023
* telegram: Make more robust the forward handler, take into account if the
user has a privacy option to only show the name
hunk ./telegram.py 200
+ def get_irc_nick_from_telegram_forward(self, fwd):
+ if fwd.from_id is None:
+ # telegram user has privacy options to show only the name
+ nick = fwd.from_name
+ else:
+ user = self.get_irc_user_from_telegram(fwd.from_id.user_id)
+ if user is None:
+ nick = '{}'
+ self.refwd_me = True
+ else:
+ nick = user.irc_nick
+ return nick
+
hunk ./telegram.py 560
- async def handle_telegram_forward(self, event): [_$_]
- forwarded_user = self.get_irc_user_from_telegram(event.forward.from_id.user_id)
- if forwarded_user is None:
- forwarded_nick = '{}'
- self.refwd_me = True
- else:
- forwarded_nick = forwarded_user.irc_nick
+ async def handle_telegram_forward(self, event):
+ forwarded_nick = self.get_irc_nick_from_telegram_forward(event.message.fwd_from)