aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRyan Huber <rhuber@gmail.com>2015-11-23 19:23:54 -0800
committerRyan Huber <rhuber@gmail.com>2015-11-23 19:23:54 -0800
commite37a5db7812b92e1dbd9210be9c21ae93066803a (patch)
tree88f5caac6500294f07ed107bf4c6bcb283338eb7
parent72347bfe9826245c8df42bd04122786aaea9083d (diff)
parent597b03fdd952b7b1df9a613b525538d0a0def940 (diff)
downloadwee-slack-e37a5db7812b92e1dbd9210be9c21ae93066803a.tar.gz
Merge pull request #130 from rawdigits/129_typing_notification_errors
check that channel has a buffer before sending typing notif
-rw-r--r--wee_slack.py20
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)