From eebd68b23a8cb98bb5b7d191c5a5f368505bdb00 Mon Sep 17 00:00:00 2001 From: ed Date: Thu, 1 Sep 2022 23:25:37 +0200 Subject: [PATCH] indicate hilights in statusbar immediately --- r0c/ivt100.py | 2 +- r0c/world.py | 13 +++++++++++-- 2 files changed, 12 insertions(+), 3 deletions(-) diff --git a/r0c/ivt100.py b/r0c/ivt100.py index ebbef4a..2c78683 100644 --- a/r0c/ivt100.py +++ b/r0c/ivt100.py @@ -850,7 +850,7 @@ class VT100_Client(object): # print('ping in {0} while in {1}'.format(uchan.nchan.get_name(), self.user.active_chan.nchan.get_name())) if self.bell and len(uchan.nchan.uchans) > 1: - self.say(u"\x07".encode("utf-8")) + self.say(b"\x07") if self.show_hilight_tutorial: self.show_hilight_tutorial = False diff --git a/r0c/world.py b/r0c/world.py index b1ea666..3b1cd30 100644 --- a/r0c/world.py +++ b/r0c/world.py @@ -96,8 +96,14 @@ class World(object): last_msg = nchan.msgs[-1].sno if nchan.msgs else 0 + upd_users = set() # users with clients to repaint + for uchan in nchan.uchans: - uchan.update_activity_flags(False, last_msg) + if uchan.update_activity_flags(False, last_msg): + # update status bar immediately + if uchan.user.active_chan != uchan: + upd_users.add(uchan.user) + if uchan.user.active_chan == uchan: if ( not uchan.user.client.handshake_sz @@ -106,7 +112,10 @@ class World(object): continue # print('refreshing {0} for {1}'.format(nchan.get_name(), uchan.user.nick)) - uchan.user.client.refresh(False) + upd_users.add(uchan.user) + + for user in upd_users: + user.client.refresh(False) def send_chan_msg(self, from_nick, nchan, text, ping_self=True): max_hist_mem = self.ar.hist_mem