patch 056e5b5a8b6235ebdca9d0524b1d8a5d50e41837
Author: E. Bosch <presidev@AT@gmail.com>
Date: Mon Feb 1 19:48:42 CET 2021
* irc: update user mask generation
hunk ./irc.py 99
- def get_irc_user_mask(self, nick):
- return '{}!{}@{}'.format(nick, nick, self.hostname)
hunk ./irc.py 205
- self.get_irc_user_mask(user.irc_nick), channel
+ user.get_irc_mask(), channel
hunk ./irc.py 218
- self.get_irc_user_mask(user.irc_nick), channel, topic
+ user.get_irc_mask(), channel, topic
hunk ./irc.py 230
- self.get_irc_user_mask(user.irc_nick), channel
+ user.get_irc_mask(), channel
hunk ./irc.py 244
+ def get_irc_mask(self):
+ return '{}!{}@{}'.format(self.irc_nick, self.irc_username, self.address)
+
hunk ./telegram.py 111
+ def get_irc_user_from_telegram(self, tid):
+ nick = self.tid_to_iid[tid]
+ return self.irc.users[nick.lower()]
+
hunk ./telegram.py 155
- nick = await self.get_irc_nick_from_telegram_id(event.sender_id)
+ user = self.get_irc_user_from_telegram(event.sender_id)
hunk ./telegram.py 157
- for user in [x for x in self.irc.users.values() if x.stream]:
- await self.irc.send_irc_command(user, ':{} PRIVMSG {} :{}'.format(
- self.irc.get_irc_user_mask(nick), user.irc_nick, message
+ for irc_user in [x for x in self.irc.users.values() if x.stream]:
+ await self.irc.send_irc_command(irc_user, ':{} PRIVMSG {} :{}'.format(
+ user.get_irc_mask(), irc_user.irc_nick, message
hunk ./telegram.py 171
- nick = await self.get_irc_nick_from_telegram_id(event.sender_id)
+ user = self.get_irc_user_from_telegram(event.sender_id)
+
hunk ./telegram.py 187
- for user in [x for x in self.irc.users.values() if x.stream]:
- await self.irc.send_irc_command(user, ':{} PRIVMSG {} :{}'.format(
- self.irc.get_irc_user_mask(nick), channel, message
+ for irc_user in [x for x in self.irc.users.values() if x.stream]:
+ await self.irc.send_irc_command(irc_user, ':{} PRIVMSG {} :{}'.format(
+ user.get_irc_mask(), channel, message