1
0
Fork 0
mirror of https://we.phorge.it/source/phorge.git synced 2025-03-08 18:34:47 +01:00

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:
Chad Little 2015-07-22 07:00:36 -07:00
parent 6be53bd916
commit 1985ef390b
3 changed files with 37 additions and 0 deletions

View file

@ -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',

View file

@ -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;
}
}

View file

@ -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;
}
}