diff options
author | Ryan Huber <rhuber@gmail.com> | 2015-11-14 03:54:02 +0000 |
---|---|---|
committer | Ryan Huber <rhuber@gmail.com> | 2015-11-14 03:54:02 +0000 |
commit | e469a93cb35ae95c80a98865fdb1a6c06e11f7ad (patch) | |
tree | 838998229ddd95d5348e077f924434eb85ff8027 | |
parent | 918137d3e15e1e32404c01884bc2c59f05222b7d (diff) | |
download | wee-slack-e469a93cb35ae95c80a98865fdb1a6c06e11f7ad.tar.gz |
more performance fixes
-rw-r--r-- | wee_slack.py | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/wee_slack.py b/wee_slack.py index c5bc9eb..c0e7b6c 100644 --- a/wee_slack.py +++ b/wee_slack.py @@ -328,6 +328,7 @@ class Channel(object): """ def __init__(self, server, name, identifier, active, last_read=0, prepend_name="", members=[], topic=""): self.name = prepend_name + name + self.current_short_name = prepend_name + name self.identifier = identifier self.active = active self.last_read = float(last_read) @@ -384,7 +385,8 @@ class Channel(object): w.buffer_set(self.channel_buffer, "localvar_set_type", 'private') else: w.buffer_set(self.channel_buffer, "localvar_set_type", 'channel') - w.buffer_set(self.channel_buffer, "short_name", 'loading..') + #w.buffer_set(self.channel_buffer, "short_name", 'loading..') + w.buffer_set(self.channel_buffer, "short_name", self.name) buffer_list_update_next() def attach_buffer(self): @@ -548,7 +550,8 @@ class Channel(object): else: new_name = self.name if self.channel_buffer: - if w.buffer_get_string(self.channel_buffer, "short_name") != (color + new_name): + if self.current_short_name != (color + new_name): + self.current_short_name = color + new_name w.buffer_set(self.channel_buffer, "short_name", color + new_name) # deprecated in favor of redrawing the entire buffer @@ -715,7 +718,9 @@ class DmChannel(Channel): new_name = self.server.users.find(self.name).formatted_name(' ', force_color) if self.channel_buffer: - w.buffer_set(self.channel_buffer, "short_name", new_name) + if self.current_short_name != new_name: + self.current_short_name = new_name + w.buffer_set(self.channel_buffer, "short_name", new_name) def update_nicklist(self): pass |