aboutsummaryrefslogtreecommitdiffstats
path: root/_pytest
Commit message (Collapse)AuthorAgeFilesLines
* 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
|
* Support unfurling date refs by using the fallbackTrygve Aaberge2020-02-201-0/+4
|
* Only use fallback for refs if ref is not foundTrygve Aaberge2020-02-201-7/+27
| | | | | | Fallbacks in messages are not changed when channels/users/groups are renamed, so they shouldn't be used unless the ref can't be found. Links are not refs we look up, so they are still treated the same way.
* Remove ignore_alt_text parameter from unfurl_refsTrygve Aaberge2020-02-201-4/+2
| | | | | This is only used in tests and in render_topic, and I don't see why render_topic shouldn't follow the global config that is set.
* Remove auto_link_display parameter from unfurl_refsTrygve Aaberge2020-02-201-2/+2
| | | | | This is only used in tests, and there we can override the config instead.
* Use max of submessages and replies for number_of_repliesTrygve Aaberge2019-10-031-0/+37
| | | | | | | | | When new replies come in over websocket, we don't update the message_json of the parent message with the new replies, we just append the new message to the submessages list. Therefore, the number_of_replies function has to check both of these and take the max. Fixes #722
* Add basic support for private channels converted from publicTrygve Aaberge2019-10-011-0/+44
| | | | | | | | | | | | | | | | | | This is for channels which initially were public, but then are changed to private. They look the same as groups (channels initially created as private) in the official clients, but can only be used with the conversations api. They are listed in the channels list of rtm.start with is_private set to true. There are some remaining issues, which are documented in the readme. I'm not sure if we can support read sync and showing unread on load without changes from Slack to the API. Showing thread messages in the channel is possible to fix, but we would have to send requests to load the thread history for all the messages in the history that has replies. Fixes most of #644