summaryrefslogtreecommitdiff
path: root/actions/apifriendshipsdestroy.php
diff options
context:
space:
mode:
Diffstat (limited to 'actions/apifriendshipsdestroy.php')
-rw-r--r--actions/apifriendshipsdestroy.php9
1 files changed, 3 insertions, 6 deletions
diff --git a/actions/apifriendshipsdestroy.php b/actions/apifriendshipsdestroy.php
index 91c6fd032..d48a57756 100644
--- a/actions/apifriendshipsdestroy.php
+++ b/actions/apifriendshipsdestroy.php
@@ -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);