]> git.mxchange.org Git - quix0rs-gnu-social.git/commitdiff
updating to use latest salmon NS definitions
authorJames Walker <walkah@walkah.net>
Fri, 26 Feb 2010 18:17:24 +0000 (13:17 -0500)
committerJames Walker <walkah@walkah.net>
Fri, 26 Feb 2010 19:22:49 +0000 (14:22 -0500)
plugins/OStatus/OStatusPlugin.php
plugins/OStatus/actions/xrd.php
plugins/OStatus/classes/Ostatus_profile.php
plugins/OStatus/lib/salmon.php

index 46f986682afe28e00c39f2861051f3bc2370209c..89fa45f91004be0b80f76118826645859d4ab457 100644 (file)
@@ -149,7 +149,8 @@ class OStatusPlugin extends Plugin
 
             // Also, we'll add in the salmon link
             $salmon = common_local_url($salmonAction, array('id' => $id));
-            $feed->addLink($salmon, array('rel' => 'salmon'));
+            $feed->addLink($salmon, array('rel' => Salmon::NS_REPLIES));
+            $feed->addLink($salmon, array('rel' => Salmon::NS_MENTIONS));
         }
 
         return true;
index e6b694d61b083eb9d4167afd3d7289d9c413fcd9..4350ad025a19ad7202e76cfe4da6212ba56edfb9 100644 (file)
@@ -80,10 +80,14 @@ class XrdAction extends Action
                               'href' => common_local_url('foaf',
                                                          array('nickname' => $nick)));
 
-        $salmon_url = common_local_url('salmon',
+        // Salmon
+        $salmon_url = common_local_url('usersalmon',
                                        array('id' => $this->user->id));
 
-        $xrd->links[] = array('rel' => 'salmon',
+        $xrd->links[] = array('rel' => Salmon::NS_REPLIES,
+                              'href' => $salmon_url);
+
+        $xrd->links[] = array('rel' => Salmon::NS_MENTIONS,
                               'href' => $salmon_url);
 
         // Get this user's keypair
index 091056c54180a4c6624a256a0de6cc8c535571ac..c6f7378c4c208d8a4c599ecfbf01fab116322c08 100644 (file)
@@ -707,7 +707,7 @@ class Ostatus_profile extends Memcached_DataObject
 
         $huburi = $discover->getAtomLink('hub');
         $hints['hub'] = $huburi;
-        $salmonuri = $discover->getAtomLink('salmon');
+        $salmonuri = $discover->getAtomLink(Salmon::NS_REPLIES);
         $hints['salmon'] = $salmonuri;
 
         if (!$huburi) {
@@ -991,7 +991,7 @@ class Ostatus_profile extends Memcached_DataObject
                 $discover = new FeedDiscovery();
                 $discover->discoverFromFeedURL($hints['feedurl']);
             }
-            $salmonuri = $discover->getAtomLink('salmon');
+            $salmonuri = $discover->getAtomLink(Salmon::NS_REPLIES);
         }
 
         if (array_key_exists('hub', $hints)) {
@@ -1299,7 +1299,7 @@ class Ostatus_profile extends Memcached_DataObject
             case Discovery::PROFILEPAGE:
                 $profileUrl = $link['href'];
                 break;
-            case 'salmon':
+            case Salmon::NS_REPLIES:
                 $salmonEndpoint = $link['href'];
                 break;
             case Discovery::UPDATESFROM:
index 9d4359f74f5e5c875b7faabd6d7a823bdeb7f013..c59de2a14eb0013f1466426969d5b7fd17cd20c3 100644 (file)
  */
 class Salmon
 {
+
+    const NS_REPLIES = "http://salmon-protocol.org/ns/salmon-replies";
+
+    const NS_MENTIONS = "http://salmon-protocol.org/ns/salmon-mention";
+    
     /**
      * Sign and post the given Atom entry as a Salmon message.
      *