diff options
author | Ryan Huber <rhuber@gmail.com> | 2015-11-23 19:18:56 -0800 |
---|---|---|
committer | Ryan Huber <rhuber@gmail.com> | 2015-11-23 19:18:56 -0800 |
commit | 597b03fdd952b7b1df9a613b525538d0a0def940 (patch) | |
tree | 88f5caac6500294f07ed107bf4c6bcb283338eb7 /wee_slack.py | |
parent | 72347bfe9826245c8df42bd04122786aaea9083d (diff) | |
download | wee-slack-597b03fdd952b7b1df9a613b525538d0a0def940.tar.gz |
check that channel has a buffer before sending typing notif
Diffstat (limited to 'wee_slack.py')
-rw-r--r-- | wee_slack.py | 20 |
1 files changed, 11 insertions, 9 deletions
diff --git a/wee_slack.py b/wee_slack.py index 1dc7fed..5af9cca 100644 --- a/wee_slack.py +++ b/wee_slack.py @@ -476,17 +476,19 @@ class Channel(object): self.active = False def set_typing(self, user): - if w.buffer_get_integer(self.channel_buffer, "hidden") == 0: - self.typing[user] = time.time() - buffer_list_update_next() + if self.channel_buffer: + if w.buffer_get_integer(self.channel_buffer, "hidden") == 0: + self.typing[user] = time.time() + buffer_list_update_next() def unset_typing(self, user): - if w.buffer_get_integer(self.channel_buffer, "hidden") == 0: - try: - del self.typing[user] - buffer_list_update_next() - except: - pass + if self.channel_buffer: + if w.buffer_get_integer(self.channel_buffer, "hidden") == 0: + try: + del self.typing[user] + buffer_list_update_next() + except: + pass def send_message(self, message): message = self.linkify_text(message) |