aboutsummaryrefslogtreecommitdiffstats
path: root/slack/slack_conversation.py
Commit message (Collapse)AuthorAgeFilesLines
* 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}:}"
* 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.
* Replace use of history_pending with is_loadingTrygve Aaberge2024-03-291-6/+3
| | | | | | | | | 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.
* Add missing super call in SlackConversationMessageHashesTrygve Aaberge2024-03-291-0/+1
|
* Add buffer localvar slack_mutedTrygve Aaberge2024-02-221-0/+1
| | | | This is 1 if the conversation is muted and 0 if it's not.
* Make api accessible from SlackBufferTrygve Aaberge2024-02-201-10/+10
|
* Don't print the same message multiple timesTrygve Aaberge2024-02-181-6/+9
| | | | | | | | | | 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-181-2/+23
|
* Add an option to leave the channel when a buffer is closedTrygve Aaberge2024-02-181-0/+2
|
* Don't call conversations.leave when closed from serverTrygve Aaberge2024-02-181-9/+11
|
* Don't run buffer close callback when script is unloadingTrygve Aaberge2024-02-181-0/+2
| | | | | We don't want to call the API to close im/mpim conversations when the script is unloading.
* Set buffer_pointer to None when buffer doesn't existTrygve Aaberge2024-02-181-13/+15
| | | | | | 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.
* Fix bots with multiple names only being added once to nicklistTrygve Aaberge2024-02-181-47/+21
| | | | | If a bot uses multiple nicks, we have to add all of them to the nicklist, so none of the nicks are shown as offline.
* Refactor nick handlingTrygve Aaberge2024-02-181-12/+12
|
* Handle messages without a user fieldTrygve Aaberge2024-02-181-4/+5
| | | | | | 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.
* Fix bugs with /slack reply commandTrygve Aaberge2024-02-181-3/+0
|
* Revert "Only use letters for message hashes"Trygve Aaberge2024-02-181-3/+1
| | | | | | | | | | I have display_thread_replies_in_channel and often search for the thread hash in a buffer to scroll between the different messages in the thread. After changing the hashes to use only letters, this has made the search match other messages much more often (matching words including the hash characters), which is inconvenient. This reverts commit 78bdd84765e53d4c33d963f0d3a8c54652b64ca9.
* Support API restricted workspacesTrygve Aaberge2024-02-181-16/+42
| | | | | | | | | | | | | | | | | | 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.
* Add completion of emoji namesTrygve Aaberge2024-02-181-1/+1
|
* Make SlackConversation constructor asyncTrygve Aaberge2024-02-181-27/+32
| | | | | | 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.
* Add completion for conversation namesTrygve Aaberge2024-02-181-0/+1
|
* Make conversations.name not asyncTrygve Aaberge2024-02-181-32/+53
| | | | | This means a lot of methods don't have to be async. It's especially useful for the next commit adding conversations completions.
* Support completing @nicks in current bufferTrygve Aaberge2024-02-181-1/+17
| | | | | | | | | | | Adds all known nicks in the current buffer with an @ prefix to the nicks completion. Disables the API search based nick completion for now until it's working properly. It currently doesn't have any context of which conversation/thread you are in, so you often get other nicks than the one you want to complete first. Additionally, it doesn't work with OAuth tokens.
* Close IM/MPIM and remove from open_conversations on buffer closeTrygve Aaberge2024-02-181-0/+11
|
* Show user status in DM buffer titleTrygve Aaberge2024-02-181-3/+13
|
* Show conversation topic in buffer titleTrygve Aaberge2024-02-181-2/+12
|
* Fetch all mentioned users at once in fill_historyTrygve Aaberge2024-02-181-5/+20
|
* Don't crash when message for hash is missingTrygve Aaberge2024-02-181-6/+7
| | | | | We can have a hash for a message we don't have if e.g. a broadcast reply is sent, and the parent is older than the history we have fetched.
* Handle unknown user/bot when adding to nicklistTrygve Aaberge2024-02-181-12/+24
|
* Support adding and removing reactionsTrygve Aaberge2024-02-181-1/+1
|
* Only use letters for message hashesTrygve Aaberge2024-02-181-1/+3
| | | | This way it doesn't collide with message indices.
* Support sending messagesTrygve Aaberge2024-02-181-0/+7
|
* Support muted conversations configTrygve Aaberge2024-02-181-0/+20
|
* Add some repr methods for useful debug printingTrygve Aaberge2024-02-181-0/+3
|
* Reload conversations on reconnectTrygve Aaberge2024-02-181-12/+71
|
* Add unread buffers to hotlist on connectTrygve Aaberge2024-02-181-0/+14
|
* Use notify_private tag in private buffersTrygve Aaberge2024-02-181-1/+1
|
* Mark as read when switching away from bufferTrygve Aaberge2024-02-181-0/+5
|
* Mark buffer as read when conversation/thread is markedTrygve Aaberge2024-02-181-0/+5
|
* Correctly tag unread messages from historyTrygve Aaberge2024-02-181-3/+7
| | | | | | Now notify tags are set based on last_read so both read and unread messages gets the correct tags irregardless if they come from history or websocket.
* Get all reaction users in one requestTrygve Aaberge2024-02-181-1/+11
|
* Support overriding display_reaction_nicks per bufferTrygve Aaberge2024-02-181-0/+8
|
* Prefix private conversations with &Trygve Aaberge2024-02-181-2/+4
|
* Open conversations in sorted order by nameTrygve Aaberge2024-02-181-3/+14
|
* Don't add to nicklist for imsTrygve Aaberge2024-02-181-2/+4
|
* If a message has a user, use that even though it's a bot_messageTrygve Aaberge2024-02-181-1/+5
| | | | | | | | | Messages from Slackbot apparently have both a user and a bot_id, and sometimes have the subtype bot_message, other times not. However, the bot_id is B01 which gives bot_not_found when trying to look it up. I see that the web client shows it with the user profile, and doesn't show the message as a bot message, so do that here as well to match it and avoid the invalid bot_id.
* Add/remove nicks from nicklist when messages are printedTrygve Aaberge2024-02-181-7/+43
| | | | | | This ensures that all nicks that have typed in the channel and still is in it are in the nicklist, so they are not colored as offline. It also removes nicks from the nicklist when they leave a channel.
* Support typing notices for thread buffersTrygve Aaberge2024-02-181-6/+35
|
* Fetch thread replies when receiving thread messageTrygve Aaberge2024-02-181-13/+28
| | | | | | This is done so we can know if we should include a message hash when completing thread hashes, and it also has the benefit of eliminating the loading time when opening thread buffers.
* Make sure thread prefix is rendered even though parent isn't fetchedTrygve Aaberge2024-02-181-1/+4
|