summaryrefslogtreecommitdiff
path: root/plugins/OStatus/lib
diff options
context:
space:
mode:
Diffstat (limited to 'plugins/OStatus/lib')
-rw-r--r--plugins/OStatus/lib/activity.php18
-rw-r--r--plugins/OStatus/lib/feedmunger.php9
2 files changed, 20 insertions, 7 deletions
diff --git a/plugins/OStatus/lib/activity.php b/plugins/OStatus/lib/activity.php
index 3d02e3584..f137946ab 100644
--- a/plugins/OStatus/lib/activity.php
+++ b/plugins/OStatus/lib/activity.php
@@ -106,12 +106,16 @@ class ActivityUtils
static function child($element, $tag, $namespace=self::ATOM)
{
- $els = $element->getElementsByTagnameNS($namespace, $tag);
-
+ $els = $element->childNodes;
if (empty($els) || $els->length == 0) {
return null;
} else {
- return $els->item(0);
+ for ($i = 0; $i < $els->length; $i++) {
+ $el = $els->item($i);
+ if ($el->localName == $tag && $el->namespaceURI == $namespace) {
+ return $el;
+ }
+ }
}
}
@@ -243,6 +247,14 @@ class ActivityObject
// XXX: grab PoCo stuff
}
+
+ // Some per-type attributes...
+ if ($this->type == self::PERSON || $this->type == self::GROUP) {
+ $this->displayName = $this->title;
+
+ // @fixme we may have multiple avatars with different resolutions specified
+ $this->avatar = ActivityUtils::getLink($element, 'avatar');
+ }
}
private function _childContent($element, $tag, $namespace=ActivityUtils::ATOM)
diff --git a/plugins/OStatus/lib/feedmunger.php b/plugins/OStatus/lib/feedmunger.php
index c895b6ce2..e8c46de90 100644
--- a/plugins/OStatus/lib/feedmunger.php
+++ b/plugins/OStatus/lib/feedmunger.php
@@ -258,11 +258,12 @@ class FeedMunger
{
// hack hack hack
// should get profile for this entry's author...
- $remote = Ostatus_profile::staticGet('feeduri', $this->getSelfLink());
- if ($feed) {
- return $feed->profile_id;
+ $feeduri = $this->getSelfLink();
+ $remote = Ostatus_profile::staticGet('feeduri', $feeduri);
+ if ($remote) {
+ return $remote->profile_id;
} else {
- throw new Exception("Can't find feed profile");
+ throw new Exception("Can't find feed profile for $feeduri");
}
}