patch 595793eb543ce778275da1ad086c675444e04c34
Author: E. Bosch <presidev@AT@gmail.com>
Date: Sun Feb 21 01:12:58 CET 2021
* irc: Fix nick rename, was not updating channel structures
hunk ./irc.py 16
-from utils import chunks
+from utils import chunks, set_replace
hunk ./irc.py 148
+ current = user.irc_nick.lower()
hunk ./irc.py 150
- del self.users[user.irc_nick.lower()]
+ del self.users[current]
+ for ch in self.irc_channels.keys():
+ set_replace(self.irc_channels[ch], current, ni)
+ set_replace(self.irc_channels_ops[ch], current, ni)
+ set_replace(self.irc_channels_founder[ch], current, ni)
hunk ./utils.py 10
+
+def set_replace(set, item, new_item):
+ if item in set:
+ set.remove(item)
+ set.add(new_item)