| Commit message (Collapse) | Author | Age | Files | Lines |
|
|
|
|
| |
This is only required for WeeChat < 1.5, and we require >= 2.2, so
there's no point in keeping this.
|
|
|
|
|
|
|
| |
After moving the token in Slack API requests from a query string param
to an Authorization header in commit 2185a58 we require WeeChat >= 2.2
because that was the version which added support for setting HTTP
headers.
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
We used the response from rtm.start to find which IMs and MPIMs to open,
but after moving away from that we didn't have the information from the
response from conversations.list, so commit 962bbc5 changed to only open
unread ones.
However, it turns out that conversations.info has the information, and
we are already requesting that for each IM/MPIM to check if it's unread,
so we can use that to open the correct ones.
Fixes #875
|
|
|
|
|
|
|
|
| |
Old type MPIMs (has `is_group: true`) has `is_open`, but not
`unread_count_display` in the response from `conversations.list`, so
they were not marked as unread on start if background_load_all_history
was set to false because we have to request the history, but
`check_should_open` created the buffer, so it wasn't requested here.
|
|
|
|
|
|
|
|
|
|
| |
Apparently there are some bots which are not listed in users.list and
which sends messages where the only info about the sender is a bot_id.
To fix this properly we will have to look up the bot with bots.info when
we encounter an unknown bot_id, but for now just fall back to using the
id directly like we do with unknown users to make it possible to use
triggers and filters.
|
|
|
|
|
| |
I've been the maintainer of this script for several years now, and Ryan
isn't involved anymore, so it makes sense to update the script author.
|
|
|
|
|
| |
The script will use the new methods if the WeeChat version is new
enough, and the old deprecated methods if it's too old for the new ones.
|
| |
|
| |
|
| |
|
|
|
|
|
|
| |
When slack return a button message type and a url field is present we
should output the URL.
Fix: #811 and #810
|
|
|
|
|
| |
Limit should be used now, so it seems like count has been renamed to
limit.
|
|
|
|
|
|
| |
On one of my teams, all the MPIMs have is_shared set to true and the
name is not set correctly if they are created as SlackSharedChannel
instead of SlackMPDMChannel.
|
|
|
|
|
| |
On one of my Slack teams, none of the MPIMs are included in
conversations.list if types include public_channel for some reason.
|
| |
|
| |
|
|
|
|
|
|
| |
If you are a guest on a team, requesting the user groups may fail with
this error. Instead of failing the whole startup, report an error and
continue.
|
|
|
|
|
| |
According to one comment it was necessary for them to include this
cookie as well.
|
| |
|
|
|
|
|
|
|
|
| |
Instead open only unread DMs and MPDMs. Unfortunately it doesn't seem to
be possible to know which DMs or MPDMs are open from the last run or in
the official client (without using internal APIs). We could explore
alternatives like opening the ones with recent messages, or storing
which are open, but this will have to do for now.
|
|
|
|
|
|
| |
This sets last_read on the channel, though we have no guarantee that we
get the result from info before history, and if we get history first,
the read messages will still be marked as unread.
|
| |
|
| |
|
|
|
|
|
|
| |
If you use an xoxc token, the conversations.list endpoint returns an
empty list for members of mpdms that have is_group set to true, which
made this fail.
|
|
|
|
|
|
|
|
|
|
|
|
| |
This is necessary for xoxc tokens. The cookie is specified after the
token with a colon separating them, i.e.
"token1,token2:cookiefor2,token3".
This makes slack_api_token even more inconvenient, but it will have to
do until we rewrite the config to have a section for each team, like the
irc config has.
Fixes #844
|
|
|
|
| |
This is a necessary step for #844
|
|
|
|
|
| |
I don't think these are necessary. I've not experienced any errors
after removing them.
|
|
|
|
|
|
|
|
|
|
|
| |
rtm.start is deprecated and will stop working on September 20, 2022.
This patch replaces it with several other API endpoints to get the info
we need.
The handle_rtmstart method is kept for the test setup to work, but this
setup should also be replaced with the new API endpoints.
This is a necessary step for #699 and #844
|
| |
|
| |
|
| |
|
|
|
|
|
| |
On connection check closed IM channels for unread messages and if any
are found open a buffer. This ensures that new direct messages are not
missed.
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
The Slack API has changed message_changed events from having a unique ts
to having the ts of the message that's changed, which means that the
condition in the start of process_message to not process duplicate
messages (see commit 68966be for info about that) made it skip the
message_changed events.
To fix this, only do this duplication check for messages without a
subtype (i.e. new normal messages). This condition is becoming a bit
convoluted, so it might be better to do this duplication check another
way, but this will have to do for now to get the issue fixed.
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
| |
On Python 2, weechat.string_remove_color doesn't work for Unicode
strings containing non-ASCII characters. The string must be converted
to bytes using encode_to_utf8.
Furthermore, the length of a non-ASCII string (either in bytes or
codepoints) isn't the same as the width of the string on screen. To
accurately calculate the width, when the string might contain
combining or double-width characters, use weechat.strlen_screen.
Co-authored-by: Benjamin Moody <benjaminmoody@gmail.com>
|
|
|
|
|
|
|
|
|
|
| |
I continuously received this error:
```
AttributeError: 'NoneType' object has no attribute 'token'
```
Because tokens list was `['', '']`. And wee-chat tried initiate connections without tokens.
This small change fix this error.
|
| |
|
|
|
|
| |
This comma broke compatibility with Python 2.7, so remove it.
|
|
|
|
|
|
| |
When `weechat.look.prefix_align` is set to `none`, lines after the first
in a message would not align with the first. Use the same number of
spaces as the prefix for those lines, so they align with the first.
|
| |
|
| |
|
|
|
|
|
|
|
|
|
|
|
| |
For some reason, some MPIMs are listed in the channel list of the
response from rtm.start, with is_mpim set to true, instead of in the
mpims list. These incorrectly appeared as private channels instead of
MPIMs in wee-slack.
These entries do not contain a members list, so we have to call
conversations.members and set the name after receiving the response from
that.
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
| |
Apparently, the API now sends an mpim_joined event when an MPIM is
created instead of a group_joined event, even if we don't set mpim_aware
to true.
Instead of just handling mpim_joined in addition to group_joined (which
could cause issues if both are called for MPIMs, though I haven't
experienced that), it's better to properly support mpim_aware.
Fixes #825, fixes #833
|
|
|
|
| |
Fixes #836
|
|
|
|
| |
E203 should be ignored when using black according to their docs.
|
| |
|
| |
|
|
|
|
|
|
|
|
|
| |
It turns out that some channels in rtm.start include a member list with
a few users, but not all. Therefore, I don't know how we can know if the
list is complete or not, so we have to call conversations.members for
all channels.
Fixes #829
|
|
|
|
|
|
|
|
|
|
| |
I'm not sure when members for a channel is included in rtm.start, but
it seems like shared and private channels doesn't include the field at
all, while some other channels have started to only include the user.
Therefore, call conversations.members if a channel doesn't have any
members or if the only member is the user.
Hopefully this fixes #829
|