summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJames Walker <walkah@walkah.net>2010-03-14 12:57:24 -0400
committerJames Walker <walkah@walkah.net>2010-03-14 12:57:24 -0400
commitc4f89b06f1e7fe969e049c7dfe672bdfd6e5c8f9 (patch)
treef7e10de8c4ab82f172600b21e70e5989dd3c3d98
parent85cf90cf0fb613bab38ce8e0142544a044fe0d1d (diff)
give preference to rel="photo" (per latest ActivityStreams spec), but still support rel="avatar" for compat
-rw-r--r--lib/activity.php13
1 files changed, 10 insertions, 3 deletions
diff --git a/lib/activity.php b/lib/activity.php
index 738200c0b..6acf37a8a 100644
--- a/lib/activity.php
+++ b/lib/activity.php
@@ -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);