diff --git a/src/libneochat/chatbarcache.cpp b/src/libneochat/chatbarcache.cpp index 12799b4c8..002ea3b24 100644 --- a/src/libneochat/chatbarcache.cpp +++ b/src/libneochat/chatbarcache.cpp @@ -207,16 +207,10 @@ void ChatBarCache::setAttachmentPath(const QString &attachmentPath) m_attachmentPath = attachmentPath; Q_EMIT attachmentPathChanged(); -#if (Quotient_VERSION_MINOR < 10 && Quotient_VERSION_PATCH < 3) || Quotient_VERSION_MINOR < 9 - m_relationType = None; - const auto oldEventId = std::exchange(m_relationId, QString()); - Q_EMIT relationIdChanged(oldEventId, m_relationId); -#else if (m_relationType == Edit) { const auto oldEventId = std::exchange(m_relationId, QString()); Q_EMIT relationIdChanged(oldEventId, m_relationId); } -#endif } void ChatBarCache::clearRelations() diff --git a/src/libneochat/neochatroom.cpp b/src/libneochat/neochatroom.cpp index 523e04979..11841c1a9 100644 --- a/src/libneochat/neochatroom.cpp +++ b/src/libneochat/neochatroom.cpp @@ -40,9 +40,7 @@ #include #include #include -#if Quotient_VERSION_MINOR > 9 || (Quotient_VERSION_MINOR == 9 && Quotient_VERSION_PATCH > 1) #include -#endif #include "chatbarcache.h" #include "clipboard.h" @@ -286,11 +284,7 @@ QCoro::Task NeoChatRoom::doUploadFile(QUrl url, QString body, std::optiona content = new EventContent::FileContent(url, fileInfo.size(), mime, fileInfo.fileName()); } -#if Quotient_VERSION_MINOR > 9 || (Quotient_VERSION_MINOR == 9 && Quotient_VERSION_PATCH > 2) QString txnId = postFile(body.isEmpty() ? url.fileName() : body, std::unique_ptr(content), relatesTo); -#else - QString txnId = postFile(body.isEmpty() ? url.fileName() : body, std::unique_ptr(content)); -#endif setHasFileUploading(true); connect(this, &Room::fileTransferCompleted, [this, txnId](const QString &id, FileSourceInfo) { if (id == txnId) { @@ -1778,11 +1772,7 @@ bool NeoChatRoom::eventIsThreaded(const QString &eventId) const return false; } -#if Quotient_VERSION_MINOR > 9 || (Quotient_VERSION_MINOR == 9 && Quotient_VERSION_PATCH > 1) return event->isThreaded() || threads().contains(eventId); -#else - return event->isThreaded(); -#endif } QString NeoChatRoom::rootIdForThread(const QString &eventId) const @@ -1793,11 +1783,9 @@ QString NeoChatRoom::rootIdForThread(const QString &eventId) const } auto rootId = event->threadRootEventId(); -#if Quotient_VERSION_MINOR > 9 || (Quotient_VERSION_MINOR == 9 && Quotient_VERSION_PATCH > 1) if (rootId.isEmpty() && threads().contains(eventId)) { rootId = event->id(); } -#endif return rootId; } diff --git a/src/login/registration.cpp b/src/login/registration.cpp index 255d7292b..6c02af972 100644 --- a/src/login/registration.cpp +++ b/src/login/registration.cpp @@ -180,7 +180,6 @@ void Registration::testHomeserver() if (m_testServerJob) { delete m_testServerJob; } -#if Quotient_VERSION_MINOR > 9 || Quotient_VERSION_PATCH > 2 auto ssoFlow = m_connection->getLoginFlow(LoginFlowTypes::SSO); if (ssoFlow && ssoFlow->delegatedOidcCompatibility) { auto session = m_connection->prepareForSso(u"NeoChat"_s); @@ -214,7 +213,6 @@ void Registration::testHomeserver() }); return; } -#endif m_testServerJob = m_connection->callApi("user"_L1, std::nullopt, "user"_L1, QString(), QString(), QString(), false); connect(m_testServerJob.data(), &BaseJob::finished, this, [this]() { diff --git a/src/messagecontent/models/eventmessagecontentmodel.cpp b/src/messagecontent/models/eventmessagecontentmodel.cpp index c235ac14a..5fb7a0fd4 100644 --- a/src/messagecontent/models/eventmessagecontentmodel.cpp +++ b/src/messagecontent/models/eventmessagecontentmodel.cpp @@ -7,9 +7,7 @@ #include #include #include -#if Quotient_VERSION_MINOR > 9 || (Quotient_VERSION_MINOR == 9 && Quotient_VERSION_PATCH > 1) #include -#endif #include #include @@ -163,17 +161,11 @@ QString EventMessageContentModel::threadRootId() const return {}; } auto roomMessageEvent = eventCast(event.first); -#if Quotient_VERSION_MINOR > 9 || (Quotient_VERSION_MINOR == 9 && Quotient_VERSION_PATCH > 1) if (roomMessageEvent && roomMessageEvent->isThreaded()) { return roomMessageEvent->threadRootEventId(); } else if (m_room->threads().contains(roomMessageEvent->id())) { return m_eventId; } -#else - if (roomMessageEvent && roomMessageEvent->isThreaded()) { - return roomMessageEvent->threadRootEventId(); - } -#endif return {}; } @@ -317,23 +309,15 @@ QList EventMessageContentModel::messageContentComponents(bool } const auto roomMessageEvent = eventCast(event.first); -#if Quotient_VERSION_MINOR > 9 || (Quotient_VERSION_MINOR == 9 && Quotient_VERSION_PATCH > 1) if (m_threadsEnabled && roomMessageEvent && ((roomMessageEvent->isThreaded() && roomMessageEvent->id() == roomMessageEvent->threadRootEventId()) || m_room->threads().contains(roomMessageEvent->id()))) { -#else - if (m_threadsEnabled && roomMessageEvent && roomMessageEvent->isThreaded() && roomMessageEvent->id() == roomMessageEvent->threadRootEventId()) { -#endif newComponents += MessageComponent{MessageComponentType::Separator, {}, {}}; newComponents += MessageComponent{MessageComponentType::ThreadBody, u"Thread Body"_s, {}}; } // If the event is already threaded the ThreadModel will handle displaying a chat bar. -#if Quotient_VERSION_MINOR > 9 || (Quotient_VERSION_MINOR == 9 && Quotient_VERSION_PATCH > 1) if (isThreading && roomMessageEvent && !(roomMessageEvent->isThreaded() || m_room->threads().contains(roomMessageEvent->id()))) { -#else - if (isThreading && roomMessageEvent && roomMessageEvent->isThreaded()) { -#endif newComponents += MessageComponent{MessageComponentType::ChatBar, QString(), {}}; } diff --git a/src/messagecontent/models/threadmodel.cpp b/src/messagecontent/models/threadmodel.cpp index bff73bdd8..0690a33da 100644 --- a/src/messagecontent/models/threadmodel.cpp +++ b/src/messagecontent/models/threadmodel.cpp @@ -24,11 +24,7 @@ ThreadModel::ThreadModel(const QString &threadRootId, NeoChatRoom *room) Q_ASSERT(!m_threadRootId.isEmpty()); Q_ASSERT(room); -#if Quotient_VERSION_MINOR > 9 || (Quotient_VERSION_MINOR == 9 && Quotient_VERSION_PATCH > 0) connect(room, &Quotient::Room::pendingEventAdded, this, [this](const Quotient::RoomEvent *event) { -#else - connect(room, &Quotient::Room::pendingEventAboutToAdd, this, [this](Quotient::RoomEvent *event) { -#endif if (auto roomEvent = eventCast(event)) { if (roomEvent->isThreaded() && roomEvent->threadRootEventId() == m_threadRootId) { addNewEvent(event); diff --git a/src/timeline/models/messagemodel.cpp b/src/timeline/models/messagemodel.cpp index 8bbf3f002..54b88281a 100644 --- a/src/timeline/models/messagemodel.cpp +++ b/src/timeline/models/messagemodel.cpp @@ -8,9 +8,7 @@ #include #include #include -#if Quotient_VERSION_MINOR > 9 || (Quotient_VERSION_MINOR == 9 && Quotient_VERSION_PATCH > 1) #include -#endif #include @@ -196,19 +194,12 @@ QVariant MessageModel::data(const QModelIndex &idx, int role) const } auto roomMessageEvent = eventCast(&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; } diff --git a/src/timeline/models/timelinemessagemodel.cpp b/src/timeline/models/timelinemessagemodel.cpp index 71a5fdc73..e02fa0c97 100644 --- a/src/timeline/models/timelinemessagemodel.cpp +++ b/src/timeline/models/timelinemessagemodel.cpp @@ -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) {