]> git.mxchange.org Git - quix0rs-gnu-social.git/commitdiff
Fix OStatus groups by making Ostatus_profile::localProfile() work for groups
authorJoshua Judson Rosen <rozzin@geekspace.com>
Sun, 23 Nov 2014 22:42:12 +0000 (17:42 -0500)
committerMikael Nordfeldth <mmn@hethane.se>
Mon, 24 Nov 2014 11:30:37 +0000 (12:30 +0100)
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

index e31378e222ff9eb1b70de815c46bb66ee47c13ac..05842ab05bed66b717d59b41bf27378157a2cac5 100644 (file)
@@ -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;