We are no longer offering accounts on this server. Consider https://gitlab.freedesktop.org/ as a place to host projects.

Commit 75fdef20 authored by Evan Prodromou's avatar Evan Prodromou

handle poco nicknames in Ostatus_profile

parent b79d4ed6
......@@ -832,7 +832,9 @@ class Ostatus_profile extends Memcached_DataObject
protected static function getActivityObjectNickname($object, $hints=array())
{
// XXX: check whatever PoCo calls a nickname first
if (!empty($object->nickname)) {
return common_nicknamize($object->nickname);
}
// Try the definitive ID
......
......@@ -31,6 +31,12 @@ if (!defined('STATUSNET')) {
exit(1);
}
class PoCo
{
const NS = 'http://portablecontacts.net/spec/1.0';
const USERNAME = 'preferredUsername';
}
/**
* Utilities for turning DOMish things into Activityish things
*
......@@ -319,7 +325,8 @@ class ActivityObject
$this->displayName = $this->title;
// @fixme we may have multiple avatars with different resolutions specified
$this->avatar = ActivityUtils::getLink($element, 'avatar');
$this->avatar = ActivityUtils::getLink($element, 'avatar');
$this->nickname = ActivityUtils::childContent($element, PoCo::USERNAME, PoCo::NS);
}
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment