aboutsummaryrefslogtreecommitdiffstats
path: root/_pytest
Commit message (Collapse)AuthorAgeFilesLines
* Correctly show reactions with more than 50 usersTrygve Aaberge2023-10-251-0/+24
| | | | | | | | | 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/+15
| | | | Fixes #912
* Properly fix rendering of < and >Trygve Aaberge2023-10-182-22/+154
| | | | | | | | 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
* Make render_emoji_as_string = "both" work with rich_text blocks (#902)melanie witt2023-09-222-0/+102
| | | | | | | | | | | | | | | | | | | 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().
* Render adjacent text styles correctlyTrygve Aaberge2023-08-231-1/+110
| | | | Fixes #550 properly.
* Fix regression with messages not being shown as deletedTrygve Aaberge2023-08-161-1/+3
| | | | | | | | 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
* Split long line to satisfy flake8Trygve Aaberge2023-07-071-1/+4
|
* Support and use rich_text blocks for message contentTrygve Aaberge2023-07-071-0/+247
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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
* Show useful link for Slack postsTrygve Aaberge2022-10-301-4/+4
| | | | | | | | | | | | | 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.
* Support receiving multiple header blocks in http responsesTrygve Aaberge2022-10-151-0/+49
| | | | | | | | | | | 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.
* Add tests for url_encode_if_not_encodedTrygve Aaberge2022-10-051-0/+17
|
* Support retrying requests when ratelimitedTrygve Aaberge2022-09-181-1/+2
|
* Support specifying cookies in SlackRequestTrygve Aaberge2022-09-171-1/+0
| | | | This is a necessary step for #844
* Support starting wee-slack without using rtm.startTrygve Aaberge2022-09-171-2/+2
| | | | | | | | | | | 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
* Fix tests and formatting after last commitTrygve Aaberge2022-09-171-1/+1
|
* Fix formatting after black upgradeTrygve Aaberge2022-01-301-1/+0
|
* Support MPIMs in channel list of rtm.startTrygve Aaberge2021-05-112-1/+5
| | | | | | | | | | | 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.
* Support mpim_aware RTM APITrygve Aaberge2021-05-081-76/+78
| | | | | | | | | | | | 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
* Ignore failing flake rules instead of selecting only a fewTrygve Aaberge2021-04-132-3/+3
| | | | E203 should be ignored when using black according to their docs.
* Fix some flake8 errorsTrygve Aaberge2021-04-132-3/+2
|
* Some code cleanup from lgtm.com checksTrygve Aaberge2021-04-121-1/+1
|
* Fix test broken in the previous commitTrygve Aaberge2021-03-211-1/+1
|
* Format all python files with blackTrygve Aaberge2021-03-2019-842/+1110
|
* Add tests for link_previous option added in previous commitTrygve Aaberge2021-02-221-0/+31
|
* Print error message when sending message failsTrygve Aaberge2020-10-051-1/+1
| | | | Relates to #797
* Set time zone to UTC for unfurl test (#782)Tollef Fog Heen2020-07-041-0/+2
| | | Fixes #781
* Add some tests for formatted_nameTrygve Aaberge2020-06-201-0/+201
|
* Support colorizing attachment prefix or lineTrygve Aaberge2020-06-162-0/+25
| | | | | | | | | Thanks to @Informatic for the initial implementation of this in PR #426. I have seen that most attachment colors are without the leading #, but a few does include it, so we have to handle it. Fixes #424, closes #426
* Assert color values in testsTrygve Aaberge2020-06-144-5/+10
|
* Include a prefix character in front of attachmentsTrygve Aaberge2020-06-141-42/+43
|
* Store message ts in line tags instead of misusing date_printedTrygve Aaberge2020-06-071-0/+2
| | | | Fixes #514
* Use max_buffer_lines_number instead of hard codingTrygve Aaberge2020-06-041-0/+2
|
* Store ts -> hash mapping in hashed_messagesTrygve Aaberge2020-05-301-1/+1
| | | | | This is so we can show the hash for a thread message when the parent message isn't fetched.
* Load new history after reconnect immediately when ↡Trygve Aaberge2020-05-301-2/+2
| | | | | | background_load_all_history is set Fixes #629, fixes #715, closes #732
* Show a colon between attachment fields title and valueTrygve Aaberge2020-05-251-1/+1
|
* Support newlines in the /topic commandTrygve Aaberge2020-04-191-0/+7
| | | | Fixes #728
* Include files in attachmentsTrygve Aaberge2020-04-051-0/+16
|
* Include footer in attachmentsTrygve Aaberge2020-04-051-0/+35
|
* Don't add fallback if link exists in text_beforeTrygve Aaberge2020-04-051-0/+24
| | | | | | | | We should only use the fallback if we don't get any information out of the attachment. For links that exists in text_before, we have gotten the information from the attachment, but choose not to display it so we don't end up with duplicate links. Therefore, we shouldn't use the fallback in this case.
* Match attachment links against escaped text as wellTrygve Aaberge2020-04-051-0/+15
| | | | | The urls in the attachment fields can apparently come both escaped and unescaped.
* Don't print image_url if it's equal to from_urlTrygve Aaberge2020-04-051-0/+16
|
* Ignore ref fallback if it's equal to the refTrygve Aaberge2020-04-051-0/+5
| | | | | Prevents showing "http://some.url (http://some.url)" if the url has a fallback which is equal to the url.
* Add tests for unfurl_auto_link_display with mailtoTrygve Aaberge2020-04-051-0/+15
|
* Reply to parent message if trying to reply to thread messageTrygve Aaberge2020-03-181-0/+25
| | | | | | | | | | | | | | | Opening a thread on a thread message is not possible, so the logical thing to do if a user tries to reply to a thread message is to put the message in the same thread as the message that is replied to. Slack currently has a bug which causes thread messages to be converted to normal messages if you try to reply to them (that is, send a message with thread_ts set to the ts of the thread message), but the message you reply with will end up in the original thread. I filed an issue and they confirmed that it is a bug, and that you should not send messages with thread_ts set to the ts of a thread message. Fixes #751
* Pass team/channel to handle/process methods directlyTrygve Aaberge2020-02-231-2/+2
|
* Include team in SlackRequestTrygve Aaberge2020-02-231-1/+1
|
* Cleanup/simplify callback functionsTrygve Aaberge2020-02-238-10/+10
|
* Fix tests for python 2Trygve Aaberge2020-02-211-3/+4
|
* Make tests work when the timezone is set to UTCTrygve Aaberge2020-02-211-7/+11
| | | | | | | | | | Unfortunately, the date tests of the last commit only work in one time zone. This changes them to work in UTC. If your machine doesn't use UTC, you now have to run the tests like this: TZ=UTC pytest I'm not sure what the best way to avoid requiring this is.
* Support parsing date refsTrygve Aaberge2020-02-211-3/+31
|