summary refs log tree commit diff
path: root/src/timeline
diff options
context:
space:
mode:
authortargetakhil <targetakhil@gmail.com>2021-04-15 21:14:58 +0530
committertargetakhil <targetakhil@gmail.com>2021-04-15 22:37:47 +0530
commit6893e3a8d5cd30fc3e29dbf9160f258cb86b0cf0 (patch)
treee931514b0a1f66ef2bce1a4cbb7db9a38b63636f /src/timeline
parentFix basic UI for forward completer (diff)
downloadnheko-6893e3a8d5cd30fc3e29dbf9160f258cb86b0cf0.tar.xz
show forward menu item only for relevant events, changes to ui
Diffstat (limited to 'src/timeline')
-rw-r--r--src/timeline/TimelineModel.cpp11
-rw-r--r--src/timeline/TimelineModel.h1
2 files changed, 12 insertions, 0 deletions
diff --git a/src/timeline/TimelineModel.cpp b/src/timeline/TimelineModel.cpp

index e3efe5ad..0edee4aa 100644 --- a/src/timeline/TimelineModel.cpp +++ b/src/timeline/TimelineModel.cpp
@@ -832,6 +832,17 @@ TimelineModel::forwardMessage(QString eventId, QString roomId) emit forwardToRoom(e, roomId, cache::isRoomEncrypted(room_id_.toStdString())); } +QString +TimelineModel::messageContent(QString eventId) +{ + auto e = events.get(eventId.toStdString(), ""); + if (!e) + return ""; + + auto content = mtx::accessors::body(*e); + return QString::fromStdString(content); +} + void TimelineModel::viewDecryptedRawMessage(QString id) const { diff --git a/src/timeline/TimelineModel.h b/src/timeline/TimelineModel.h
index 3e6f6f15..c17280da 100644 --- a/src/timeline/TimelineModel.h +++ b/src/timeline/TimelineModel.h
@@ -220,6 +220,7 @@ public: Q_INVOKABLE void viewRawMessage(QString id) const; Q_INVOKABLE void forwardMessage(QString eventId, QString roomId); + Q_INVOKABLE QString messageContent(QString eventId); Q_INVOKABLE void viewDecryptedRawMessage(QString id) const; Q_INVOKABLE void openUserProfile(QString userid, bool global = false); Q_INVOKABLE void openRoomSettings();