Mark unsent events as uneditable

fixes #574
This commit is contained in:
Nicolas Werner 2021-05-09 13:02:41 +02:00
parent 2df4c532ed
commit b60d6f4d58
No known key found for this signature in database
GPG key ID: C8D75E610773F2D9

View file

@ -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);