Refresh userlist on nick change

This commit is contained in:
Dpeta 2022-08-17 11:24:50 +02:00
parent 3d740658b0
commit 085efda62b
5 changed files with 24 additions and 8 deletions

View file

@ -12,6 +12,7 @@
### Fixed ### Fixed
- Error when manually moving group. - Error when manually moving group.
- EOF on send not resulting in a disconnect. - EOF on send not resulting in a disconnect.
- Desynced memo userlist on handle change, userlist is now re-requested from server on handle change.
## [v2.4.1] - 2022-07-05 ## [v2.4.1] - 2022-07-05

16
irc.py
View file

@ -754,14 +754,17 @@ class PesterHandler(DefaultCommandHandler):
#self.parent.userPresentUpdate.emit("", channel, m+":%s" % (op)) #self.parent.userPresentUpdate.emit("", channel, m+":%s" % (op))
def nick(self, oldnick, newnick, hopcount=0): def nick(self, oldnick, newnick, hopcount=0):
# NICK from/to us PchumLog.info("%s, %s" % (oldnick, newnick))
# svsnick
if oldnick == self.mainwindow.profile().handle: if oldnick == self.mainwindow.profile().handle:
# Server changed our handle, svsnick? # Server changed our handle, svsnick?
self.parent.getSvsnickedOn.emit(oldnick, newnick) self.parent.getSvsnickedOn.emit(oldnick, newnick)
# NICK from/to someone else # etc.
oldhandle = oldnick[0:oldnick.find("!")] oldhandle = oldnick[0:oldnick.find("!")]
if oldhandle == self.mainwindow.profile().handle: if ((oldhandle == self.mainwindow.profile().handle)
or (newnick == self.mainwindow.profile().handle)):
#print('hewwo')
self.parent.myHandleChanged.emit(newnick) self.parent.myHandleChanged.emit(newnick)
newchum = PesterProfile(newnick, chumdb=self.mainwindow.chumdb) newchum = PesterProfile(newnick, chumdb=self.mainwindow.chumdb)
self.parent.moodUpdated.emit(oldhandle, Mood("offline")) self.parent.moodUpdated.emit(oldhandle, Mood("offline"))
@ -792,6 +795,13 @@ class PesterHandler(DefaultCommandHandler):
# helpers.msg(self.client, "#pesterchum", getglub) # helpers.msg(self.client, "#pesterchum", getglub)
def endofnames(self, server, nick, channel, msg): def endofnames(self, server, nick, channel, msg):
try:
namelist = self.channelnames[channel]
except KeyError:
# EON seems to return with wrong capitalization sometimes?
for cn in self.channelnames.keys():
if channel.lower() == cn.lower():
channel = cn
namelist = self.channelnames[channel] namelist = self.channelnames[channel]
pl = PesterList(namelist) pl = PesterList(namelist)
del self.channelnames[channel] del self.channelnames[channel]

View file

@ -321,6 +321,7 @@ class IRCClient:
for el in data: for el in data:
tags, prefix, command, args = parse_raw_irc_command(el) tags, prefix, command, args = parse_raw_irc_command(el)
print(tags, prefix, command, args)
try: try:
# Only need tags with tagmsg # Only need tags with tagmsg
if command.upper() == "TAGMSG": if command.upper() == "TAGMSG":

View file

@ -107,9 +107,10 @@ class CommandHandler(object):
try: try:
f(*args) f(*args)
except TypeError as e: except TypeError as e:
logging.info("Failed to pass command, did the server pass an unsupported paramater? " + str(e)) PchumLog.info("Failed to pass command, did the server pass an unsupported paramater? " + str(e))
except Exception as e: except Exception as e:
logging.info("Failed to pass command, %s" % str(e)) #logging.info("Failed to pass command, %s" % str(e))
PchumLog.exception("Failed to pass command")
@protected @protected
def __unhandled__(self, cmd, *args): def __unhandled__(self, cmd, *args):

View file

@ -1573,7 +1573,7 @@ class PesterWindow(MovingWindow):
if self.sincerecv >= 30: if self.sincerecv >= 30:
self.pingServer.emit() self.pingServer.emit()
self.sincerecv += 15 # Only updating every 10s is better for performance. self.sincerecv += 15 # Only updating every 15s is better for performance.
def profile(self): def profile(self):
return self.userprofile.chat return self.userprofile.chat
@ -3316,6 +3316,9 @@ class PesterWindow(MovingWindow):
self.changeProfile(svsnick=(oldhandle, newhandle)) self.changeProfile(svsnick=(oldhandle, newhandle))
@QtCore.pyqtSlot(QString) @QtCore.pyqtSlot(QString)
def myHandleChanged(self, handle): def myHandleChanged(self, handle):
# Update nick in channels
for memo in self.memos.keys():
self.requestNames.emit(memo)
if self.profile().handle == handle: if self.profile().handle == handle:
self.doAutoIdentify() self.doAutoIdentify()
self.doAutoJoins() self.doAutoJoins()