From 4b875e0fd0f82350362eca23c587312f8934d9d1 Mon Sep 17 00:00:00 2001 From: Joshua Judson Rosen Date: Sun, 23 Nov 2014 17:42:12 -0500 Subject: [PATCH] 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(). --- plugins/OStatus/classes/Ostatus_profile.php | 4 ++++ 1 file changed, 4 insertions(+) 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; -- 2.39.2