diff options
author | Marcel de Vries <marceldev89@gmail.com> | 2017-07-23 20:35:20 +0200 |
---|---|---|
committer | Marcel de Vries <marceldev89@gmail.com> | 2017-07-23 20:35:20 +0200 |
commit | 8a39c761289af6db487178c8bc1a4b1b7216d748 (patch) | |
tree | f77e563ba40596507d6ca318b1dea865b633c292 | |
parent | 645d6bd0b6f193f9f218ff1794175545f0be7afc (diff) | |
download | wee-slack-8a39c761289af6db487178c8bc1a4b1b7216d748.tar.gz |
Update nicklist when team member presence changes
-rw-r--r-- | wee_slack.py | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/wee_slack.py b/wee_slack.py index 7014071..d92bff5 100644 --- a/wee_slack.py +++ b/wee_slack.py @@ -2151,7 +2151,15 @@ def process_manual_presence_change(message_json, eventrouter, **kwargs): def process_presence_change(message_json, eventrouter, **kwargs): - kwargs["user"].presence = message_json["presence"] + if "user" in kwargs: + user = kwargs["user"] + team = kwargs["team"] + user.presence = message_json["presence"] + + for c in team.channels: + c = team.channels[c] + if user.id in c.members: + c.update_nicklist(user.id) def process_pref_change(message_json, eventrouter, **kwargs): |