summary refs log tree commit diff
path: root/src/timeline/TimelineModel.cpp
diff options
context:
space:
mode:
authorNicolas Werner <nicolas.werner@hotmail.de>2020-04-21 22:32:45 +0200
committerNicolas Werner <nicolas.werner@hotmail.de>2020-04-21 22:32:45 +0200
commit0e1bb5137bf2b13d501c243e31c8ca981fc20a1a (patch)
treeb4c1840c9b0fc4409dafcc4c6fbab790203b9bc2 /src/timeline/TimelineModel.cpp
parentUpdate changelog (diff)
downloadnheko-0e1bb5137bf2b13d501c243e31c8ca981fc20a1a.tar.xz
Add menu entry to show decrypted source
Also make hidden entries not consume space in Menus with some qml
styles.
Diffstat (limited to 'src/timeline/TimelineModel.cpp')
-rw-r--r--src/timeline/TimelineModel.cpp13
1 files changed, 13 insertions, 0 deletions
diff --git a/src/timeline/TimelineModel.cpp b/src/timeline/TimelineModel.cpp

index 7e124f47..bb793945 100644 --- a/src/timeline/TimelineModel.cpp +++ b/src/timeline/TimelineModel.cpp
@@ -697,7 +697,20 @@ TimelineModel::viewRawMessage(QString id) const } void +TimelineModel::viewDecryptedRawMessage(QString id) const +{ + auto event = events.value(id); + if (auto e = + std::get_if<mtx::events::EncryptedEvent<mtx::events::msg::Encrypted>>(&event)) { + event = decryptEvent(*e).event; + } + std::string ev = utils::serialize_event(event).dump(4); + auto dialog = new dialogs::RawMessage(QString::fromStdString(ev)); + Q_UNUSED(dialog); +} + +void TimelineModel::openUserProfile(QString userid) const { MainWindow::instance()->openUserProfile(userid, room_id_);