diff options
author | Ryan Huber <rhuber@gmail.com> | 2016-03-11 15:55:58 +0000 |
---|---|---|
committer | Ryan Huber <rhuber@gmail.com> | 2016-03-11 15:55:58 +0000 |
commit | e81bb4e40c52cc7eb2d5fe5d827d8a60319bc729 (patch) | |
tree | aa8b95d27f302ac7781429b40fd20360f7852135 /wee_slack.py | |
parent | 9c724c32173152101d2276a0ffff42803ec29180 (diff) | |
parent | 8ee1c56b827c37cebfc5e88062395ba838248ea9 (diff) | |
download | wee-slack-e81bb4e40c52cc7eb2d5fe5d827d8a60319bc729.tar.gz |
Merge pull request #177 from trygveaa/fix/error-in-update-nicklist
Return from update_nicklist if no channel_buffer
Diffstat (limited to 'wee_slack.py')
-rw-r--r-- | wee_slack.py | 24 |
1 files changed, 13 insertions, 11 deletions
diff --git a/wee_slack.py b/wee_slack.py index 4593e65..ea335ba 100644 --- a/wee_slack.py +++ b/wee_slack.py @@ -439,17 +439,19 @@ class Channel(object): self.server.channels.update_hashtable() def update_nicklist(self, user=None): - if self.channel_buffer: - w.buffer_set(self.channel_buffer, "nicklist", "1") - - #create nicklists for the current channel if they don't exist - #if they do, use the existing pointer - here = w.nicklist_search_group(self.channel_buffer, '', NICK_GROUP_HERE) - if not here: - here = w.nicklist_add_group(self.channel_buffer, '', NICK_GROUP_HERE, "weechat.color.nicklist_group", 1) - afk = w.nicklist_search_group(self.channel_buffer, '', NICK_GROUP_AWAY) - if not afk: - afk = w.nicklist_add_group(self.channel_buffer, '', NICK_GROUP_AWAY, "weechat.color.nicklist_group", 1) + if not self.channel_buffer: + return + + w.buffer_set(self.channel_buffer, "nicklist", "1") + + #create nicklists for the current channel if they don't exist + #if they do, use the existing pointer + here = w.nicklist_search_group(self.channel_buffer, '', NICK_GROUP_HERE) + if not here: + here = w.nicklist_add_group(self.channel_buffer, '', NICK_GROUP_HERE, "weechat.color.nicklist_group", 1) + afk = w.nicklist_search_group(self.channel_buffer, '', NICK_GROUP_AWAY) + if not afk: + afk = w.nicklist_add_group(self.channel_buffer, '', NICK_GROUP_AWAY, "weechat.color.nicklist_group", 1) if user: user = self.members_table[user] |