summaryrefslogtreecommitdiff
path: root/lib/activity.php
diff options
context:
space:
mode:
authorBrion Vibber <brion@pobox.com>2010-03-15 12:45:38 -0700
committerBrion Vibber <brion@pobox.com>2010-03-15 12:45:38 -0700
commitc89e1865f7250341c8b5e7878715d5a693a0e6aa (patch)
tree55e68b59dc6b0d7caa63c20b81c85372ba70f18c /lib/activity.php
parent3e2b806e755064d9bcf5ad63faa83329455ffbc2 (diff)
parent7aa49b5e87efa2aa383b446b264f00608f1a5eac (diff)
Merge branch 'testing' into 0.9.x
Diffstat (limited to 'lib/activity.php')
-rw-r--r--lib/activity.php17
1 files changed, 12 insertions, 5 deletions
diff --git a/lib/activity.php b/lib/activity.php
index 125d391b0..6acf37a8a 100644
--- a/lib/activity.php
+++ b/lib/activity.php
@@ -457,7 +457,7 @@ class ActivityUtils
// slavishly following http://atompub.org/rfc4287.html#rfc.section.4.1.3.3
- if ($type == 'text') {
+ if (empty($type) || $type == 'text') {
return $contentEl->textContent;
} else if ($type == 'html') {
$text = $contentEl->textContent;
@@ -476,7 +476,7 @@ class ActivityUtils
$text .= $doc->saveXML($child);
}
return trim($text);
- } else if (in_array(array('text/xml', 'application/xml'), $type) ||
+ } else if (in_array($type, array('text/xml', 'application/xml')) ||
preg_match('#(+|/)xml$#', $type)) {
throw new ClientException(_("Can't handle embedded XML content yet."));
} else if (strncasecmp($type, 'text/', 5)) {
@@ -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);