Reenable redactions
This commit is contained in:
parent
0d3c9390c6
commit
aee29c6ed5
6 changed files with 26 additions and 8 deletions
|
|
@ -321,6 +321,9 @@ TimelineModel::TimelineModel(QString room_id, QObject *parent)
|
|||
|
||||
emit dataChanged(index(idx, 0), index(idx, 0));
|
||||
});
|
||||
connect(this, &TimelineModel::redactionFailed, this, [](const QString &msg) {
|
||||
emit ChatPage::instance()->showNotification(msg);
|
||||
});
|
||||
}
|
||||
|
||||
QHash<int, QByteArray>
|
||||
|
|
@ -745,6 +748,25 @@ TimelineModel::readReceiptsAction(QString id) const
|
|||
MainWindow::instance()->openReadReceiptsDialog(id);
|
||||
}
|
||||
|
||||
void
|
||||
TimelineModel::redactEvent(QString id)
|
||||
{
|
||||
if (!id.isEmpty())
|
||||
http::client()->redact_event(
|
||||
room_id_.toStdString(),
|
||||
id.toStdString(),
|
||||
[this, id](const mtx::responses::EventId &, mtx::http::RequestErr err) {
|
||||
if (err) {
|
||||
emit redactionFailed(
|
||||
tr("Message redaction failed: %1")
|
||||
.arg(QString::fromStdString(err->matrix_error.error)));
|
||||
return;
|
||||
}
|
||||
|
||||
emit eventRedacted(id);
|
||||
});
|
||||
}
|
||||
|
||||
int
|
||||
TimelineModel::idToIndex(QString id) const
|
||||
{
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue