From: Joshua Judson Rosen Date: Sun, 23 Nov 2014 22:42:12 +0000 (-0500) Subject: Fix OStatus groups by making Ostatus_profile::localProfile() work for groups X-Git-Url: https://git.mxchange.org/?a=commitdiff_plain;h=4b875e0fd0f82350362eca23c587312f8934d9d1;p=quix0rs-gnu-social.git Fix OStatus groups by making Ostatus_profile::localProfile() work for groups We need to look up a feed profile for HandleFeedEntryWithProfile events, regardless of whether they're an OStatus user, group, or something else; this is the least hairy way of doing that--the alternative being to keep spreading the same logic all over the calling code. Theoretically, this change might allow OStatusGroups to be recorded as the authors of activities if they pass through any authorless activities; but that's why we have checkAuthorship(). --- diff --git a/plugins/OStatus/classes/Ostatus_profile.php b/plugins/OStatus/classes/Ostatus_profile.php index e31378e222..05842ab05b 100644 --- a/plugins/OStatus/classes/Ostatus_profile.php +++ b/plugins/OStatus/classes/Ostatus_profile.php @@ -88,6 +88,10 @@ class Ostatus_profile extends Managed_DataObject */ public function localProfile() { + if ($this->isGroup()) { + return $this->localGroup()->getProfile(); + } + $profile = Profile::getKV('id', $this->profile_id); if ($profile instanceof Profile) { return $profile;