Improve the notification setting description
The current text has invited a lot of confusion around how notifications work in NeoChat, because it mentions "push notifications". Some users take it to mean that somehow the notifications appear in the background, but that's only supported if built with KUnifiedPush. To make it super clear, let's change the description dynamically based on whether: 1. NeoChat is built with KUnifiedPush support. 2. We were able to connect with the KUnifiedPush daemon and your server has a push gateway.
This commit is contained in:
@@ -472,9 +472,12 @@ QCoro::Task<void> NeoChatConnection::setupPushNotifications(QString endpoint)
|
||||
false);
|
||||
|
||||
qInfo() << "Registered for push notifications";
|
||||
m_pushNotificationsEnabled = true;
|
||||
} else {
|
||||
qWarning() << "There's no gateway, not setting up push notifications.";
|
||||
m_pushNotificationsEnabled = false;
|
||||
}
|
||||
Q_EMIT enablePushNotificationsChanged();
|
||||
#else
|
||||
Q_UNUSED(endpoint)
|
||||
co_return;
|
||||
@@ -536,4 +539,18 @@ bool NeoChatConnection::canEraseData() const
|
||||
return m_canEraseData;
|
||||
}
|
||||
|
||||
bool NeoChatConnection::pushNotificationsAvailable() const
|
||||
{
|
||||
#ifdef HAVE_KUNIFIEDPUSH
|
||||
return true;
|
||||
#else
|
||||
return false;
|
||||
#endif
|
||||
}
|
||||
|
||||
bool NeoChatConnection::enablePushNotifications() const
|
||||
{
|
||||
return m_pushNotificationsEnabled;
|
||||
}
|
||||
|
||||
#include "moc_neochatconnection.cpp"
|
||||
|
||||
Reference in New Issue
Block a user