-
Notifications
You must be signed in to change notification settings - Fork 10.4k
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
[FIX] added API endpoint for im.history.others, as advertised on rocket.chat REST API settings #13286
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@BlackFenix2 can you add some tests for this endpoint?
@MarcosSpessatto Sorry if this is a stupid question, where is the tests for the v1/im.history endpoint? |
Sorry, i found the test area, its under https://github.com/RocketChat/Rocket.Chat/blob/5b3ca5da176c3df07ca1d2a70851f936ee9a479b/tests/end-to-end/api/04-direct-message.js ill add a test for this endpoint. |
I added a test for the API endpoint im.history.others. i basically copied the test for im.history, it should work under the same basic principle. Let me know if you need anything else. |
I see the Tests didn't like my PR :(. ill look over the endpoint and update the current branch. |
@MarcosSpessatto i might have a bit of an issue with this PR, the value for RocketChat.settings.get('API_Enable_Direct_Message_History_EndPoint') is true inside the 'im.messages.others endpoint but is false on the "im.history.others" endpoint. the tests for both are set up exactly the same so i am not sure why this value is different. |
@BlackFenix2 sorry for the long delay, I'll take a look on this now. |
@BlackFenix2 it seems like the endpoint you are creating, already exists, but with another name, see here. Of course it is with the wrong name, based on what the setting in the admin panel says. Maybe we can only change the name of the endpoint in the description of the setting, or maybe we can depreciate the old endpoint( |
Wait a sec, I thought the endpoint 'im.messages.others' was the current endpoint. Are we looking to depreciate 'im.history.others'? I was trying to find a way to search messages within a specific date/time range. Would I be better off coding against im.messages.others? I tried to use query expressions to get messages within a date/time range but I always got null. |
No, I told that we could depreciated
Yes, I think you can get the messages with this endpoint.
I don't know what server version you are running, because recently ( |
oh, the query examples for date/time weren't listed last i checked. i see my problem, i was using rather than since the intention of the PR was to sort messages by date-time, ill close out my PR since the functionality is redundant. |
This pull request adds an API endpoint for im.history.others as advertised on the rocket.chat REST API settings.
this was added to allow latest and oldest datetime parameters to be used for direct messages the user is not a part of.