]> git.mxchange.org Git - quix0rs-gnu-social.git/blobdiff - plugins/OStatus/classes/Ostatus_profile.php
Merge remote-tracking branch 'upstream/master'
[quix0rs-gnu-social.git] / plugins / OStatus / classes / Ostatus_profile.php
index 45c01a568b544842913b338dc4520761b199c777..60033ae03a359fb425b0a8f5b0561b38ffc1566d 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) {
@@ -1922,7 +1930,7 @@ class Ostatus_profile extends Managed_DataObject
         }
 
         // Try looking it up
-        $oprofile = Ostatus_profile::getKV('uri', 'acct:'.$addr);
+        $oprofile = Ostatus_profile::getKV('uri', Discovery::normalize($addr));
 
         if ($oprofile instanceof Ostatus_profile) {
             self::cacheSet(sprintf('ostatus_profile:webfinger:%s', $addr), $oprofile->getUri());
@@ -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;