Fix reaction redaction for real this time

This commit is contained in:
Nicolas Werner 2020-05-06 12:52:13 +02:00
parent ff54ce9334
commit e5a5a66716
2 changed files with 5 additions and 0 deletions

View file

@ -42,6 +42,8 @@ struct RoomEventType
switch (e.type) { switch (e.type) {
case EventType::RoomKeyRequest: case EventType::RoomKeyRequest:
return qml_mtx_events::EventType::KeyRequest; return qml_mtx_events::EventType::KeyRequest;
case EventType::Reaction:
return qml_mtx_events::EventType::Reaction;
case EventType::RoomAliases: case EventType::RoomAliases:
return qml_mtx_events::EventType::Aliases; return qml_mtx_events::EventType::Aliases;
case EventType::RoomAvatar: case EventType::RoomAvatar:
@ -618,6 +620,7 @@ TimelineModel::internalAddEvents(
std::get_if<mtx::events::RoomEvent<mtx::events::msg::Reaction>>(&e)) { std::get_if<mtx::events::RoomEvent<mtx::events::msg::Reaction>>(&e)) {
QString reactedTo = QString reactedTo =
QString::fromStdString(reaction->content.relates_to.event_id); QString::fromStdString(reaction->content.relates_to.event_id);
events.insert(id, e);
reactions[reactedTo].addReaction(room_id_.toStdString(), *reaction); reactions[reactedTo].addReaction(room_id_.toStdString(), *reaction);
int idx = idToIndex(reactedTo); int idx = idToIndex(reactedTo);
if (idx >= 0) if (idx >= 0)

View file

@ -30,6 +30,8 @@ enum EventType
Unsupported, Unsupported,
/// m.room_key_request /// m.room_key_request
KeyRequest, KeyRequest,
/// m.reaction,
Reaction,
/// m.room.aliases /// m.room.aliases
Aliases, Aliases,
/// m.room.avatar /// m.room.avatar