diff options
author | Bryan Gilbert <gilbertw1@gmail.com> | 2017-07-17 11:54:56 -0400 |
---|---|---|
committer | Bryan Gilbert <gilbertw1@gmail.com> | 2017-07-17 11:56:17 -0400 |
commit | 6106d9e766f0ea759be3ece5a74ab0e5c3833126 (patch) | |
tree | 1bdfc5461226f6829e7162c58d351ae459005578 | |
parent | 6718e2f88a9f9153b2b125ce9ec7c097a8d1ad61 (diff) | |
download | wee-slack-6106d9e766f0ea759be3ece5a74ab0e5c3833126.tar.gz |
add group info request and handler to set unread count and update hotlist
-rw-r--r-- | wee_slack.py | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/wee_slack.py b/wee_slack.py index 367899c..f269349 100644 --- a/wee_slack.py +++ b/wee_slack.py @@ -56,6 +56,7 @@ SLACK_API_TRANSLATOR = { "join": "channels.join", "leave": "groups.leave", "mark": "groups.mark", + "info": "groups.info" }, "thread": { "history": None, @@ -2086,6 +2087,14 @@ def handle_channelsinfo(channel_json, eventrouter, **kwargs): team = eventrouter.teams[request_metadata.team_hash] channel = team.channels[channel_id] channel.set_unread_count_display(unread_count_display) + +def handle_groupsinfo(group_json, eventrouter, **kwargs): + unread_count_display = group_json['group']['unread_count_display'] + group_id = group_json['group']['id'] + request_metadata = pickle.loads(group_json["wee_slack_request_metadata"]) + team = eventrouter.teams[request_metadata.team_hash] + group = team.channels[group_id] + group.set_unread_count_display(unread_count_display) def handle_groupshistory(message_json, eventrouter, **kwargs): handle_history(message_json, eventrouter, **kwargs) |