Refactor lastEventIsSpoiler, remove lastEvent() call that isn't needed
This is only called after we already get an event with lastEvent() so doing it again is useless. Instead, we should refactor it to behave like similar functions (e.g. isEventHighlighted.)
This commit is contained in:
committed by
Tobias Fella
parent
8817ca7f2b
commit
08dc05c707
@@ -248,7 +248,7 @@ QVariant RoomListModel::data(const QModelIndex &index, int role) const
|
||||
}
|
||||
if (role == SubtitleTextRole) {
|
||||
const auto lastEvent = room->lastEvent(m_hiddenFilter);
|
||||
if (lastEvent == nullptr || room->lastEventIsSpoiler()) {
|
||||
if (lastEvent == nullptr || room->isEventSpoiler(lastEvent)) {
|
||||
return QString();
|
||||
}
|
||||
return EventHandler::subtitleText(room, lastEvent);
|
||||
|
||||
Reference in New Issue
Block a user