[Pkg-owncloud-commits] [owncloud-client] 132/470: Notifications: Check capabilities if the notifications are enabled

Sandro Knauß hefee-guest at moszumanska.debian.org
Thu May 12 16:24:54 UTC 2016


This is an automated email from the git hooks/post-receive script.

hefee-guest pushed a commit to branch master
in repository owncloud-client.

commit 7d13a1d8e199b21b917145d52faf7cd7b4f697b3
Author: Klaas Freitag <freitag at owncloud.com>
Date:   Wed Mar 9 17:21:59 2016 +0100

    Notifications: Check capabilities if the notifications are enabled
    
    If not, do not query for them.
---
 src/gui/activitywidget.cpp | 9 +++++++++
 1 file changed, 9 insertions(+)

diff --git a/src/gui/activitywidget.cpp b/src/gui/activitywidget.cpp
index ec01dde..07bf75d 100644
--- a/src/gui/activitywidget.cpp
+++ b/src/gui/activitywidget.cpp
@@ -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 );

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-owncloud/owncloud-client.git



More information about the Pkg-owncloud-commits mailing list