prose-im / prose-core-client

Prose core XMPP client manager & protocols.
https://prose.org
Mozilla Public License 2.0
20 stars 3 forks source link

Ability to know if a message was edited #48

Closed valeriansaliou closed 7 months ago

valeriansaliou commented 8 months ago

In order to show an "(edited)" suffix in the message view (per-message), I'd need an "edited" boolean field in the Message structure.

Note: more of such "meta" fields might come in the future, eg. encrypted<boolean>, so it could be nested in a shared sub-structure of Message, eg. MessageMetas.

nesium commented 8 months ago

I've added a struct MessageMetadata with a flag isEdited and renamed metas to meta since metadata is uncountable and thus doesn't have a plural form 🤓

valeriansaliou commented 8 months ago

Thank you 🙏🏻 That was fast!

valeriansaliou commented 8 months ago

Re-opening since it doesn’t seem to set the flag to true if edited, I guess it’s still WIP?

nesium commented 7 months ago

Hm, it works for me. You didn't create a new tag, did you try it locally with the new version?

Screenshot 2024-02-08 at 10 01 50
valeriansaliou commented 7 months ago

Sorry, my bad, when looking at the code it looked like there was no logic to set the isEdited flag to true when relevant, only the model, but I was wrong. It's now implemented & working!