]> git.mxchange.org Git - quix0rs-gnu-social.git/blobdiff - actions/apifriendshipsdestroy.php
Merge branch 'testing' into 0.9.x
[quix0rs-gnu-social.git] / actions / apifriendshipsdestroy.php
index 91c6fd032439e7bdc68c621fec5bcb64458ec4c1..d48a577562af968e259899c56e5a32edb8a79933 100644 (file)
@@ -124,12 +124,9 @@ class ApiFriendshipsDestroyAction extends ApiAuthAction
             return;
         }
 
-        $result = subs_unsubscribe_user($this->user, $this->other->nickname);
-
-        if (is_string($result)) {
-            $this->clientError($result, 403, $this->format);
-            return;
-        }
+        // throws an exception on error
+        Subscription::cancel($this->user->getProfile(),
+                             $this->other->getProfile());
 
         $this->initDocument($this->format);
         $this->showProfile($this->other, $this->format);