summary refs log tree commit diff
diff options
context:
space:
mode:
authorNicolas Werner <nicolas.werner@hotmail.de>2020-07-18 17:59:59 +0200
committerNicolas Werner <nicolas.werner@hotmail.de>2020-07-18 17:59:59 +0200
commita5dda86a6cc249fb6e795066187bcb34305162a3 (patch)
tree64fffa81b610403f273f9241cf44552db0357239
parentReenable sending messages (diff)
downloadnheko-a5dda86a6cc249fb6e795066187bcb34305162a3.tar.xz
Fix encryption indicator
-rw-r--r--src/timeline/TimelineModel.cpp9
1 files changed, 6 insertions, 3 deletions
diff --git a/src/timeline/TimelineModel.cpp b/src/timeline/TimelineModel.cpp

index aa6cea4f..b1cb2d5e 100644 --- a/src/timeline/TimelineModel.cpp +++ b/src/timeline/TimelineModel.cpp
@@ -353,9 +353,12 @@ TimelineModel::data(const mtx::events::collections::TimelineEvents &event, int r return qml_mtx_events::Received; } case IsEncrypted: { - // return std::holds_alternative< - // mtx::events::EncryptedEvent<mtx::events::msg::Encrypted>>(events[id]); - return false; + auto id = event_id(event); + auto encrypted_event = events.event(id, id, false); + return encrypted_event && + std::holds_alternative< + mtx::events::EncryptedEvent<mtx::events::msg::Encrypted>>( + *encrypted_event); } case IsRoomEncrypted: { return cache::isRoomEncrypted(room_id_.toStdString());