]> git.mxchange.org Git - quix0rs-gnu-social.git/commitdiff
Salmon only has one "rel" value now, so start deprecating
authorMikael Nordfeldth <mmn@hethane.se>
Fri, 1 Nov 2013 16:00:12 +0000 (17:00 +0100)
committerMikael Nordfeldth <mmn@hethane.se>
Fri, 1 Nov 2013 16:00:12 +0000 (17:00 +0100)
plugins/OStatus/OStatusPlugin.php
plugins/OStatus/classes/Ostatus_profile.php
plugins/OStatus/lib/discoveryhints.php
plugins/OStatus/scripts/update-profile.php

index a7aed15067fa4211fa442bbeb96d5e1025658c60..24094ebc693dcd2d12a71609954e1aa33dc50342 100644 (file)
@@ -174,7 +174,7 @@ class OStatusPlugin extends Plugin
             $salmon = common_local_url($salmonAction, array('id' => $id));
             $feed->addLink($salmon, array('rel' => Salmon::REL_SALMON));
 
-            // XXX: these are deprecated
+            // XXX: these are deprecated, but StatusNet only looks for NS_REPLIES
             $feed->addLink($salmon, array('rel' => Salmon::NS_REPLIES));
             $feed->addLink($salmon, array('rel' => Salmon::NS_MENTIONS));
         }
@@ -1323,7 +1323,8 @@ class OStatusPlugin extends Plugin
                                        array('id' => $target->id));
 
         $xrd->links[] = new XML_XRD_Element_Link(Salmon::REL_SALMON, $salmon_url);
-        // XXX : Deprecated - to be removed.
+
+        // XXX: these are deprecated, but StatusNet only looks for NS_REPLIES
         $xrd->links[] = new XML_XRD_Element_Link(Salmon::NS_REPLIES, $salmon_url);
         $xrd->links[] = new XML_XRD_Element_Link(Salmon::NS_MENTIONS, $salmon_url);
 
index 46c73ac48e1f69d725eb6baa339dc3d8ba14f7f8..74e19ce9ebd5ab8785467307f7f8040b403b1964 100644 (file)
@@ -1110,7 +1110,10 @@ class Ostatus_profile extends Managed_DataObject
 
         $huburi = $discover->getHubLink();
         $hints['hub'] = $huburi;
-        $salmonuri = $discover->getAtomLink(Salmon::NS_REPLIES);
+
+        // XXX: NS_REPLIES is deprecated anyway, so let's remove it in the future.
+        $salmonuri = $discover->getAtomLink(Salmon::REL_SALMON)
+                        ?: $discover->getAtomLink(Salmon::NS_REPLIES);
         $hints['salmon'] = $salmonuri;
 
         if (!$huburi && !common_config('feedsub', 'fallback_hub')) {
@@ -1489,7 +1492,9 @@ class Ostatus_profile extends Managed_DataObject
                 $discover = new FeedDiscovery();
                 $discover->discoverFromFeedURL($hints['feedurl']);
             }
-            $salmonuri = $discover->getAtomLink(Salmon::NS_REPLIES);
+            // XXX: NS_REPLIES is deprecated anyway, so let's remove it in the future.
+            $salmonuri = $discover->getAtomLink(Salmon::REL_SALMON)
+                            ?: $discover->getAtomLink(Salmon::NS_REPLIES);
         }
 
         if (array_key_exists('hub', $hints)) {
index ae2d5ad618e99a18d2b036cc5265f336f9413f22..ed37452b5f1655f01197dc41b707c327f69757c6 100644 (file)
@@ -29,8 +29,9 @@ class DiscoveryHints {
             case WebFingerResource::PROFILEPAGE:
                 $hints['profileurl'] = $link->href;
                 break;
-            case Salmon::NS_MENTIONS:
-            case Salmon::NS_REPLIES:
+            case Salmon::REL_SALMON:
+            case Salmon::NS_MENTIONS:   // XXX: deprecated, remove in the future
+            case Salmon::NS_REPLIES:    // XXX: deprecated, remove in the future
                 $hints['salmon'] = $link->href;
                 break;
             case Discovery::UPDATESFROM:
index ff6a149c604c4afee29af0cba7a573b293ed9229..a0d007a8af1191f7bf72c1f973a276ced639b59b 100644 (file)
@@ -56,7 +56,8 @@ print "Re-running feed discovery for profile URL $oprofile->uri\n";
 $discover = new FeedDiscovery();
 $feedurl = $discover->discoverFromURL($oprofile->uri);
 $huburi = $discover->getHubLink();
-$salmonuri = $discover->getAtomLink(Salmon::NS_REPLIES);
+$salmonuri = $discover->getAtomLink(Salmon::REL_SALMON)
+                ?: $discover->getAtomLink(Salmon::NS_REPLIES);
 
 print "  Feed URL: $feedurl\n";
 print "  Hub URL: $huburi\n";