aboutsummaryrefslogtreecommitdiffstats
Commit message (Collapse)AuthorAgeFilesLines
* Skip over empty cookies.buildMatěj Cepl2024-06-011-1/+1
|
* Add localvars for user status in IM buffersHEADnightlymasterTrygve Aaberge2024-04-181-0/+10
| | | | | | | This can be used to e.g. show the user status emoji in the buflist like this: /set buflist.format.name "${name}${if:${buffer.local_variables.user_status_emoji}? ${buffer.local_variables.user_status_emoji}:}"
* Update user info for open IM conversations when using session tokensTrygve Aaberge2024-04-183-6/+31
| | | | | | | | | | | | | | | | | | | | | | | 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.
* v2: Fix IM title not being updated on user status changeTrygve Aaberge2024-04-181-6/+14
| | | | | | | | | After we started fetching IM info in check_should_open, updating the IM title when the user changes their status stopped working because when info is fetched the members field is updated and the info included your own user in the members, while the update status code expected only the other user to be present in members. To fix this, make sure we always include both users in members and check for that.
* Check if nick is in _nicklist before removing itTrygve Aaberge2024-04-181-2/+3
| | | | | | | If we get a channel_leave message from a user that hasn't spoken recently in the channel and hasn't been loaded in the nicklist (because the channel has too many members to load all of them into the nicklist), it isn't in _nicklist so trying to pop it from there would fail.
* Update WeeChat version requirement in readmeTrygve Aaberge2024-04-031-1/+1
|
* Retry fetching users with fewer users on errorsTrygve Aaberge2024-03-292-5/+34
| | | | | | | | | | | | | | Apparently it varies how many users can be fetched in one request with the users.info method. I have had successful requests with 4096 users, while some people have reported getting HTTP 500 when fetching 1000 users and one person got an error response with error `too_many_users` when fetching 500 users. So when we get either of those errors, reduce the number of users we fetch in one request and try again until it works or the number of users has been reduced to 1. Fixes #924
* Fix wrong option name in an option descriptionTrygve Aaberge2024-03-291-1/+1
|
* Close LevelDB connection in extract_token_from_browser.pyTrygve Aaberge2024-03-291-0/+2
| | | | | | This fixes an issue where the temporary directory couldn't be deleted after use because the connection to the LevelDB file in it was still open.
* Replace use of history_pending with is_loadingTrygve Aaberge2024-03-293-12/+4
| | | | | | | | | history_pending had a problem with being stuck as True if a crash occurred. Additionally, only is_loading is shown in the input bar item, so if only history_pending is True for some reason (which shouldn't happen), it's not shown. I don't think I need a separate variable, so instead of fixing history_pending, just use is_loading which doesn't have these problems.
* Show separate text in input bar item when connectingTrygve Aaberge2024-03-291-1/+2
|
* Add connecting info to list workspaces commandTrygve Aaberge2024-03-291-0/+8
|
* Add number of channels/pvs to list workspaces commandTrygve Aaberge2024-03-291-1/+9
|
* Fix parent message not being included in SlackThread.messagesTrygve Aaberge2024-03-291-1/+20
|
* Add missing super call in SlackConversationMessageHashesTrygve Aaberge2024-03-291-0/+1
|
* Use enterprise id in edgeapi path if it existsTrygve Aaberge2024-03-292-1/+3
| | | | | | | 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.
* Don't unnecessarily resolve nick an extra time for normal messagesTrygve Aaberge2024-03-291-2/+1
|
* Look for message hash before index in ts_from_hash_or_indexTrygve Aaberge2024-02-271-1/+4
| | | | | | | Otherwise a hash that's all digits can't be used without the $ prefix. Message hashes are always at least three characters, so even though this prevents using indexes that collides with a hash, I don't think it's a problem as such large indexes doesn't seem practical anyways.
* Print error message from reply command if id/index isn't foundTrygve Aaberge2024-02-271-0/+3
|
* Add buffer localvar slack_mutedTrygve Aaberge2024-02-221-0/+1
| | | | This is 1 if the conversation is muted and 0 if it's not.
* Support date in rich text elementsTrygve Aaberge2024-02-212-0/+9
|
* Configure which files pyright runs on in pyproject.tomlTrygve Aaberge2024-02-212-1/+2
| | | | | | | | | | Move the configuration of which files pyright should run on from the CI command to pyproject.toml. Pyright is only configured to run on the main files for v3. So don't run it on the files for the old version of wee-slack, and don't run it on the util scripts. Ideally we would run it on the util scripts, but they give a lot of errors now, so we'd have to fix that first.
* Configure ruff files in pyproject.toml and run on most filesTrygve Aaberge2024-02-213-2/+3
| | | | | | | | | | | Move the configuration of which files ruff check should run on from the CI command to pyproject.toml and change it to run on most files. Exclude these files: - typings/weechat.pyi because it's copied from the WeeChat repo and I don't want errors from that. - wee_slack.py and _pytest because it's the old version, so there's no point spending time fixing lint errors there.
* Specify minimum python version for tools in pyproject.tomlTrygve Aaberge2024-02-214-6/+10
|
* Upgrade to the latest version of ruffTrygve Aaberge2024-02-212-24/+25
|
* Format built file after building if ruff is availableTrygve Aaberge2024-02-202-0/+13
|
* Upgrade all dependenciesTrygve Aaberge2024-02-206-38/+35
|
* Create nightly releases from masterTrygve Aaberge2024-02-201-0/+8
| | | | | This will update the nightly release with the latest build every time master is pushed to.
* Replace a str.format with an f-stringTrygve Aaberge2024-02-201-1/+1
|
* Add support for focus events (mouse/cursor mode)Trygve Aaberge2024-02-204-17/+114
|
* Add command `/slack linkarchive`Trygve Aaberge2024-02-202-0/+61
|
* Make api accessible from SlackBufferTrygve Aaberge2024-02-205-22/+22
|
* Move completion code to a separate fileTrygve Aaberge2024-02-206-360/+384
|
* Only reset foreground color in with_color functionTrygve Aaberge2024-02-196-24/+24
| | | | | | | The with_color helper is usually used to set only the foreground color (currently all usages), so by only reseting the foreground we keep any existing background color. This fixes the default background on the current buffer in the buflist for muted conversations.
* Add command `/slack mute`Trygve Aaberge2024-02-192-1/+39
|
* Refactor command functions to be asyncTrygve Aaberge2024-02-191-39/+26
|
* Support async command functionsTrygve Aaberge2024-02-191-6/+15
|
* Move set user profile functionsTrygve Aaberge2024-02-191-14/+14
|
* Don't require any arguments for `/slack join`Trygve Aaberge2024-02-181-1/+1
| | | | It will use the current buffer if no arguments are given.
* Fetch max 500 users in each requestTrygve Aaberge2024-02-181-1/+1
| | | | | Some users have gotten HTTP 500 from the API when trying to request 1000 users in one request.
* Don't print the same message multiple timesTrygve Aaberge2024-02-183-14/+32
| | | | | | | | | | When joining a channel you seem to get the last messages for it over the WebSocket. When joining a channel you've parted and you still have the buffer for open, those messages will already be in the buffer, so we have to make sure their not printed multiple times. I've also been told that messages can appear multiple times in the reconnect brach, which this should fix too.
* Add command `/slack part`Trygve Aaberge2024-02-184-12/+66
|
* Add an option to leave the channel when a buffer is closedTrygve Aaberge2024-02-184-1/+22
|
* Don't call conversations.leave when closed from serverTrygve Aaberge2024-02-183-12/+27
|
* Add command `/slack join`Trygve Aaberge2024-02-183-0/+79
| | | | | For now this only supports known channels, which currently typically means they have to be referenced in a channel with history loaded.
* Include all workspace nicks in nick completionTrygve Aaberge2024-02-181-5/+23
|
* Add command `/slack query` to open DM/MPDM channelsTrygve Aaberge2024-02-183-9/+96
| | | | | | 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.
* Don't run buffer close callback when script is unloadingTrygve Aaberge2024-02-184-0/+6
| | | | | We don't want to call the API to close im/mpim conversations when the script is unloading.
* Unset _connect_task after cancelling itTrygve Aaberge2024-02-181-0/+1
| | | | | | | 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.
* Correctly show reactions with more than 50 users in v3.0.0Trygve Aaberge2024-02-185-10/+150
| | | | | | | | | | | If a reaction has more than 50 users, the list of users will be cropped to just 50 users. This made the counts wrong since we used the number of users rather than the count property. Fix it by using the count property instead and adding "and others" to the list of users if show_reaction_nicks is enabled (the same as the Slack client shows when you hover over the reaction). This is the same fix as in commit 6b388cd9, but for version 3.0.0.