ostatus:conversation element instead of link rel=""
Mainly because the atom:link element requires a "web resource" but we wish to supply a URI which might not be HTTP. We'll leave the old atom:link element however since it's in the OStatus 1.0 Draft2 docs and nothing newer has been released yet.
This commit is contained in:
parent
a3ded586b6
commit
343291262e
@ -627,6 +627,14 @@ class Activity
|
|||||||
if (!empty($this->context->conversation)) {
|
if (!empty($this->context->conversation)) {
|
||||||
$xs->element('link', array('rel' => ActivityContext::CONVERSATION,
|
$xs->element('link', array('rel' => ActivityContext::CONVERSATION,
|
||||||
'href' => $this->context->conversation));
|
'href' => $this->context->conversation));
|
||||||
|
$xs->element(ActivityContext::CONVERSATION, null, $this->context->conversation);
|
||||||
|
/* Since we use XMLWriter we just use the previously hardcoded prefix for ostatus,
|
||||||
|
otherwise we should use something like this:
|
||||||
|
$xs->elementNS(array(ActivityContext::OSTATUS => 'ostatus'), // namespace
|
||||||
|
'conversation', // tag (or the element name from ActivityContext::CONVERSATION)
|
||||||
|
null, // attributes
|
||||||
|
$this->context->conversation); // content
|
||||||
|
*/
|
||||||
}
|
}
|
||||||
|
|
||||||
foreach ($this->context->attention as $attnURI=>$type) {
|
foreach ($this->context->attention as $attnURI=>$type) {
|
||||||
|
@ -48,12 +48,14 @@ class ActivityContext
|
|||||||
const INREPLYTO = 'in-reply-to';
|
const INREPLYTO = 'in-reply-to';
|
||||||
const REF = 'ref';
|
const REF = 'ref';
|
||||||
const HREF = 'href';
|
const HREF = 'href';
|
||||||
|
|
||||||
|
// OStatus element names with prefixes
|
||||||
const OBJECTTYPE = 'ostatus:object-type'; // FIXME: Undocumented!
|
const OBJECTTYPE = 'ostatus:object-type'; // FIXME: Undocumented!
|
||||||
|
const CONVERSATION = 'ostatus:conversation';
|
||||||
|
|
||||||
const POINT = 'point';
|
const POINT = 'point';
|
||||||
|
|
||||||
const MENTIONED = 'mentioned';
|
const MENTIONED = 'mentioned';
|
||||||
const CONVERSATION = 'ostatus:conversation';
|
|
||||||
|
|
||||||
const ATTN_PUBLIC = 'http://activityschema.org/collection/public';
|
const ATTN_PUBLIC = 'http://activityschema.org/collection/public';
|
||||||
|
|
||||||
@ -72,7 +74,14 @@ class ActivityContext
|
|||||||
|
|
||||||
$this->location = $this->getLocation($element);
|
$this->location = $this->getLocation($element);
|
||||||
|
|
||||||
$this->conversation = ActivityUtils::getLink($element, self::CONVERSATION);
|
$convs = $element->getElementsByTagNameNS(self::OSTATUS, self::CONVERSATION);
|
||||||
|
foreach ($convs as $conv) {
|
||||||
|
$this->conversation = $conv->textContent;
|
||||||
|
}
|
||||||
|
if (empty($this->conversation)) {
|
||||||
|
// fallback to the atom:link rel="ostatus:conversation" element
|
||||||
|
$this->conversation = ActivityUtils::getLink($element, self::CONVERSATION);
|
||||||
|
}
|
||||||
|
|
||||||
// Multiple attention links allowed
|
// Multiple attention links allowed
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user