Differential D15063 Diff 36382 src/applications/subscriptions/controller/PhabricatorSubscriptionsEditController.php
Changeset View
Changeset View
Standalone View
Standalone View
src/applications/subscriptions/controller/PhabricatorSubscriptionsEditController.php
Show First 20 Lines • Show All 55 Lines • ▼ Show 20 Lines | public function handleRequest(AphrontRequest $request) { | ||||
if ($object->isAutomaticallySubscribed($viewer->getPHID())) { | if ($object->isAutomaticallySubscribed($viewer->getPHID())) { | ||||
return $this->buildErrorResponse( | return $this->buildErrorResponse( | ||||
pht('Automatically Subscribed'), | pht('Automatically Subscribed'), | ||||
pht('You are automatically subscribed to this object.'), | pht('You are automatically subscribed to this object.'), | ||||
$handle->getURI()); | $handle->getURI()); | ||||
} | } | ||||
if (!$object->shouldAllowSubscription($viewer->getPHID())) { | |||||
return $this->buildErrorResponse( | |||||
pht('You Can Not Subscribe'), | |||||
pht('You can not subscribe to this object.'), | |||||
$handle->getURI()); | |||||
} | |||||
if ($object instanceof PhabricatorApplicationTransactionInterface) { | if ($object instanceof PhabricatorApplicationTransactionInterface) { | ||||
if ($is_add) { | if ($is_add) { | ||||
$xaction_value = array( | $xaction_value = array( | ||||
'+' => array($viewer->getPHID()), | '+' => array($viewer->getPHID()), | ||||
); | ); | ||||
} else { | } else { | ||||
$xaction_value = array( | $xaction_value = array( | ||||
'-' => array($viewer->getPHID()), | '-' => array($viewer->getPHID()), | ||||
▲ Show 20 Lines • Show All 53 Lines • Show Last 20 Lines |