aboutsummaryrefslogtreecommitdiffstats
path: root/wee_slack.py
diff options
context:
space:
mode:
authorTollef Fog Heen <tfheen@err.no>2015-06-26 01:37:29 +0200
committerTollef Fog Heen <tfheen@err.no>2015-06-26 01:37:29 +0200
commit491f5ee488f1b0decda7f335e39a09d7b703aa3e (patch)
tree59a3dc175b1e1c1d7f00d14944e9b9a562ac4f96 /wee_slack.py
parentd9512d4ef7915367bd04554119be92f609f2e645 (diff)
downloadwee-slack-491f5ee488f1b0decda7f335e39a09d7b703aa3e.tar.gz
Handle the case of messages about users typing in non-existing channels
In some cases, not sure which, slack will tell us about users typing in channels we don't know about. Avoid generating a backtrace in that case.
Diffstat (limited to 'wee_slack.py')
-rw-r--r--wee_slack.py5
1 files changed, 4 insertions, 1 deletions
diff --git a/wee_slack.py b/wee_slack.py
index 455eaf4..57df9cd 100644
--- a/wee_slack.py
+++ b/wee_slack.py
@@ -1179,7 +1179,10 @@ def process_im_created(message_json):
def process_user_typing(message_json):
server = servers.find(message_json["myserver"])
- server.channels.find(message_json["channel"]).set_typing(server.users.find(message_json["user"]).name)
+ channel = server.channels.find(message_json["channel"])
+ if channel:
+ channel.set_typing(server.users.find(message_json["user"]).name)
+
# todo: does this work?