summary refs log tree commit diff
path: root/src
diff options
context:
space:
mode:
authorNicolas Werner <nicolas.werner@hotmail.de>2021-02-10 18:07:55 +0100
committerNicolas Werner <nicolas.werner@hotmail.de>2021-02-10 21:13:57 +0100
commit0db4d71ec2483c7ac5a7b536737fee8fc53a76d7 (patch)
treeb5fe7fe91a0d4790a757fb6f9d33c35d509896bf /src
parentFix cancel edit order on Escape key (diff)
downloadnheko-0db4d71ec2483c7ac5a7b536737fee8fc53a76d7.tar.xz
Prevent edits of unsent messages
Diffstat (limited to 'src')
-rw-r--r--src/timeline/TimelineModel.cpp3
-rw-r--r--src/timeline/TimelineModel.h3
2 files changed, 6 insertions, 0 deletions
diff --git a/src/timeline/TimelineModel.cpp b/src/timeline/TimelineModel.cpp

index 493f755b..b6ebeb84 100644 --- a/src/timeline/TimelineModel.cpp +++ b/src/timeline/TimelineModel.cpp
@@ -1536,6 +1536,9 @@ TimelineModel::formatMemberEvent(QString id) void TimelineModel::setEdit(QString newEdit) { + if (edit_.startsWith('m')) + return; + if (edit_ != newEdit) { auto ev = events.get(newEdit.toStdString(), ""); if (ev && mtx::accessors::sender(*ev) == http::client()->user_id().to_string()) { diff --git a/src/timeline/TimelineModel.h b/src/timeline/TimelineModel.h
index 017b6589..83012cd8 100644 --- a/src/timeline/TimelineModel.h +++ b/src/timeline/TimelineModel.h
@@ -260,6 +260,9 @@ public slots: QString reply() const { return reply_; } void setReply(QString newReply) { + if (edit_.startsWith('m')) + return; + if (reply_ != newReply) { reply_ = newReply; emit replyChanged(reply_);