Display edits correctly
This commit is contained in:
parent
faeaf9dc6b
commit
00fd4eecec
8 changed files with 99 additions and 12 deletions
|
|
@ -774,15 +774,17 @@ EventStore::get(std::string_view id, std::string_view related_to, bool decrypt,
|
|||
if (id.empty())
|
||||
return nullptr;
|
||||
|
||||
std::string id_ = std::string(id);
|
||||
IdIndex index{room_id_, std::string(id)};
|
||||
if (resolve_edits) {
|
||||
auto edits_ = edits(id_);
|
||||
if (!edits_.empty())
|
||||
id_ = mtx::accessors::event_id(edits_.back());
|
||||
auto edits_ = edits(index.id);
|
||||
if (!edits_.empty()) {
|
||||
index.id = mtx::accessors::event_id(edits_.back());
|
||||
auto event_ptr =
|
||||
new mtx::events::collections::TimelineEvents(std::move(edits_.back()));
|
||||
events_by_id_.insert(index, event_ptr);
|
||||
}
|
||||
}
|
||||
|
||||
IdIndex index{room_id_, id_};
|
||||
|
||||
auto event_ptr = events_by_id_.object(index);
|
||||
if (!event_ptr) {
|
||||
auto event = cache::client()->getEvent(room_id_, index.id);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue