summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJames Walker <walkah@walkah.net>2010-08-02 14:06:14 -0400
committerJames Walker <walkah@walkah.net>2010-08-02 14:06:14 -0400
commite603632f13e87aa2671bd5ff732c4858ce44ef6e (patch)
treea9b0c00f9bda8fc18d9df1e299500b6a433c6765
parent517c7483d1b55fcc78b1d69e8ffd7de763faa772 (diff)
add support for Salmon's new "mentioned" rel value
-rw-r--r--classes/Notice.php14
-rw-r--r--lib/activitycontext.php5
2 files changed, 19 insertions, 0 deletions
diff --git a/classes/Notice.php b/classes/Notice.php
index 3297c7a59..399879e79 100644
--- a/classes/Notice.php
+++ b/classes/Notice.php
@@ -1330,24 +1330,38 @@ class Notice extends Memcached_DataObject
foreach ($reply_ids as $id) {
$profile = Profile::staticGet('id', $id);
if (!empty($profile)) {
+ // XXX: Deprecate this for 'mentioned'
$xs->element(
'link', array(
'rel' => 'ostatus:attention',
'href' => $profile->getUri()
)
);
+ $xs->element(
+ 'link', array(
+ 'rel' => 'mentioned',
+ 'href' => $profile->getUri()
+ )
+ );
}
}
$groups = $this->getGroups();
foreach ($groups as $group) {
+ // XXX: Deprecate this for 'mentioned'
$xs->element(
'link', array(
'rel' => 'ostatus:attention',
'href' => $group->permalink()
)
);
+ $xs->element(
+ 'link', array(
+ 'rel' => 'mentioned',
+ 'href' => $group->permalink()
+ )
+ );
}
if (!empty($this->repeat_of)) {
diff --git a/lib/activitycontext.php b/lib/activitycontext.php
index 2df7613f7..4e97b2ab9 100644
--- a/lib/activitycontext.php
+++ b/lib/activitycontext.php
@@ -51,6 +51,7 @@ class ActivityContext
const POINT = 'point';
const ATTENTION = 'ostatus:attention';
+ const MENTIONED = 'mentioned';
const CONVERSATION = 'ostatus:conversation';
function __construct($element)
@@ -76,8 +77,12 @@ class ActivityContext
$linkRel = $link->getAttribute(ActivityUtils::REL);
+ // XXX: Deprecate this in favour of "mentioned" from Salmon spec
+ // http://salmon-protocol.googlecode.com/svn/trunk/draft-panzer-salmon-00.html#SALR
if ($linkRel == self::ATTENTION) {
$this->attention[] = $link->getAttribute(self::HREF);
+ } else if ($linkRel == self:MENTIONED) {
+ $this->attention[] = $link->getAttribute(self::HREF);
}
}
}