| Commit message (Collapse) | Author | Age | Files | Lines |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
When using session tokens we apparently don't get any
user_status_changed events, so when a user updated their status the
title in an IM with them wasn't updated.
If we specify the query param slack_client=desktop when connecting to
the websocket we at least get a user_invalidated event when the user
info changes. This doesn't include any info though, so we have to make a
request to get the updated user info.
On workspaces with a lot of users, we may get user_invalidated very
often, so we can't fetch new user info every time we get it, otherwise
we would make a lot of requests. So at least for now, only update the
user info if we have an open IM with the user. This ensures the status
in the IM title is kept up to date at least.
In other words, nick changes are not picked up and updated. This is also
the case when using OAuth tokens, as we only listen for
user_status_changed events, and not the other user updated events.
Handling nick changes is also a bit more complex, so I'll leave that for
later.
|
| |
|
| |
|
|
|
|
|
| |
For now this only supports known channels, which currently typically
means they have to be referenced in a channel with history loaded.
|
|
|
|
|
|
| |
For now this only supports known nicks, i.e. mostly nicks that have
posted a message, is mentioned in a message or appears in the nicklist
in any of the conversations that's loaded.
|
|
|
|
|
|
|
|
|
| |
Files uploaded in Slack Connect channels doesn't contain any
information, so we have to make a request to files.info in order to get
the information to render it.
See https://api.slack.com/apis/channels-between-orgs#check_file_info for
more info.
|
|
|
|
|
| |
It's better to post nested objects as JSON rather than url encoding
them, and this fixes some type errors.
|
|
|
|
|
|
|
| |
It's now possible to set and clear the uses status.
For now it's not possible to set the status emoji or the status expiration.
Signed-off-by: Pierguido Lambri <plambri@redhat.com>
|
|
|
|
|
|
| |
This can happen in channels shared between workspaces if one of the
workspaces are removed. Then messages from users in that workspace will
not have a user field anymore, but instead a user_profile field.
|
|
|
|
|
| |
Also mark a lot of fields as NotRequired as tombstone files doesn't have
these fields.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
It's possible to have a token that's only for one workspace in an
enterprise grid. For me with such a token, it returns channels in all
workspaces in client.userBoot, but only channels in the tokens workspace
in client.counts. This meant that we didn't get last_read for all
channels we opened, and additionally some methods like
conversations.members would fail with "channel_not_found" for those
channels.
This filters the channels from client.userBoot by checking that the
channel is in the current sub workspace, if the token we're using is not
an org level (for all workspaces the user is in) token.
Additionally it raises an error if any of the channels to open isn't
included in the response from client.counts to prevent missing last_read
for any channels if there are other channels that isn't included. I
could have filtered the list of channels to open by the channels
included from client.counts, but I don't want any channels to just
silently be ignored.
|
| |
|
|
|
|
|
| |
I have a huddle message in an IM on an enterprise workspace that doesn't
have this field.
|
|
|
|
|
| |
It seems that if you request conversations.info right after joining a
channel, it's missing in the response.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Some enterprise workspaces are restricted in which API methods they can
use, so we have to use some of the APIs the official web client uses
(which can't be used by OAuth tokens) instead (mainly to initialize the
workspace with client.userBoot and client.counts, and to connect to the
websocket).
This also has the benefit of being more performant, as the API methods
the web client uses are more suited for creating a client than the
official API methods.
I think which API methods are restricted may be configured by the
workspace admins, so it may not be the same for different workspaces,
but for me it seems to be at least rtm.connect, users.conversations,
conversations.list and conversations.members, so these are the ones I've
changed to be conditional on the token type.
|
| |
|
| |
|
| |
|
| |
|
| |
|
| |
|
| |
|
| |
|
| |
|
|
|
|
|
|
| |
Pyright doesn't allow me to set subscribed/last_read in _message_json
since some of the _message_json types don't have them, so had to use
separate attributes.
|
| |
|
| |
|
| |
|
| |
|
| |
|
| |
|
| |
|
| |
|
| |
|
| |
|
| |
|
| |
|
| |
|
| |
|
|
|
|
|
|
| |
This does not support globally showing typing from direct messages, like
the old wee-slack did, because that's not supported by WeeChats typing
plugin. It only shows typing in the current buffer.
|
| |
|
| |
|
| |
|
| |
|
| |
|
| |
|
| |
|
| |
|
| |
|
|
|
|
|
|
|
| |
This uses Slacks edgeapi which only works for session tokens, but has
the benefit of being able to complete nicks without all users being
loaded. So need to add some completion for the loaded users for when
using OAuth tokens as well.
|