mirror of
https://github.com/Nheko-Reborn/nheko.git
synced 2024-11-22 03:00:46 +03:00
parent
2a380eeae6
commit
05727b8a45
1 changed files with 9 additions and 5 deletions
|
@ -534,11 +534,15 @@ EventStore::edits(const std::string &event_id)
|
||||||
if (edit_rel.replaces() == event_id &&
|
if (edit_rel.replaces() == event_id &&
|
||||||
original_sender == mtx::accessors::sender(*related_event)) {
|
original_sender == mtx::accessors::sender(*related_event)) {
|
||||||
auto related_ev = *related_event;
|
auto related_ev = *related_event;
|
||||||
if (edit_rel.synthesized && original_relations.reply_to() && !edit_rel.reply_to()) {
|
|
||||||
auto edit_rel_copy = edit_rel;
|
// spec does not allow changing relatings in an edit. So if we are not using the multi
|
||||||
edit_rel_copy.relations.push_back(
|
// relation format specific to Nheko, just use the original relations + the edit...
|
||||||
{mtx::common::RelationType::InReplyTo, original_relations.reply_to().value()});
|
if (edit_rel.synthesized) {
|
||||||
mtx::accessors::set_relations(related_ev, std::move(edit_rel_copy));
|
auto merged_relations = original_relations;
|
||||||
|
merged_relations.synthesized = true;
|
||||||
|
merged_relations.relations.push_back(
|
||||||
|
{mtx::common::RelationType::Replace, event_id});
|
||||||
|
mtx::accessors::set_relations(related_ev, std::move(merged_relations));
|
||||||
}
|
}
|
||||||
edits.push_back(std::move(related_ev));
|
edits.push_back(std::move(related_ev));
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue