X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=lib%2Factivitycontext.php;h=32f15c1e9f963d8afa48d4e852b2067fafce2a44;hb=da2f179ae97766b32f84d8180068830a605c9510;hp=cebd72ea9078573fb53e3ab2aa22b9c8af45f716;hpb=23a6b4595f37ba523594b57cdd3932e9ed02c2da;p=quix0rs-gnu-social.git diff --git a/lib/activitycontext.php b/lib/activitycontext.php index cebd72ea90..32f15c1e9f 100644 --- a/lib/activitycontext.php +++ b/lib/activitycontext.php @@ -48,12 +48,14 @@ class ActivityContext 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 = 'ostatus:conversation'; const POINT = 'point'; const MENTIONED = 'mentioned'; - const CONVERSATION = 'ostatus:conversation'; const ATTN_PUBLIC = 'http://activityschema.org/collection/public'; @@ -72,7 +74,14 @@ class ActivityContext $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