Move pollhandler to ContentProvider

Move `PollHandler` to `ContentProvider`, this also breaks the dependency on `PollHandler` for `NeoChatRoom`
This commit is contained in:
James Graham
2025-04-05 10:08:44 +00:00
parent d9b8b1c8ef
commit c56054a05a
6 changed files with 36 additions and 33 deletions

View File

@@ -334,7 +334,7 @@ QVariant MessageContentModel::data(const QModelIndex &index, int role) const
return EventHandler::locationAssetType(event.first);
}
if (role == PollHandlerRole) {
return QVariant::fromValue<PollHandler *>(m_room->poll(m_eventId));
return QVariant::fromValue<PollHandler *>(ContentProvider::self().handlerForPoll(m_room, m_eventId));
}
if (role == ReplyEventIdRole) {
if (const auto roomMessageEvent = eventCast<const RoomMessageEvent>(event.first)) {

View File

@@ -8,7 +8,6 @@
#include <functional>
#include "neochatroom.h"
#include "pollhandler.h"
#include "readmarkermodel.h"
#include "threadmodel.h"