]> git.mxchange.org Git - quix0rs-gnu-social.git/blobdiff - plugins/OStatus/classes/Ostatus_profile.php
fetch conversation URI in processPost, not processShare
[quix0rs-gnu-social.git] / plugins / OStatus / classes / Ostatus_profile.php
index d93d8968388edbc764b24487c5a36a76d67e4b67..96ab7f6be72ab4cef7bb78d83ec2f183ab4d5b69 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;
@@ -731,7 +735,7 @@ class Ostatus_profile extends Managed_DataObject
     {
         $notice = null;
 
-        $profile = $this->checkAuthorship($activity, $this->localProfile());
+        $profile = ActivityUtils::checkAuthorship($activity, $this->localProfile());
 
         // It's not always an ActivityObject::NOTE, but... let's just say it is.
 
@@ -844,6 +848,10 @@ class Ostatus_profile extends Managed_DataObject
                     $options['reply_to'] = $orig->id;
                 }
             }
+            if (!empty($activity->context->conversation)) {
+                // we store the URI here, Notice class can look it up later
+                $options['conversation'] = $activity->context->conversation;
+            }
 
             $location = $activity->context->location;
             if ($location) {
@@ -2150,7 +2158,7 @@ class Ostatus_profile extends Managed_DataObject
                 common_log(LOG_WARNING,
                     "OStatus: skipping post with group listed ".
                     "as author: " . $oprofile->getUri() . " in feed from " . $this->getUri());
-                return false;
+                throw new ServerException('Activity author is a non-actor');
             }
         } else {
             $actor = $activity->actor;