diff options
author | Ryan Huber <rhuber@gmail.com> | 2014-10-13 14:48:09 -0700 |
---|---|---|
committer | Ryan Huber <rhuber@gmail.com> | 2014-10-13 14:48:09 -0700 |
commit | 2c83f02c3774d04a6a1b1344e7eab8dcb49bcfbc (patch) | |
tree | 79663aa312afe1e4fcea2a1d2040244bdf738938 | |
parent | df8a15beb1b7393a31debf62a62171cce7d5984f (diff) | |
download | wee-slack-2c83f02c3774d04a6a1b1344e7eab8dcb49bcfbc.tar.gz |
fix link expansion broken during typing object change
-rw-r--r-- | wee_slack.py | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/wee_slack.py b/wee_slack.py index 0ec09b1..9d9c5bc 100644 --- a/wee_slack.py +++ b/wee_slack.py @@ -226,7 +226,9 @@ def process_error(message_json): def process_message(message_json): mark_silly_channels_read(message_json["channel"]) - typing.delete(message_json["channel"], message_json["user"]) + #below prevents typing notification from disapearing if the server sends an unfurled message + if message_json.has_key("user"): + typing.delete(message_json["channel"], message_json["user"]) channel = message_json["channel"] user = user_hash[message_json["message"]["user"]] if message_json["message"].has_key("attachments"): @@ -236,7 +238,7 @@ def process_message(message_json): text = "%s\tEDITED: %s" % (user, message_json["message"]["text"]) text = text.encode('ascii', 'ignore') if channel.startswith(DIRECT_MESSAGE): - buffer_name = "%s.%s" % (server, channel[3:]) + buffer_name = "%s.%s" % (server, channel[len(DIRECT_MESSAGE):]) else: buffer_name = "%s.#%s" % (server, channel) if message_json["subtype"] == "message_changed": |