]> git.mxchange.org Git - quix0rs-gnu-social.git/blobdiff - lib/activity.php
move check for bad IDs from activityobject to activity and make simpler
[quix0rs-gnu-social.git] / lib / activity.php
index f9192c6b80061d4c5caeddfc07f16083e0ab7135..5d6230c6df623ac9000d76aa92d6d9dac1929622 100644 (file)
@@ -179,6 +179,17 @@ class Activity
 
             $this->actor = new ActivityObject($actorEl);
 
+            // Cliqset has bad actor IDs (just nickname of user). We
+            // work around it by getting the author data and using its
+            // id instead
+
+            if (!preg_match('/^\w+:/', $this->actor->id)) {
+                $authorEl = ActivityUtils::child($entry, 'author');
+                if (!empty($authorEl)) {
+                    $authorObj = new ActivityObject($authorEl);
+                    $this->actor->id = $authorObj->id;
+                }
+            }
         } else if (!empty($feed) &&
                    $subjectEl = $this->_child($feed, self::SUBJECT)) {