return a 409 Conflict when subscription already exists
This commit is contained in:
parent
a2aa87fbff
commit
6d429ce357
@ -263,6 +263,14 @@ class AtompubsubscriptionfeedAction extends ApiAuthAction
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (Subscription::exists($this->_profile, $profile)) {
|
||||||
|
// 409 Conflict
|
||||||
|
$this->clientError(sprintf(_('Already subscribed to %s'),
|
||||||
|
$person->id),
|
||||||
|
409);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
if (Subscription::start($this->_profile, $profile)) {
|
if (Subscription::start($this->_profile, $profile)) {
|
||||||
$sub = Subscription::pkeyGet(array('subscriber' => $this->_profile->id,
|
$sub = Subscription::pkeyGet(array('subscriber' => $this->_profile->id,
|
||||||
'subscribed' => $profile->id));
|
'subscribed' => $profile->id));
|
||||||
|
Loading…
x
Reference in New Issue
Block a user