patch fb9e0599871ca17db6fe28ef3d2a53c5354f264a
Author: E. Bosch <presidev@AT@gmail.com>
Date: Fri Feb 5 00:26:44 CET 2021
* irc: Fix channel handling for self user
hunk ./irc.py 58
+ user.del_from_channels(self)
hunk ./irc.py 101
- self.irc_channels_founder = {}
+ self.irc_channels_founder = collections.defaultdict(set)
hunk ./irc.py 211
+ op = self.get_irc_op(self.tg.tg_username, channel)
+ if op == '@': self.irc_channels_ops[chan].add(user.irc_nick)
+ elif op == '~': self.irc_channels_founder[chan].add(user.irc_nick)
hunk ./irc.py 245
+ def get_irc_op(self, nick, channel):
+ chan = channel.lower()
+ if chan in self.irc_channels.keys():
+ if nick in self.irc_channels_ops[chan]:
+ return '@'
+ if nick in self.irc_channels_founder[chan]:
+ return '~'
+ return ''
+
hunk ./irc.py 275
+
+ def del_from_channels(self, irc, channels=None):
+ for chan in channels if channels else irc.irc_channels.keys():
+ irc.irc_channels[chan].discard(self.irc_nick)
+ irc.irc_channels_ops[chan].discard(self.irc_nick)
+ irc.irc_channels_founder[chan].discard(self.irc_nick)
hunk ./telegram.py 107
- self.irc.irc_channels_founder[chan] = user_nick
+ self.irc.irc_channels_founder[chan].add(user_nick)