Remove various outdated ifdefs
This commit is contained in:
@@ -8,9 +8,7 @@
|
||||
#include <Quotient/events/encryptedevent.h>
|
||||
#include <Quotient/events/roommessageevent.h>
|
||||
#include <Quotient/events/stickerevent.h>
|
||||
#if Quotient_VERSION_MINOR > 9 || (Quotient_VERSION_MINOR == 9 && Quotient_VERSION_PATCH > 1)
|
||||
#include <Quotient/thread.h>
|
||||
#endif
|
||||
|
||||
#include <KFormat>
|
||||
|
||||
@@ -196,19 +194,12 @@ QVariant MessageModel::data(const QModelIndex &idx, int role) const
|
||||
}
|
||||
|
||||
auto roomMessageEvent = eventCast<const RoomMessageEvent>(&event.value().get());
|
||||
#if Quotient_VERSION_MINOR > 9 || (Quotient_VERSION_MINOR == 9 && Quotient_VERSION_PATCH > 1)
|
||||
if (m_threadsEnabled && roomMessageEvent && (roomMessageEvent->isThreaded() || m_room->threads().contains(event.value().get().id()))) {
|
||||
const auto &thread = m_room->threads().value(roomMessageEvent->isThreaded() ? roomMessageEvent->threadRootEventId() : event.value().get().id());
|
||||
if (thread.latestEventId != event.value().get().id()) {
|
||||
return EventStatus::Hidden;
|
||||
}
|
||||
}
|
||||
#else
|
||||
if (roomMessageEvent && roomMessageEvent->isThreaded() && roomMessageEvent->threadRootEventId() != event.value().get().id() && m_threadsEnabled) {
|
||||
return EventStatus::Hidden;
|
||||
}
|
||||
#endif
|
||||
|
||||
return EventStatus::Normal;
|
||||
}
|
||||
|
||||
|
||||
@@ -60,7 +60,6 @@ void TimelineMessageModel::connectNewRoom()
|
||||
refreshLastUserEvents(i);
|
||||
}
|
||||
});
|
||||
#if Quotient_VERSION_MINOR > 9 || (Quotient_VERSION_MINOR == 9 && Quotient_VERSION_PATCH > 0)
|
||||
connect(m_room, &Room::pendingEventAdded, this, [this](const Quotient::RoomEvent *event) {
|
||||
Q_EMIT newEventAdded(event);
|
||||
Q_EMIT newLocalUserEventAdded();
|
||||
@@ -69,17 +68,6 @@ void TimelineMessageModel::connectNewRoom()
|
||||
endInsertRows();
|
||||
}
|
||||
});
|
||||
#else
|
||||
connect(m_room, &Room::pendingEventAboutToAdd, this, [this](Quotient::RoomEvent *event) {
|
||||
m_initialized = true;
|
||||
Q_EMIT newEventAdded(event);
|
||||
if (!m_resetting) {
|
||||
beginInsertRows({}, 0, 0);
|
||||
endInsertRows();
|
||||
}
|
||||
});
|
||||
connect(m_room, &Room::pendingEventAdded, this, &TimelineMessageModel::endInsertRows);
|
||||
#endif
|
||||
connect(m_room, &Room::pendingEventAboutToMerge, this, [this](RoomEvent *, int i) {
|
||||
Q_EMIT dataChanged(index(i, 0), index(i, 0), {IsPendingRole});
|
||||
if (i == 0) {
|
||||
|
||||
Reference in New Issue
Block a user