Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add chat.getThreadMessages #233

Merged
merged 1 commit into from
Nov 4, 2023
Merged

Conversation

julowe
Copy link
Contributor

@julowe julowe commented Nov 1, 2023

Adds the Get Thread Messages call. I followed what looked to be the pattern of expanding parameters into underscores between lowercase words (e.g. tmid=thread_msg_id)

Note: The docs say the tlm query parameter is required, but it is not actually supported. I have a pull request in to rocketchat developer docs to correct, RocketChat/developer-docs#196

I made a pretty simple test, at least to start: it posts one message and two replies, then gets thread messages. Checks count of messages and their text. And the success field. I tested this with the docker setup in this repo - it was very easy, thank you!

Is that sufficient, or do you usually like to check more of the message details or have other handling in there?

Adds the Get Thread Messages call, https://developer.rocket.chat/reference/api/rest-api/endpoints/messaging/chat-endpoints/getthreadmessage.
The docs say the tlm query param is required, but it is not actually supported.
Pull request in to rocketchat developer docs to correct, RocketChat/developer-docs#196

Test: Post one message and two replies, then get thread messages. Check count of messages and their text.
Copy link

sonarcloud bot commented Nov 1, 2023

Kudos, SonarCloud Quality Gate passed!    Quality Gate passed

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 0 Code Smells

No Coverage information No Coverage information
0.0% 0.0% Duplication

@jadolg jadolg self-requested a review November 1, 2023 07:40
@julowe
Copy link
Contributor Author

julowe commented Nov 3, 2023

Hi I see this failed on a test that already existed (tests/test_chat.py::test_chat_get_message_read_receipts) with licensing problems ('error': 'This is an enterprise feature [error-action-not-allowed]', 'errorType': 'error-action-not-allowed').

This happened when I tested it locally but I saw merged PR #210 that added an enterprise key, so I assumed (hoped?) it would work in the github workflow. Did I do something to screw this up/Is there anything I can do here, or is this simply just a licensing issue that needs to get sorted with RocketChat?

@jadolg
Copy link
Owner

jadolg commented Nov 4, 2023

Unfortunately, I have yet to figure out how to use the secrets on PRs made from forks on github actions. Changes LGTM.

@jadolg jadolg merged commit 794d4a8 into jadolg:master Nov 4, 2023
8 of 12 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants