daniel-sc / rocketchat-modern-client

Client SDK for https://rocket.chat employing reactive style.
MIT License
11 stars 11 forks source link

Add support for change/remove attachments in updateMessage. #5

Closed tuxmartin closed 5 years ago

tuxmartin commented 5 years ago

In my notificator app I send mesage with title and attachments and after user acknowledge it, I send update only with title without attachments.

coveralls commented 5 years ago

Coverage Status

Coverage increased (+0.03%) to 92.704% when pulling ff6ede14bec777d2f0aa039b42ac0b732addeea1 on tuxmartin:updateAttachments into f6ec5cda9cee354da9bd77e638d50431f9d27d8e on daniel-sc:master.

daniel-sc commented 5 years ago

Hi @tuxmartin

could you refactor this so that updateMessage(String msg, String _id) simply uses updateMessageWithAttachments(String msg, String _id, List<Attachment> attachments)? Then I'm happy to merge :)

tuxmartin commented 5 years ago

Hi @daniel-sc

is it ok now?

I don't have reference to existing list of attachments, so I need to create new empty list - but this delete all existing attachments. https://github.com/daniel-sc/rocketchat-modern-client/blob/d30986452681be641c1ac9ebf52604f54a19167b/src/main/java/com/github/daniel_sc/rocketchat/modern_client/RocketChatClient.java#L113 How can I do it better?

daniel-sc commented 5 years ago

Did you try using null instead of new ArrayList<..>?

tuxmartin commented 5 years ago

@daniel-sc thank you. It works.