Move the function to get a subtitle string to eventhandler

This commit is contained in:
James Graham
2023-12-10 13:19:13 +00:00
parent 4751ac6acc
commit 8d717b78ac
7 changed files with 43 additions and 44 deletions

View File

@@ -4,6 +4,7 @@
#include "roomlistmodel.h"
#include "controller.h"
#include "eventhandler.h"
#include "neochatconfig.h"
#include "neochatroom.h"
#include "roommanager.h"
@@ -351,7 +352,10 @@ QVariant RoomListModel::data(const QModelIndex &index, int role) const
if (room->lastEventIsSpoiler()) {
return QString();
}
return room->lastEventToString(Qt::PlainText, true);
EventHandler eventHandler;
eventHandler.setRoom(room);
eventHandler.setEvent(room->lastEvent());
return eventHandler.subtitleText();
}
if (role == AvatarImageRole) {
return room->avatar(128);