diff options
author | Ryan Huber <rhuber@gmail.com> | 2015-11-14 01:49:51 +0000 |
---|---|---|
committer | Ryan Huber <rhuber@gmail.com> | 2015-11-14 01:49:51 +0000 |
commit | 918137d3e15e1e32404c01884bc2c59f05222b7d (patch) | |
tree | 939932929ad571830286bd68e97d718f2ebde006 /wee_slack.py | |
parent | 092a76928bb42970a88a7a7aaea425a4a59c9488 (diff) | |
download | wee-slack-918137d3e15e1e32404c01884bc2c59f05222b7d.tar.gz |
less updates makes it much faster
Diffstat (limited to 'wee_slack.py')
-rw-r--r-- | wee_slack.py | 13 |
1 files changed, 9 insertions, 4 deletions
diff --git a/wee_slack.py b/wee_slack.py index e83f0ba..c5bc9eb 100644 --- a/wee_slack.py +++ b/wee_slack.py @@ -766,7 +766,9 @@ class User(object): if channel.has_user(self.identifier): channel.update_nicklist() w.nicklist_nick_set(self.server.buffer, self.nicklist_pointer, "visible", "1") - buffer_list_update_next() + dm_channel = self.server.channels.find(self.name) + if dm_channel and dm_channel.active: + buffer_list_update_next() def set_inactive(self): self.presence = "away" @@ -774,7 +776,9 @@ class User(object): if channel.has_user(self.identifier): channel.update_nicklist() w.nicklist_nick_set(self.server.buffer, self.nicklist_pointer, "visible", "0") - buffer_list_update_next() + dm_channel = self.server.channels.find(self.name) + if dm_channel and dm_channel.active: + buffer_list_update_next() def update_color(self): if colorize_nicks: @@ -1609,6 +1613,7 @@ def buffer_list_update_cb(data, remaining_calls): now = time.time() if buffer_list_update and previous_buffer_list_update + 1 < now: + w.prnt("", "updated buffer list...") gray_check = False if len(servers) > 1: gray_check = True @@ -1639,7 +1644,7 @@ def buffer_closing_cb(signal, sig_type, data): def buffer_switch_cb(signal, sig_type, data): global previous_buffer, hotlist # this is to see if we need to gray out things in the buffer list - buffer_list_update_next() + # buffer_list_update_next() if channels.find(previous_buffer): channels.find(previous_buffer).mark_read() @@ -2011,7 +2016,7 @@ if __name__ == "__main__": # attach to the weechat hooks we need w.hook_timer(1000, 0, 0, "typing_update_cb", "") - w.hook_timer(1000, 0, 0, "buffer_list_update_cb", "") + w.hook_timer(3000, 0, 0, "buffer_list_update_cb", "") w.hook_timer(1000, 0, 0, "hotlist_cache_update_cb", "") w.hook_timer(1000 * 60 * 29, 0, 0, "slack_never_away_cb", "") w.hook_timer(1000 * 60 * 5, 0, 0, "cache_write_cb", "") |