Add Subscribers to Phame Posts and Blogs
Summary: Makes it possible to subscribe to blogs and posts Test Plan: Verify I can subscribe to blogs and posts. Reviewers: btrahan, epriestley Reviewed By: epriestley Subscribers: epriestley, Korvin Differential Revision: https://secure.phabricator.com/D13672
This commit is contained in:
@@ -6965,6 +6965,7 @@ phutil_register_library_map(array(
|
||||
'PhameDAO',
|
||||
'PhabricatorPolicyInterface',
|
||||
'PhabricatorMarkupInterface',
|
||||
'PhabricatorSubscribableInterface',
|
||||
'PhabricatorApplicationTransactionInterface',
|
||||
),
|
||||
'PhameBlogDeleteController' => 'PhameController',
|
||||
@@ -6989,6 +6990,7 @@ phutil_register_library_map(array(
|
||||
'PhabricatorPolicyInterface',
|
||||
'PhabricatorMarkupInterface',
|
||||
'PhabricatorApplicationTransactionInterface',
|
||||
'PhabricatorSubscribableInterface',
|
||||
'PhabricatorTokenReceiverInterface',
|
||||
),
|
||||
'PhamePostDeleteController' => 'PhameController',
|
||||
|
||||
@@ -4,6 +4,7 @@ final class PhameBlog extends PhameDAO
|
||||
implements
|
||||
PhabricatorPolicyInterface,
|
||||
PhabricatorMarkupInterface,
|
||||
PhabricatorSubscribableInterface,
|
||||
PhabricatorApplicationTransactionInterface {
|
||||
|
||||
const MARKUP_FIELD_DESCRIPTION = 'markup:description';
|
||||
@@ -327,4 +328,21 @@ final class PhameBlog extends PhameDAO
|
||||
return $timeline;
|
||||
}
|
||||
|
||||
|
||||
/* -( PhabricatorSubscribableInterface Implementation )-------------------- */
|
||||
|
||||
|
||||
public function isAutomaticallySubscribed($phid) {
|
||||
return ($this->creatorPHID == $phid);
|
||||
}
|
||||
|
||||
public function shouldShowSubscribersProperty() {
|
||||
return true;
|
||||
}
|
||||
|
||||
public function shouldAllowSubscription($phid) {
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
@@ -5,6 +5,7 @@ final class PhamePost extends PhameDAO
|
||||
PhabricatorPolicyInterface,
|
||||
PhabricatorMarkupInterface,
|
||||
PhabricatorApplicationTransactionInterface,
|
||||
PhabricatorSubscribableInterface,
|
||||
PhabricatorTokenReceiverInterface {
|
||||
|
||||
const MARKUP_FIELD_BODY = 'markup:body';
|
||||
@@ -287,4 +288,20 @@ final class PhamePost extends PhameDAO
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
/* -( PhabricatorSubscribableInterface Implementation )-------------------- */
|
||||
|
||||
|
||||
public function isAutomaticallySubscribed($phid) {
|
||||
return ($this->bloggerPHID == $phid);
|
||||
}
|
||||
|
||||
public function shouldShowSubscribersProperty() {
|
||||
return true;
|
||||
}
|
||||
|
||||
public function shouldAllowSubscription($phid) {
|
||||
return true;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user