aboutsummaryrefslogtreecommitdiffstats
path: root/wee_slack.py
diff options
context:
space:
mode:
authorTrygve Aaberge <trygveaa@gmail.com>2018-04-12 23:38:21 +0200
committerTrygve Aaberge <trygveaa@gmail.com>2018-04-13 00:12:47 +0200
commite4e71a2b72cd48d66d4c0e412970d39aa8b9c6f1 (patch)
tree708c338e3ef970c3e94bffb42f9fa8c59060136e /wee_slack.py
parent6e5daa721162eec0299bacdfe006d47d2bee4a70 (diff)
downloadwee-slack-e4e71a2b72cd48d66d4c0e412970d39aa8b9c6f1.tar.gz
Fix finding dm channel after merge with master
Finding by name didn't work anymore.
Diffstat (limited to 'wee_slack.py')
-rw-r--r--wee_slack.py5
1 files changed, 3 insertions, 2 deletions
diff --git a/wee_slack.py b/wee_slack.py
index 02b4dfc..eb9e278 100644
--- a/wee_slack.py
+++ b/wee_slack.py
@@ -2314,8 +2314,9 @@ def process_user_change(message_json, eventrouter, **kwargs):
profile = user.get("profile")
team = kwargs["team"]
team.users[user["id"]].update_status(profile.get("status_emoji"), profile.get("status_text"))
- dmchannel = team.get_channel_map()[user["name"]]
- team.channels[dmchannel].render_topic(topic=create_user_status_string(profile))
+ dmchannel = team.find_channel_by_members({user["id"]}, channel_type='im')
+ if dmchannel:
+ dmchannel.set_topic(create_user_status_string(profile))
def process_user_typing(message_json, eventrouter, **kwargs):