summary refs log tree commit diff
path: root/src/timeline/TimelineModel.cpp
diff options
context:
space:
mode:
authorNicolas Werner <nicolas.werner@hotmail.de>2021-05-09 13:02:41 +0200
committerNicolas Werner <nicolas.werner@hotmail.de>2021-05-09 13:02:41 +0200
commitb60d6f4d588c805cac152399df16f19415941f26 (patch)
treedbb08dac9a016c756057de2a8651f40c33abda50 /src/timeline/TimelineModel.cpp
parentAdd TOFU (Trust On First Use) mode to encryption (diff)
downloadnheko-b60d6f4d588c805cac152399df16f19415941f26.tar.xz
Mark unsent events as uneditable
fixes #574
Diffstat (limited to '')
-rw-r--r--src/timeline/TimelineModel.cpp6
1 files changed, 4 insertions, 2 deletions
diff --git a/src/timeline/TimelineModel.cpp b/src/timeline/TimelineModel.cpp
index 5fa28234..8df17457 100644
--- a/src/timeline/TimelineModel.cpp
+++ b/src/timeline/TimelineModel.cpp
@@ -566,8 +566,10 @@ TimelineModel::data(const mtx::events::collections::TimelineEvents &event, int r
         case IsEdited:
                 return QVariant(relations(event).replaces().has_value());
         case IsEditable:
-                return QVariant(!is_state_event(event) && mtx::accessors::sender(event) ==
-                                                            http::client()->user_id().to_string());
+                return QVariant(!is_state_event(event) &&
+                                mtx::accessors::sender(event) ==
+                                  http::client()->user_id().to_string() &&
+                                !event_id(event).empty() && event_id(event).front() == '$');
         case IsEncrypted: {
                 auto id              = event_id(event);
                 auto encrypted_event = events.get(id, id, false);