]> git.mxchange.org Git - quix0rs-gnu-social.git/blobdiff - plugins/OStatus/actions/usersalmon.php
More modern coding, stuff related to subscriptions
[quix0rs-gnu-social.git] / plugins / OStatus / actions / usersalmon.php
index 40577a7d6e1688d7acb707d15baee9fa03d7ffdc..550c034e4921f8870a93cfaff178f8d2448bda2a 100644 (file)
@@ -134,7 +134,11 @@ class UsersalmonAction extends SalmonAction
         $oprofile = $this->ensureProfile();
         if ($oprofile instanceof Ostatus_profile) {
             common_log(LOG_INFO, sprintf('Canceling subscription from remote %s to local %s', $oprofile->getUri(), $this->user->getNickname()));
-            Subscription::cancel($oprofile->localProfile(), $this->user->getProfile());
+            try {
+                Subscription::cancel($oprofile->localProfile(), $this->user->getProfile());
+            } catch (AlreadyFulfilledException $e) {
+                common_debug('Subscription did not exist, so there was nothing to cancel');
+            }
         } else {
             common_log(LOG_ERR, "Can't cancel subscription from remote, didn't find the profile");
         }