public $location;
public $attention = array(); // 'uri' => 'type'
public $conversation;
+ public $conversation_url;
public $scope;
const THR = 'http://purl.org/syndication/thread/1.0';
const INREPLYTO = 'in-reply-to';
const REF = 'ref';
const HREF = 'href';
+
+ // OStatus element names with prefixes
const OBJECTTYPE = 'ostatus:object-type'; // FIXME: Undocumented!
+ const CONVERSATION = 'conversation';
const POINT = 'point';
const MENTIONED = 'mentioned';
- const CONVERSATION = 'ostatus:conversation';
const ATTN_PUBLIC = 'http://activityschema.org/collection/public';
$this->location = $this->getLocation($element);
- $this->conversation = ActivityUtils::getLink($element, self::CONVERSATION);
+ foreach ($element->getElementsByTagNameNS(self::OSTATUS, self::CONVERSATION) as $conv) {
+ if ($conv->hasAttribute('ref')) {
+ $this->conversation = $conv->getAttribute('ref');
+ if ($conv->hasAttribute('href')) {
+ $this->conversation_url = $conv->getAttribute('href');
+ }
+ } else {
+ $this->conversation = $conv->textContent;
+ }
+ if (!empty($this->conversation)) {
+ break;
+ }
+ }
+ if (empty($this->conversation)) {
+ // fallback to the atom:link rel="ostatus:conversation" element
+ $this->conversation = ActivityUtils::getLink($element, 'ostatus:'.self::CONVERSATION);
+ }
// Multiple attention links allowed
$context['inReplyTo'] = $this->getInReplyToArray();
$context['conversation'] = $this->conversation;
+ $context['conversation_url'] = $this->conversation_url;
return array_filter($context);
}