]> git.mxchange.org Git - quix0rs-gnu-social.git/commitdiff
add support for Salmon's new "mentioned" rel value
authorJames Walker <walkah@walkah.net>
Mon, 2 Aug 2010 18:06:14 +0000 (14:06 -0400)
committerJames Walker <walkah@walkah.net>
Mon, 2 Aug 2010 18:06:14 +0000 (14:06 -0400)
classes/Notice.php
lib/activitycontext.php

index 3297c7a59e0fa1c06bcacbe1dc1f1f42b143f705..399879e7911c51c8e5f24b417bfb178d54348b7b 100644 (file)
@@ -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)) {
index 2df7613f7d90385be94a481db18de4c29342ea0e..4e97b2ab98cad034433ada0d7d4679045d19fdb4 100644 (file)
@@ -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);
             }
         }
     }