aboutsummaryrefslogtreecommitdiffstats
path: root/wee_slack.py
diff options
context:
space:
mode:
authorRyan Huber <rhuber@gmail.com>2015-06-10 08:35:44 -0700
committerRyan Huber <rhuber@gmail.com>2015-06-10 08:35:44 -0700
commit0261f580ef20674b05bdcab312baa846ab2b3693 (patch)
treecb6e22c3406b5ca9e14b3a644276f1ca6798e08f /wee_slack.py
parenta3a2b5b020fe2f42c6499af5cea7a1e5b8608b91 (diff)
parenta8c854c2dc34222c68a015a14a431bf01ff26107 (diff)
downloadwee-slack-0261f580ef20674b05bdcab312baa846ab2b3693.tar.gz
Merge pull request #73 from scharfie/fix-presence-change
fixed that /slack (away|back) didn't update status
Diffstat (limited to 'wee_slack.py')
-rw-r--r--wee_slack.py10
1 files changed, 7 insertions, 3 deletions
diff --git a/wee_slack.py b/wee_slack.py
index b64fa04..05a39e0 100644
--- a/wee_slack.py
+++ b/wee_slack.py
@@ -1049,14 +1049,18 @@ def process_team_join(message_json):
server.users.append(User(server, item["name"], item["id"], item["presence"]))
server.buffer_prnt(server.buffer, "New user joined: {}".format(item["name"]))
+def process_manual_presence_change(message_json):
+ process_presence_change(message_json)
def process_presence_change(message_json):
- buffer_name = "{}.{}".format(domain, message_json["user"])
+ server = servers.find(message_json["myserver"])
+ nick = message_json.get("user", server.nick)
+ buffer_name = "{}.{}".format(domain, nick)
buf_ptr = w.buffer_search("", buffer_name)
if message_json["presence"] == 'active':
- users.find(message_json["user"]).set_active()
+ users.find(nick).set_active()
else:
- users.find(message_json["user"]).set_inactive()
+ users.find(nick).set_inactive()
def process_channel_marked(message_json):