mirror of
https://github.com/nextcloud/desktop.git
synced 2025-10-26 11:17:43 +00:00
Notifications: Check capabilities if the notifications are enabled
If not, do not query for them.
This commit is contained in:
parent
b97c832306
commit
7d13a1d8e1
@ -440,6 +440,15 @@ void ActivityWidget::slotFetchNotifications(AccountState *ptr)
|
||||
return;
|
||||
}
|
||||
|
||||
// check if the account has notifications enabled. If the capabilities are
|
||||
// not yet valid, its assumed that notifications are available.
|
||||
if( ptr->account() && ptr->account()->capabilities().isValid() ) {
|
||||
if( ! ptr->account()->capabilities().notificationsAvailable() ) {
|
||||
qDebug() << "Account" << ptr->account()->displayName() << "does not have notifications enabled.";
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
// if the previous notification job has finished, start next.
|
||||
if( !_notificationJob ) {
|
||||
_notificationJob = new JsonApiJob( ptr->account(), QLatin1String("ocs/v2.php/apps/notifications/api/v1/notifications"), this );
|
||||
|
||||
Loading…
Reference in New Issue
Block a user