]> git.mxchange.org Git - quix0rs-gnu-social.git/commitdiff
every user is subscribed to themselves
authorEvan Prodromou <evan@prodromou.name>
Tue, 22 Jul 2008 14:41:54 +0000 (10:41 -0400)
committerEvan Prodromou <evan@prodromou.name>
Tue, 22 Jul 2008 14:41:54 +0000 (10:41 -0400)
darcs-hash:20080722144154-84dde-80beabad9a681f2e12edb34ceb4ac249f4ce6705.gz

actions/register.php
actions/showstream.php
actions/subscribers.php
actions/subscriptions.php

index 0832b084786391ce041bfbe28fe9cd30e579e8f8..6ac28305953fc7b1644c48bdcb297ea984cf1fff 100644 (file)
@@ -159,6 +159,20 @@ class RegisterAction extends Action {
                        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) {
 
                        $confirm = new Confirm_address();
index bccdd3cc86bc8160367d8ca1bd7509c14d44048a..87858e14b35ee3c593a5fe41335bf482e7e02c20 100644 (file)
@@ -205,6 +205,8 @@ class ShowstreamAction extends StreamAction {
 
                $subs = DB_DataObject::factory('subscription');
                $subs->subscriber = $profile->id;
+               $subs->whereAdd('subscribed != ' . $profile->id);
+               
                $subs->orderBy('created DESC');
 
                # We ask for an extra one to know if we need to do another page
index de2090cf116dfda0b7c640d82e03e4fb01570ae5..2cc82d4571d3b6bf54e9e304411017b6e56aebd2 100644 (file)
@@ -38,6 +38,7 @@ class SubscribersAction extends GalleryAction {
 
        function define_subs(&$subs, &$profile) {
                $subs->subscribed = $profile->id;
+               $subs->whereAdd('subscriber != ' . $profile->id);
        }
 
        function div_class() {
index e0643e0dc428f2341664377d709fb148bec9668b..5566acb41da0c3ecf9e73e21667c9f8acbc72e10 100644 (file)
@@ -38,6 +38,7 @@ class SubscriptionsAction extends GalleryAction {
 
        function define_subs(&$subs, &$profile) {
                $subs->subscriber = $profile->id;
+               $subs->whereAdd('subscribed != ' . $profile->id);
        }
 
        function div_class() {