Refactor EventHandler

Refactor EventHandler to be a Q_GADGET and create from a constructor
This commit is contained in:
James Graham
2024-01-26 17:17:53 +00:00
parent 27662f9a4a
commit 95fff4c9f7
9 changed files with 98 additions and 195 deletions

View File

@@ -114,10 +114,9 @@ QString ChatBarCache::relationMessage() const
qWarning() << "ChatBarCache created with incorrect parent, a NeoChatRoom must be set as the parent on creation.";
return {};
}
EventHandler eventhandler;
eventhandler.setRoom(room);
if (auto event = room->findInTimeline(m_relationId); event != room->historyEdge()) {
eventhandler.setEvent(&**event);
EventHandler eventhandler(room, &**event);
return eventhandler.getPlainBody();
}
return {};