aboutsummaryrefslogtreecommitdiffstats
path: root/wee_slack.py
Commit message (Collapse)AuthorAgeFilesLines
* Format all files with ruffTrygve Aaberge2024-02-181-1/+1
|
* Release v2.10.2v2.10.2Trygve Aaberge2024-02-181-1/+1
|
* Make /thread work on thread repliesTrygve Aaberge2023-10-291-0/+3
| | | | | | | Previously running /thread with a message id for a thread reply (or pressing T on the message in cursor mode, which is the same thing) would open a buffer with just the thread reply. Now the thread buffer for the thread the message is in is opened instead.
* Correctly show reactions with more than 50 usersTrygve Aaberge2023-10-251-4/+9
| | | | | | | | | 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).
* Support color rich text elementsTrygve Aaberge2023-10-251-0/+4
| | | | Fixes #912
* Properly fix rendering of < and >Trygve Aaberge2023-10-181-28/+20
| | | | | | | | I tried to do a fix for this in commit 6478c141, but it only fixed normal text, not e.g. code blocks and attachments. With this I think it should be correct everywhere. Fixes #908
* Handle millisecond-level timestamps in attachments (#905)Steinar H. Gunderson2023-10-061-0/+5
| | | | | | | | | | | | | | The Slack documentation claims that the “ts” flag on attachments is “An integer Unix timestamp”. However, evidently it can be in milliseconds (i.e., a timestamp multiplied by 1000), causing out-of-range exceptions when trying to feed them to date.fromtimestamp(). This can cause all messages after such attachments to just vanish, as if they were never there, as parsing stops. Accept both; as a heuristic, the Slack web interface seems to use 100000000000 as a threshold, so we do the same and divide by 1000 if so. Co-authored-by: Steinar H. Gunderson <steinar+git@gunderson.no>
* Mark conversation/thread as read when `/buffer set unread` is runTrygve Aaberge2023-10-011-0/+1
| | | | | It already marks it as read when `/input set_unread_current_buffer` is run, but this command was replaced with `/buffer set unread` in WeeChat 3.8.
* Only open subscribed threads with auto_open_threadsTrygve Aaberge2023-10-011-1/+1
| | | | | | | | | Only subscribed threads can be marked as read. This means that if we open other threads, they will be opened every time you reload wee-slack which is impractical and annoying. Previously, any thread with a highlight (in WeeChat, not necessarily a Slack highlight) was opened. Fixes #803, fixes #830
* Fix rendering of text styles for certain messagesTrygve Aaberge2023-09-291-16/+10
| | | | | | This fixes a regression in commit 74da303 which caused certain messages to include the bold/italic/strikethrough characters (but not the color attributes) even though the style should not be active.
* Release v2.10.1v2.10.1Trygve Aaberge2023-09-221-1/+1
|
* Ignore some websocket messages for unknown channelsTrygve Aaberge2023-09-221-2/+16
|
* Show unread join messages for your own user in hotlistTrygve Aaberge2023-09-221-2/+2
| | | | | | | When you're invited to a new channel, it's useful that it shows up in the hotlist so you notice it. Previously it would not do that until a message was posted to the channel after you joined. Now the join message itself will also be added to the hotlist.
* Fix being invited to a private channel not workingTrygve Aaberge2023-09-221-1/+8
| | | | | | If someone invited you to a private channel, it wouldn't work because the channel would be unknown to wee-slack and the join function didn't create a new channel instance.
* Fix links/refs not being processed in normal blocksTrygve Aaberge2023-09-221-11/+22
| | | | | | | In commit 6478c14 the block rendering was changed to escape `<` and `>`. However, this caused links and refs in normal (not rich_text) blocks to be shown as refs instead of rendered correctly. The correct behavior is to not process refs in rich_text blocks, but do it in normal blocks.
* Make render_emoji_as_string = "both" work with rich_text blocks (#902)melanie witt2023-09-221-1/+4
| | | | | | | | | | | | | | | | | | | Commit 74da30342e8d328fc085d2158e37afda3b908f2c added support for using rich_text blocks to format messages. With this change, the use of replace_string_with_emoji() for text type "emoji" can result in running the replacement twice as replace_string_with_emoji() is also called as one of the last steps in SlackMessage.render(). This works fine in the default case when render_emoji_as_string = "", however render_emoji_as_string = "both" results in output like: 😄 (😄 (:smile:)) instead of the intended: 😄 (:smile:) This excludes blocks rendered earlier in the method from the second call of replace_string_with_emoji().
* Include cookie when making the websocket connectionTrygve Aaberge2023-09-191-1/+6
| | | | Slack began to require this for xoxc tokens today.
* Print error message when running /reply without any argumentsTrygve Aaberge2023-09-161-0/+7
| | | | Fixes #900
* Fix < and > being removed in messagesTrygve Aaberge2023-09-161-2/+6
| | | | | | | This fixes a regression in commit 74da303 which caused < and > to be removed from messages. Escaping them in unfurl_block_element so they can be unescaped later isn't the nicest fix, but it's the easiest so I'll do it this way until this is rewritten in the new version.
* Fix rendering of huddlesTrygve Aaberge2023-08-251-7/+4
| | | | | After using blocks to render messages in commit 74da303, huddle messages got the text twice since they already used blocks.
* Release v2.10.0v2.10.0Trygve Aaberge2023-08-241-1/+1
|
* Revert "Use prefix_nick_<color> tag for messages in WeeChat 4.0.0"Trygve Aaberge2023-08-241-23/+1
| | | | | | | | | This caused some nicks and bots to be colored as offline if the option weechat.look.color_nick_offline was enabled because not all nicks and bots are included in the nicklist. Revert this for now, and see if we can bring it back later. This reverts commit 7310fe88d6fbf94d1bda7c10f24fa9e396d80311.
* Fix regresion with option unfurl_auto_link_displayTrygve Aaberge2023-08-241-11/+16
| | | | | This option wasn't accounted for when the message rendering was changed to using blocks in commit 74da303.
* Rename text variable to elementTrygve Aaberge2023-08-241-27/+27
|
* Render adjacent text styles correctlyTrygve Aaberge2023-08-231-27/+50
| | | | Fixes #550 properly.
* Fix display of message unfurl originTrygve Aaberge2023-08-191-1/+9
| | | | | | | When a Slack message is linked and unfurled (previewed) the footer previously contained the channel name for the message, but now it just says "Slack Conversation" or "Thread in Slack Conversation" instead. This brings back display of the channel name.
* Fix regression with messages not being shown as deletedTrygve Aaberge2023-08-161-9/+7
| | | | | | | | The commit 74da303 introduced a regression with messages not being shown as deleted anymore because deleting only changed the text field, and that's not being used anymore with that commit. Fixes #897
* Fix flake8 errors after new flake8 releaseTrygve Aaberge2023-07-301-7/+9
| | | | | For some reason these errors were not reported by flake8 before version 6.1.0.
* feat: Filter channel list based on regular expression (#896)Bryan Mason2023-07-301-3/+10
| | | | | It can be difficult to find a specific channel if there are thousands of them in your slack workspace. This enhancement allows you to filter the channels based on a regular expression.
* Support and use rich_text blocks for message contentTrygve Aaberge2023-07-071-10/+150
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | Instead of just using the text field of a message, use the rich_text blocks to format the message. The main reason for doing this was that messages that include images suddenly started just having "This message contains interactive elements." in the text field. There are some other benefits as well: - It fixes some bugs with multiple formatting styles not being applied correctly. - It fixes links in code blocks not being rendered verbatim (but with text and url, like outside code blocks). - It fixes code blocks sometimes having newlines after/before ``` and sometimes not, depending on how the message was sent. It looks like messages with images are now back to having the proper text in the text field (for new messages), so this change isn't necessary to fix that after all (except for for messages in the history sent in the last couple of days), but since it fixes other issues as well, it's best to keep it. There is one bug left when inline code blocks contains links. Then there will be ` characters before and after the link, which shouldn't be there, but I'll leave fixing this for later. Fixes #354, fixes #550, fixes #893
* Support printing URLs without a title/alt textTrygve Aaberge2023-07-061-5/+9
| | | | Not sure if this ever occurs, but better safe than sorry.
* Support /msg * in thread buffersTrygve Aaberge2023-06-231-7/+9
| | | | Fixes #888
* Add info to get contents of a messageTrygve Aaberge2023-06-231-0/+19
| | | | Fixes #889
* Note that slack_api_token is evaluated in descriptionTrygve Aaberge2023-06-231-1/+2
|
* Automatically enable emoji/usergroups completionTrygve Aaberge2023-06-231-0/+15
| | | | | | Automatically set completion_default_template on wee-slack buffers, so emojis and usergroups can be tab completed without having to set weechat.completion.default_template manually.
* Return from modify_buffer_line if the line isn't foundTrygve Aaberge2023-06-231-0/+3
| | | | | | | | | If the line isn't found, line_pointer becomes an empty string which will crash WeeChat when it's used with hdata_update. This happened when the history for a channel that contained a reply also posted to the channel was loaded, because in that case wee-slack tries to modify the parent message before the channel history is printed, so it couldn't find the line.
* Use prefix_nick_<color> tag for messages in WeeChat 4.0.0Trygve Aaberge2023-06-031-1/+23
| | | | | | | | | | Since WeeChat now has multiline support, the problems with using prefix_nick_<color> (mainly that it isn't possible to distinguish between a multiline message and multiple messages when weechat.look.prefix_same_nick is set) isn't present anymore, so we can use this tag to properly mark lines as chat messages from a nick. This also means that we don't have to use prefix_same_nick or nick_prefix/suffix ourselves anymore.
* Only modify a single chat line for one message in WeeChat 4.0.0Trygve Aaberge2023-06-031-0/+5
| | | | | | | | | Since WeeChat now has multiline support, the whole message is in one chat line. This means that we don't need to look for all the lines belonging to a message and modify them, we can just modify the line for the message directly. This has the benefit of making it possible to increase and decrease the number of lines for a message, rather than having to join extra lines or get blank lines.
* Support multiline rendering in WeeChat 4.0.0Trygve Aaberge2023-06-031-4/+5
| | | | | | Don't insert a prefix at the start of each line of a message so it renders normally in WeeChat 4.0.0 which supports chat lines with multiple lines.
* Include a space between nicks in reaction stringTrygve Aaberge2023-05-301-1/+1
| | | | | | | | | Without spaces, WeeChat will consider all the nicks as one word, which means that rather than wrapping between nicks, it will fill the whole line and wrap in the middle of nicks. Additionally, if you have disabled weechat.look.align_multiline_words it will start from the beginning of the line when wrapping, rather than after the prefix, which doesn't look nice.
* Fix some text formattingTrygve Aaberge2023-03-071-2/+2
| | | | | Remove a space before a colon and add a comma after a sentence starting with if.
* Format with new black versionTrygve Aaberge2023-03-071-7/+1
|
* feat(huddle): Display link to join huddle when started (#885)Romain THERRAT2023-03-071-0/+30
|
* Capitalize WeeChat correctly in the docsTrygve Aaberge2023-01-121-21/+21
|
* Add missing space in auto_open_threads option descriptionTrygve Aaberge2023-01-121-2/+2
|
* Release v2.9.1v2.9.1Trygve Aaberge2022-10-301-1/+1
|
* Show useful link for Slack postsTrygve Aaberge2022-10-301-6/+11
| | | | | | | | | | | | | The url_private link for Slack posts just downloads a json of the post, which isn't very useful to click on. The permalink goes to the web view for a post, which is what we want. The web client adds origin_team and origin_channel, which makes the post page show info about where the post is shared, so add that here as well. We still want to use url_private for images etc., not permalink there as well, because that links to the Slack client with the image shown in the sidebar, which is much more inconvenient than just getting the image directly.
* Fix link previews from apps not being recognizedTrygve Aaberge2022-10-291-1/+3
| | | | | | | | If a link preview was added by an app, like GitHub, instead of directly by Slack, it was not detected by wee-slack as a link preview, so it would be shown even if link_previews was set to false. Fixes #834
* Support receiving multiple header blocks in http responsesTrygve Aaberge2022-10-151-5/+5
| | | | | | | | | | | One user experiences receiving a "HTTP/1.1 200 Connection established" header block before a "HTTP/2 200" header block with the headers. I'm not sure why specifically this happens, but I know a similar response will happen if redirects are followed. This wasn't supported by the http_check_ratelimited function which splits the header from the body. It now splits out all the header blocks from the body and uses the status and headers from the last one.
* Evaluate value of weechat.look.buffer_time_formatTrygve Aaberge2022-10-091-2/+5
| | | | Fixes #871