aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRyan Huber <rhuber@gmail.com>2015-02-12 08:32:38 -0800
committerRyan Huber <rhuber@gmail.com>2015-02-12 08:32:38 -0800
commit0bdb09e299a082c316457b5216969a2723f021aa (patch)
tree061df1b342d5c2282ecf36ab7b28c113033e5463
parentdad3c514c0eb9a3b7020756bf7d3635a1d165701 (diff)
downloadwee-slack-0bdb09e299a082c316457b5216969a2723f021aa.tar.gz
only update nicklist if channel buffer exists
-rw-r--r--wee_slack.py23
1 files changed, 12 insertions, 11 deletions
diff --git a/wee_slack.py b/wee_slack.py
index fc3a633..a0d346d 100644
--- a/wee_slack.py
+++ b/wee_slack.py
@@ -395,17 +395,18 @@ class Channel(SlackThing):
self.channel_buffer = None
def update_nicklist(self):
- w.buffer_set(self.channel_buffer, "nicklist", "1")
- w.nicklist_remove_all(self.channel_buffer)
- try:
- for user in self.members:
- user = self.server.users.find(user)
- if user.presence == 'away':
- w.nicklist_add_nick(self.channel_buffer, "", user.name, user.color_name, " ", "", 1)
- else:
- w.nicklist_add_nick(self.channel_buffer, "", user.name, user.color_name, "+", "", 1)
- except:
- print "DEBUG: {} {}".format(self.identifier,self.name)
+ if self.channel_buffer:
+ w.buffer_set(self.channel_buffer, "nicklist", "1")
+ w.nicklist_remove_all(self.channel_buffer)
+ try:
+ for user in self.members:
+ user = self.server.users.find(user)
+ if user.presence == 'away':
+ w.nicklist_add_nick(self.channel_buffer, "", user.name, user.color_name, " ", "", 1)
+ else:
+ w.nicklist_add_nick(self.channel_buffer, "", user.name, user.color_name, "+", "", 1)
+ except:
+ print "DEBUG: {} {}".format(self.identifier,self.name)
def fullname(self):
return "{}.{}".format(self.server.domain, self.name)