X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=actions%2Ffoaf.php;h=dd274706981584fb063d20c965d1e11a9047331a;hb=81b4a381d9ddc71ed8a53c074ea10910882d3156;hp=fb0172eb90d4236137501c407b6366b8d28fa4c0;hpb=bb3361467c002e38aa3a424672f332b32a647e17;p=quix0rs-gnu-social.git diff --git a/actions/foaf.php b/actions/foaf.php index fb0172eb90..dd27470698 100644 --- a/actions/foaf.php +++ b/actions/foaf.php @@ -1,7 +1,7 @@ . */ -if (!defined('LACONICA')) { exit(1); } +if (!defined('STATUSNET') && !defined('LACONICA')) { exit(1); } define('LISTENER', 1); define('LISTENEE', -1); @@ -136,7 +136,7 @@ class FoafAction extends Action $person = $this->showMicrobloggingAccount($this->profile, common_root_url(), $this->user->uri, false); - // Get people who subscribe to user + // Get users who subscribe to user $sub = new Subscription(); $sub->subscribed = $this->profile->id; @@ -146,8 +146,10 @@ class FoafAction extends Action while ($sub->fetch()) { if ($sub->token) { $other = Remote_profile::staticGet('id', $sub->subscriber); + $profile = Profile::staticGet('id', $sub->subscriber); } else { $other = User::staticGet('id', $sub->subscriber); + $profile = Profile::staticGet('id', $sub->subscriber); } if (!$other) { common_debug('Got a bad subscription: '.print_r($sub,true)); @@ -158,12 +160,15 @@ class FoafAction extends Action } else { $person[$other->uri] = array(LISTENER, $other->id, - $other->nickname, + $profile->nickname, (empty($sub->token)) ? 'User' : 'Remote_profile'); } $other->free(); $other = null; unset($other); + $profile->free(); + $profile = null; + unset($profile); } } @@ -245,7 +250,7 @@ class FoafAction extends Action if ($isSubscriber) { $this->element('sioc:follows', array('rdf:resource'=>$this->user->uri . '#acct')); } else { - // Get people user is subscribed to + // Get users user is subscribed to $sub = new Subscription(); $sub->subscriber = $profile->id; $sub->whereAdd('subscriber != subscribed'); @@ -254,8 +259,10 @@ class FoafAction extends Action while ($sub->fetch()) { if (!empty($sub->token)) { $other = Remote_profile::staticGet('id', $sub->subscribed); + $profile = Profile::staticGet('id', $sub->subscribed); } else { $other = User::staticGet('id', $sub->subscribed); + $profile = Profile::staticGet('id', $sub->subscribed); } if (empty($other)) { common_debug('Got a bad subscription: '.print_r($sub,true)); @@ -264,11 +271,14 @@ class FoafAction extends Action $this->element('sioc:follows', array('rdf:resource' => $other->uri.'#acct')); $person[$other->uri] = array(LISTENEE, $other->id, - $other->nickname, + $profile->nickname, (empty($sub->token)) ? 'User' : 'Remote_profile'); $other->free(); $other = null; unset($other); + $profile->free(); + $profile = null; + unset($profile); } }