| Commit message (Collapse) | Author | Age | Files | Lines |
|
|
|
|
|
|
| |
It seems like for enterprise workspaces you have to use the enterprise
id (if the token is a workspace level token,
`enterprise_id/workspace_id` can also be used, but isn't necessary),
while for non-enterprise workspaces the workspace id should be used.
|
| |
|
| |
|
| |
|
|
|
|
|
|
|
| |
If _connect_task remains set, the connect command won't allow you to
connect again because it thinks it's still connecting. This caused a
problem where if you disconnect while connecting (or after connecting
has crashed), it wasn't possible to connect again afterwards.
|
|
|
|
|
|
| |
This enforces us to check that buffer_pointer is set, so we don't
accidentally operate on the core buffer, which is what is done when
buffer_pointer is an empty string.
|
|
|
|
|
|
|
| |
The team id in the profile may be either the enterprise id or the
workspace id depending on the token used and the workspace the user
belongs to, so if the user has enterprise_user set, check the
enterprise_id too.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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.
|
|
|
|
|
| |
The cookies need to be encoded for the Slack API to accept them, so this
makes it work if the config is set with cookies that are not encoded.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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.
|
|
|
|
|
| |
This originally had to be returned here because it was an async
function, but now that it's a sync function this can be simplified.
|
| |
|
| |
|
| |
|
|
|
|
|
|
| |
This is perhaps a bit hacky, but it makes the type checker enforce that
we complete the async initialization of SlackConversation instead of
getting a runtime exception.
|
|
|
|
|
| |
This means a lot of methods don't have to be async. It's especially
useful for the next commit adding conversations completions.
|
| |
|
| |
|
| |
|
|
|
|
|
| |
Sometimes an IM/MPIM can have unread messages even when is_open is
false, so we have to check the history if there are any unread messages.
|
| |
|
| |
|
|
|
|
|
| |
We should create a server buffer for each workspace, but print to the
core buffer for now.
|
|
|
|
|
| |
This just logs that a message is unknown/unhandled. The contents of the
message will be printed on the line above.
|
| |
|
|
|
|
|
| |
I will implement filtering like the /server raw buffer, instead of
having multiple debug buffers.
|
| |
|
| |
|
| |
|
|
|
|
|
|
| |
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.
|
| |
|
| |
|
| |
|
| |
|
| |
|
|
|
|
| |
Slack began to require this for xoxc tokens today.
|
| |
|
| |
|
| |
|
| |
|
|
|
|
|
| |
Since this isn't available for OAuth tokens it's good to have an easy
way to see where it's used.
|
| |
|
| |
|
| |
|
| |
|
| |
|
| |
|
|
|
|
|
|
| |
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.
|
| |
|
| |
|