Create NeochatRoomMember as a shim for RoomMember

The intention is that NeochatRoomMember can be created passed to QML and then be fully managed by it. It effectively just grabs the current RoomMember, calls the correct function then discards it so that we don't end up trying to access an already deleted state event.
This commit is contained in:
James Graham
2024-07-27 08:46:56 +00:00
parent 4d9452b862
commit 11fd4f88ec
22 changed files with 363 additions and 112 deletions

View File

@@ -1767,6 +1767,11 @@ const RoomEvent *NeoChatRoom::getEvent(const QString &eventId) const
return timelineIt->get();
}
const auto pendingIt = findPendingEvent(eventId);
if (pendingIt != pendingEvents().end()) {
return pendingIt->event();
}
auto extraIt = std::find_if(m_extraEvents.begin(), m_extraEvents.end(), [eventId](const Quotient::event_ptr_tt<Quotient::RoomEvent> &event) {
return event->id() == eventId;
});