Open nicklan opened 4 years ago
Thanks for the detailed reproduction steps. I can reproduce the issue. I checked the official client, but there was no special API or websocket message, so the official client seems to be treated specially. I ’ll try to find out if there ’s any other way
Does this not allow you to set the presence? https://api.slack.com/methods/users.setPresence
There's some more information here as well https://api.slack.com/docs/presence-and-status
Feel free to Ignore this if you've already looked into these.
after calling the api, the response does not change
[2020-05-18 00:34:31] [trace] REQUEST FINISHED. URL: "https://slack.com/api/users.setPresence", PARAMS: (("presence" . "auto")), DATA: (:ok t) - emacs-slack
user.getPresence
:{
"ok": true,
"presence": "away",
"online": true,
"auto_away": true,
"manual_away": false,
"connection_count": 2,
"last_activity": 1589726425
}
[2020-05-18 00:36:06] [trace] REQUEST FINISHED. URL: "https://slack.com/api/users.setPresence", PARAMS: (("presence" . "away")), DATA: (:ok t) - emacs-slack
{
"ok": true,
"presence": "away",
"online": true,
"auto_away": true,
"manual_away": true,
"connection_count": 2,
"last_activity": 1589726425
}
[2020-05-18 00:36:50] [trace] REQUEST FINISHED. URL: "https://slack.com/api/users.setPresence", PARAMS: (("presence" . "auto")), DATA: (:ok t) - emacs-slack
{
"ok": true,
"presence": "away",
"online": true,
"auto_away": true,
"manual_away": false,
"connection_count": 2,
"last_activity": 1589726425
}
Also having this problem.
Looks like reconnecting ws will mark user as active again, so I'm using an ugly hack to keep myself as active: Set a timer to reconnect ws with slack-ws--reconnect
, and call something like slack-im-list-update
to refresh my status 🤕
@stonekyx do you know what the interval is for getting set to away by any chance?
Slack API doc says it's 30 minutes. Anyway, this feels like a problem in Slack API, unless emacs-slack didn't actually send the request (which I suppose is unlikely the case).
Also having this problem.
Looks like reconnecting ws will mark user as active again, so I'm using an ugly hack to keep myself as active: Set a timer to reconnect ws with
slack-ws--reconnect
, and call something likeslack-im-list-update
to refresh my status
I don't seem to have access to a slack-ws--reconnect
command. I have been running slack-start
, which is really annoying when it runs when I am writing a message. Could you give some more details on your hack?
It's something like this:
(run-with-timer 0 (* 25 60)
(lambda ()
(slack-ws--reconnect (oref slack-current-team :id) t)
(slack-im-list-update)))
Maybe the last slack-im-list-update
is not necessary though, I just kept it there to be safe.
Describe the bug When using emacs-slack I don't appear as "active" to other users. I can confirm this by manually curling the api. For example, I just typed a message to someone and then do:
curl -H "Authorization: Bearer TOKEN" "https://slack.com/api/users.getPresence?user=MYID"
and I get:However, if I open the official client then for 30 minutes it'll return:
To Reproduce Steps to reproduce the behavior:
curl -H "Authorization: Bearer TOKEN" "https://slack.com/api/users.getPresence?user=MYID"
Expected behavior A bit hard to define. Maybe at least that after sending a message I should be "active" for a while. According to the slack docs: "A user is active if they have at least one client connected to Slack, and they are not marked as "away"." so if possible emacs-slack should just do whatever it needs to to keep the user "active" as long as it's running, and probably also add a method to mark oneself as "away"