diff options
author | Ryan Huber <rhuber@gmail.com> | 2014-10-28 12:42:40 -0700 |
---|---|---|
committer | Ryan Huber <rhuber@gmail.com> | 2014-10-28 12:42:40 -0700 |
commit | c609d61a74a0952badbf862028149f6267de982e (patch) | |
tree | 63583f192dea5cde192dc95531d1d7037cdc7a54 /wee_slack.py | |
parent | bcf3f1ada405e8a5c73ea7839996f96d195ad345 (diff) | |
download | wee-slack-c609d61a74a0952badbf862028149f6267de982e.tar.gz |
handle im channel creation
Diffstat (limited to 'wee_slack.py')
-rw-r--r-- | wee_slack.py | 22 |
1 files changed, 16 insertions, 6 deletions
diff --git a/wee_slack.py b/wee_slack.py index 17047f1..129f975 100644 --- a/wee_slack.py +++ b/wee_slack.py @@ -632,12 +632,6 @@ def process_group_marked(message_json): if not legacy_mode: w.buffer_set(channel.channel_buffer, "hotlist", "-1") -def process_im_marked(message_json): - channel = channels.find(message_json["channel"]) - channel.mark_read(False) - if not legacy_mode: - w.buffer_set(channel.channel_buffer, "hotlist", "-1") - def process_channel_created(message_json): server = servers.find(message_json["myserver"]) item = message_json["channel"] @@ -690,6 +684,22 @@ def process_im_open(message_json): server = servers.find(message_json["myserver"]) server.channels.find(message_json["channel"]).open(False) +def process_im_marked(message_json): + channel = channels.find(message_json["channel"]) + channel.mark_read(False) + if not legacy_mode: + w.buffer_set(channel.channel_buffer, "hotlist", "-1") + +def process_im_created(message_json): + server = servers.find(message_json["myserver"]) + item = message_json["channel"] + if server.channels.find(message_json["channel"]["name"]): + server.channels.find(message_json["channel"]["name"]).open(False) + else: + item = message_json["channel"] + server.channels.append(DmChannel(server, item["name"], item["id"], item["is_open"], item["last_read"])) + w.prnt(server.buffer, "New channel created: %s" % item["name"]) + 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) |