tulir / gomuks

A terminal based Matrix client written in Go.
https://maunium.net/go/gomuks
GNU Affero General Public License v3.0
1.34k stars 120 forks source link

Initial support for reaction redaction #392

Open n-peugnet opened 1 year ago

n-peugnet commented 1 year ago

With this patch, EventAnnotation events are now stored in gomuks' local history. Thus, the Reaction map in the history is not used anymore.

Redacted reaction events are treated the same way as any other redacted event in the history, but are ignored by the Message's event parser, in order not to display them in the timeline.

There is still a problem with reactions that come from the initial sync, as it seems events are received in an aggregated form. Also all reactions received from the initial sync are doubled, but this bug existed prior to this change.

This might not be the best approach so I am completely open for suggestions. Maybe instead of marking the event as redacted, it could be completely removed from the history. But I am not sure gomuks' history allows removing events. Also some of the code could be refactored.

This with #391 together fixes the reaction counter of the messages.