From de7354f056b31bf7b7a6b7879b7d3dc5f53070fd Mon Sep 17 00:00:00 2001 From: Tobias Fella Date: Sat, 31 Jul 2021 01:00:58 +0200 Subject: [PATCH] Adapt to changes in libQuotient API --- src/messageeventmodel.cpp | 10 +++++----- src/neochatroom.cpp | 10 +++++----- 2 files changed, 10 insertions(+), 10 deletions(-) diff --git a/src/messageeventmodel.cpp b/src/messageeventmodel.cpp index dd9349a30..2a4d4c08d 100644 --- a/src/messageeventmodel.cpp +++ b/src/messageeventmodel.cpp @@ -68,7 +68,7 @@ MessageEventModel::MessageEventModel(QObject *parent) return; } const auto it = m_currentRoom->findInTimeline(m_currentRoom->readMarkerEventId()); - if (it == m_currentRoom->timelineEdge()) { + if (it == m_currentRoom->historyEdge()) { m_currentRoom->getPreviousContent(50); } }); @@ -235,7 +235,7 @@ void MessageEventModel::refreshEventRoles(int row, const QVector &roles) void MessageEventModel::moveReadMarker(const QString &toEventId) { const auto timelineIt = m_currentRoom->findInTimeline(toEventId); - if (timelineIt == m_currentRoom->timelineEdge()) { + if (timelineIt == m_currentRoom->historyEdge()) { return; } int newRow = int(timelineIt - m_currentRoom->messageEvents().rbegin()) + timelineBaseIndex(); @@ -280,7 +280,7 @@ int MessageEventModel::refreshEventRoles(const QString &id, const QVector & row = int(pendingIt - m_currentRoom->pendingEvents().begin()); } else { const auto timelineIt = m_currentRoom->findInTimeline(id); - if (timelineIt == m_currentRoom->timelineEdge()) { + if (timelineIt == m_currentRoom->historyEdge()) { qWarning() << "Trying to refresh inexistent event:" << id; return -1; } @@ -622,7 +622,7 @@ QVariant MessageEventModel::data(const QModelIndex &idx, int role) const return {}; }; const auto replyIt = m_currentRoom->findInTimeline(replyEventId); - if (replyIt == m_currentRoom->timelineEdge()) { + if (replyIt == m_currentRoom->historyEdge()) { return {}; }; const auto &replyEvt = **replyIt; @@ -745,7 +745,7 @@ QVariant MessageEventModel::data(const QModelIndex &idx, int role) const int MessageEventModel::eventIDToIndex(const QString &eventID) const { const auto it = m_currentRoom->findInTimeline(eventID); - if (it == m_currentRoom->timelineEdge()) { + if (it == m_currentRoom->historyEdge()) { //qWarning() << "Trying to find inexistent event:" << eventID; return -1; } diff --git a/src/neochatroom.cpp b/src/neochatroom.cpp index 6acead447..36fb633f3 100644 --- a/src/neochatroom.cpp +++ b/src/neochatroom.cpp @@ -234,12 +234,12 @@ QDateTime NeoChatRoom::lastActiveTime() int NeoChatRoom::savedTopVisibleIndex() const { - return firstDisplayedMarker() == timelineEdge() ? 0 : int(firstDisplayedMarker() - messageEvents().rbegin()); + return firstDisplayedMarker() == historyEdge() ? 0 : int(firstDisplayedMarker() - messageEvents().rbegin()); } int NeoChatRoom::savedBottomVisibleIndex() const { - return lastDisplayedMarker() == timelineEdge() ? 0 : int(lastDisplayedMarker() - messageEvents().rbegin()); + return lastDisplayedMarker() == historyEdge() ? 0 : int(lastDisplayedMarker() - messageEvents().rbegin()); } void NeoChatRoom::saveViewport(int topIndex, int bottomIndex) @@ -565,7 +565,7 @@ void NeoChatRoom::postHtmlMessage(const QString &text, const QString &html, Mess bool isReply = !replyEventId.isEmpty(); bool isEdit = !relateToEventId.isEmpty(); const auto replyIt = findInTimeline(replyEventId); - if (replyIt == timelineEdge()) { + if (replyIt == historyEdge()) { isReply = false; } @@ -631,7 +631,7 @@ void NeoChatRoom::toggleReaction(const QString &eventId, const QString &reaction } const auto eventIt = findInTimeline(eventId); - if (eventIt == timelineEdge()) { + if (eventIt == historyEdge()) { return; } @@ -696,7 +696,7 @@ bool NeoChatRoom::canSendState(const QString &eventType) const bool NeoChatRoom::readMarkerLoaded() const { const auto it = findInTimeline(readMarkerEventId()); - return it != timelineEdge(); + return it != historyEdge(); } bool NeoChatRoom::isInvite() const