Use isOnline from libquotient

Use `isOnline` from libquotient

This require a bump of the min libquotient to 0.9.1
This commit is contained in:
James Graham
2025-05-05 12:20:26 +01:00
parent df9a7292b9
commit db0c423763
3 changed files with 1 additions and 32 deletions

View File

@@ -107,7 +107,7 @@ if (NOT ANDROID AND NOT WIN32 AND NOT APPLE AND NOT HAIKU)
find_package(KF6DBusAddons ${KF_MIN_VERSION} REQUIRED)
endif()
find_package(QuotientQt6 0.9)
find_package(QuotientQt6 0.9.1)
set_package_properties(QuotientQt6 PROPERTIES
TYPE REQUIRED
DESCRIPTION "Qt wrapper around Matrix API"

View File

@@ -61,12 +61,6 @@ void NeoChatConnection::connectSignals()
Q_EMIT identityServerChanged();
}
});
connect(this, &NeoChatConnection::syncDone, this, [this] {
setIsOnline(true);
});
connect(this, &NeoChatConnection::networkError, this, [this]() {
setIsOnline(false);
});
connect(this, &NeoChatConnection::requestFailed, this, [this](BaseJob *job) {
if (job->error() == BaseJob::UserConsentRequired) {
Q_EMIT userConsentRequired(job->errorUrl());
@@ -501,20 +495,6 @@ QCoro::Task<void> NeoChatConnection::setupPushNotifications(QString endpoint)
#endif
}
bool NeoChatConnection::isOnline() const
{
return m_isOnline;
}
void NeoChatConnection::setIsOnline(bool isOnline)
{
if (isOnline == m_isOnline) {
return;
}
m_isOnline = isOnline;
Q_EMIT isOnlineChanged();
}
QString NeoChatConnection::accountDataJsonString(const QString &type) const
{
return QString::fromUtf8(QJsonDocument(accountDataJson(type)).toJson());

View File

@@ -70,11 +70,6 @@ class NeoChatConnection : public Quotient::Connection
*/
Q_PROPERTY(bool directChatInvites READ directChatInvites NOTIFY directChatInvitesChanged)
/**
* @brief Whether NeoChat is currently able to connect to the server.
*/
Q_PROPERTY(bool isOnline READ isOnline WRITE setIsOnline NOTIFY isOnlineChanged)
/**
* @brief Whether the server supports querying a user's mutual rooms.
*/
@@ -201,8 +196,6 @@ public:
bool pushNotificationsAvailable() const;
bool enablePushNotifications() const;
bool isOnline() const;
LinkPreviewer *previewerForLink(const QUrl &link);
Q_SIGNALS:
@@ -214,7 +207,6 @@ Q_SIGNALS:
void homeNotificationsChanged();
void homeHaveHighlightNotificationsChanged();
void directChatInvitesChanged();
void isOnlineChanged();
void passwordStatus(NeoChatConnection::PasswordStatus status);
void userConsentRequired(QUrl url);
void badgeNotificationCountChanged(int count);
@@ -236,9 +228,6 @@ private:
static bool m_globalUrlPreviewDefault;
static PushRuleAction::Action m_defaultAction;
bool m_isOnline = true;
void setIsOnline(bool isOnline);
void connectSignals();
int m_badgeNotificationCount = 0;