From eee4f1d065eadd72417504153367a37fa68147bd Mon Sep 17 00:00:00 2001 From: Kiooeht Date: Thu, 2 Jun 2011 10:02:24 -0700 Subject: [PATCH] Bug fix: Keep OP/Voice correct when someone changes nick --- TODO.mkdn | 3 ++- memos.py | 12 ++++++++++++ 2 files changed, 14 insertions(+), 1 deletion(-) diff --git a/TODO.mkdn b/TODO.mkdn index 73926cb..fa8ed01 100644 --- a/TODO.mkdn +++ b/TODO.mkdn @@ -21,7 +21,8 @@ Bugs * When using mood sort, scroll position jumps to last selected chum * When switching chumhandles, OP doesn't appear to retain OP status (though they do) * When left for a really long time, animations slow down pesterchum -* Openning resets appearance of OP/voice for anyone that become OP/voice after you joined a memo +* Openning userlist resets appearance of OP/voice for anyone that become OP/voice after you joined a memo +* No sign of error if regexp quirk is malformed (not enough captured groups, etc) Mac Bugs -------- diff --git a/memos.py b/memos.py index 996b265..cc6abad 100644 --- a/memos.py +++ b/memos.py @@ -765,6 +765,18 @@ class PesterMemo(PesterConvo): self.times[h].removeTime(t.getTime()) if update == "nick": self.addUser(newnick) + newchums = self.userlist.findItems(newnick, QtCore.Qt.MatchFlags(0)) + for nc in newchums: + for c in chums: + if c.op: + nc.op = True + icon = PesterIcon(self.mainwindow.theme["memos/op/icon"]) + nc.setIcon(icon) + if c.voice: + nc.voice = True + icon = PesterIcon(self.mainwindow.theme["memos/voice/icon"]) + nc.setIcon(icon) + self.sortUsers() elif update == "kick": if len(chums) == 0: return