diff options
author | Tollef Fog Heen <tfheen@err.no> | 2017-07-28 22:37:27 +0200 |
---|---|---|
committer | Tollef Fog Heen <tfheen@err.no> | 2017-07-28 22:37:27 +0200 |
commit | 2b3b969dffcaee7d2dfe23d4bcedf57c685567dc (patch) | |
tree | f0930da11e561e77b4044b12e731e64e17e2f67b | |
parent | 89fbdef5c6d27283517bf61877d86af44ecb09e6 (diff) | |
parent | a4ae1bb4349523a7ef6fdf29ba945b98bbed7cf7 (diff) | |
download | wee-slack-2b3b969dffcaee7d2dfe23d4bcedf57c685567dc.tar.gz |
Merge remote-tracking branch 'origin/nicklist-presence-groups'
-rw-r--r-- | wee_slack.py | 13 |
1 files changed, 12 insertions, 1 deletions
diff --git a/wee_slack.py b/wee_slack.py index a89d675..680ff6b 100644 --- a/wee_slack.py +++ b/wee_slack.py @@ -1084,6 +1084,14 @@ class SlackTeam(object): dbg("Unexpected error: {}\nSent: {}".format(sys.exc_info()[0], data)) self.set_connected() + def update_member_presence(self, user, presence): + user.presence = presence + + for c in self.channels: + c = self.channels[c] + if user.id in c.members: + c.update_nicklist(user.id) + class SlackChannel(object): """ @@ -2158,7 +2166,10 @@ 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"] + team.update_member_presence(user, message_json["presence"]) def process_pref_change(message_json, eventrouter, **kwargs): |