every user is subscribed to themselves

darcs-hash:20080722144154-84dde-80beabad9a681f2e12edb34ceb4ac249f4ce6705.gz
This commit is contained in:
Evan Prodromou 2008-07-22 10:41:54 -04:00
parent 5f79bcdf51
commit ab1f2ff9d0
4 changed files with 18 additions and 0 deletions

View File

@ -159,6 +159,20 @@ class RegisterAction extends Action {
return FALSE; return FALSE;
} }
# Everyone is subscribed to themself
$subscription = new Subscription();
$subscription->subscriber = $user->id;
$subscription->subscribed = $user->id;
$subscription->created = $user->created;
$result = $subscription->insert();
if (!$result) {
common_log_db_error($subscription, 'INSERT', __FILE__);
return FALSE;
}
if ($email) { if ($email) {
$confirm = new Confirm_address(); $confirm = new Confirm_address();

View File

@ -205,6 +205,8 @@ class ShowstreamAction extends StreamAction {
$subs = DB_DataObject::factory('subscription'); $subs = DB_DataObject::factory('subscription');
$subs->subscriber = $profile->id; $subs->subscriber = $profile->id;
$subs->whereAdd('subscribed != ' . $profile->id);
$subs->orderBy('created DESC'); $subs->orderBy('created DESC');
# We ask for an extra one to know if we need to do another page # We ask for an extra one to know if we need to do another page

View File

@ -38,6 +38,7 @@ class SubscribersAction extends GalleryAction {
function define_subs(&$subs, &$profile) { function define_subs(&$subs, &$profile) {
$subs->subscribed = $profile->id; $subs->subscribed = $profile->id;
$subs->whereAdd('subscriber != ' . $profile->id);
} }
function div_class() { function div_class() {

View File

@ -38,6 +38,7 @@ class SubscriptionsAction extends GalleryAction {
function define_subs(&$subs, &$profile) { function define_subs(&$subs, &$profile) {
$subs->subscriber = $profile->id; $subs->subscriber = $profile->id;
$subs->whereAdd('subscribed != ' . $profile->id);
} }
function div_class() { function div_class() {