]> git.mxchange.org Git - quix0rs-gnu-social.git/commitdiff
give preference to rel="photo" (per latest ActivityStreams spec), but still support...
authorJames Walker <walkah@walkah.net>
Sun, 14 Mar 2010 16:57:24 +0000 (12:57 -0400)
committerJames Walker <walkah@walkah.net>
Sun, 14 Mar 2010 16:57:24 +0000 (12:57 -0400)
lib/activity.php

index 738200c0bfd4af563b6b9edc7fe025b38f190562..6acf37a8a20e4986362cf1871e35489fa23f7a16 100644 (file)
@@ -681,9 +681,16 @@ class ActivityObject
         if ($this->type == self::PERSON || $this->type == self::GROUP) {
             $this->displayName = $this->title;
 
-            $avatars = ActivityUtils::getLinks($element, 'avatar');
-            foreach ($avatars as $link) {
-                $this->avatarLinks[] = new AvatarLink($link);
+            $photos = ActivityUtils::getLinks($element, 'photo');
+            if (count($photos)) {
+                foreach ($photos as $link) {
+                    $this->avatarLinks[] = new AvatarLink($link);
+                }
+            } else {
+                $avatars = ActivityUtils::getLinks($element, 'avatar');
+                foreach ($avatars as $link) {
+                    $this->avatarLinks[] = new AvatarLink($link);
+                }
             }
 
             $this->poco = new PoCo($element);