Skip to content

Add rooms_media_confirm and improve rooms_media input flexibility#382

Merged
jadolg merged 3 commits intojadolg:masterfrom
ErfanBahramali:master
Apr 22, 2026
Merged

Add rooms_media_confirm and improve rooms_media input flexibility#382
jadolg merged 3 commits intojadolg:masterfrom
ErfanBahramali:master

Conversation

@ErfanBahramali
Copy link
Copy Markdown
Contributor

This change was made because the Rocket.Chat media upload API uses a two-step process: first upload and then confirm. Without rooms_media_confirm, the file gets uploaded, but the message finalization is not completed.

https://developer.rocket.chat/apidocs/check-uploaded-file

At the same time, rooms_media was updated to accept not only file paths but also pre-built tuple/list inputs, enabling direct sending of bytes and streams. This improves client flexibility, removes the need for temporary files, and provides better compatibility with real-world scenarios.

Another important benefit is that backward compatibility is preserved, and the changes are covered with tests to ensure no regression issues occur.

rooms_media now accepts a tuple/list file payload directly or a file path string as before.
@jadolg
Copy link
Copy Markdown
Owner

jadolg commented Apr 20, 2026

Hey @ErfanBahramali,
Thank you for your contribution.
Mind formatting the code using black?

Comment thread rocketchat_API/APISections/rooms.py Outdated
@sonarqubecloud
Copy link
Copy Markdown

@jadolg jadolg merged commit 940073e into jadolg:master Apr 22, 2026
42 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