summary refs log tree commit diff
path: root/src
diff options
context:
space:
mode:
authortastytea <tastytea@tastytea.de>2022-03-06 14:46:52 +0100
committertastytea <tastytea@tastytea.de>2022-03-06 19:58:12 +0100
commite390c398626b5f6e885078de9ab14186e3c0c27e (patch)
tree29e73327be50b6173910e129a2584becf72fef12 /src
parentAdd function to force focus on InputDialog input field (diff)
downloadnheko-e390c398626b5f6e885078de9ab14186e3c0c27e.tar.xz
Allow to specify reason for removed message
# Previous commits:
#   5949173b Add function to force focus on InputDialog input field
#   9482ac4e Allow explicit selection of SSO method
#   ab05e2d8 Mobile message input (#962)
#   12a6da01 If you replace the txn id, replace a string the length of the txn id...
Diffstat (limited to 'src')
-rw-r--r--src/timeline/TimelineModel.cpp8
-rw-r--r--src/timeline/TimelineModel.h2
2 files changed, 6 insertions, 4 deletions
diff --git a/src/timeline/TimelineModel.cpp b/src/timeline/TimelineModel.cpp

index 903f137f..8e6c7235 100644 --- a/src/timeline/TimelineModel.cpp +++ b/src/timeline/TimelineModel.cpp
@@ -1240,7 +1240,7 @@ TimelineModel::showReadReceipts(QString id) } void -TimelineModel::redactEvent(const QString &id) +TimelineModel::redactEvent(const QString &id, const QString &reason) { if (!id.isEmpty()) { auto edits = events.edits(id.toStdString()); @@ -1255,7 +1255,8 @@ TimelineModel::redactEvent(const QString &id) } emit dataAtIdChanged(id); - }); + }, + reason.toStdString()); // redact all edits to prevent leaks for (const auto &e : edits) { @@ -1271,7 +1272,8 @@ TimelineModel::redactEvent(const QString &id) } emit dataAtIdChanged(id); - }); + }, + reason.toStdString()); } } } diff --git a/src/timeline/TimelineModel.h b/src/timeline/TimelineModel.h
index e4e3fa9d..f47203f0 100644 --- a/src/timeline/TimelineModel.h +++ b/src/timeline/TimelineModel.h
@@ -272,7 +272,7 @@ public: Q_INVOKABLE void unpin(const QString &id); Q_INVOKABLE void pin(const QString &id); Q_INVOKABLE void showReadReceipts(QString id); - Q_INVOKABLE void redactEvent(const QString &id); + Q_INVOKABLE void redactEvent(const QString &id, const QString &reason = ""); Q_INVOKABLE int idToIndex(const QString &id) const; Q_INVOKABLE QString indexToId(int index) const; Q_INVOKABLE void openMedia(const QString &eventId);