From: James Walker Date: Fri, 26 Feb 2010 18:17:24 +0000 (-0500) Subject: updating to use latest salmon NS definitions X-Git-Url: https://git.mxchange.org/?a=commitdiff_plain;h=bbb0a7d5bc2c8815a2057eb0a6588d8d60ff4416;p=quix0rs-gnu-social.git updating to use latest salmon NS definitions --- diff --git a/plugins/OStatus/OStatusPlugin.php b/plugins/OStatus/OStatusPlugin.php index 46f986682a..89fa45f910 100644 --- a/plugins/OStatus/OStatusPlugin.php +++ b/plugins/OStatus/OStatusPlugin.php @@ -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; diff --git a/plugins/OStatus/actions/xrd.php b/plugins/OStatus/actions/xrd.php index e6b694d61b..4350ad025a 100644 --- a/plugins/OStatus/actions/xrd.php +++ b/plugins/OStatus/actions/xrd.php @@ -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 diff --git a/plugins/OStatus/classes/Ostatus_profile.php b/plugins/OStatus/classes/Ostatus_profile.php index 091056c541..c6f7378c4c 100644 --- a/plugins/OStatus/classes/Ostatus_profile.php +++ b/plugins/OStatus/classes/Ostatus_profile.php @@ -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: diff --git a/plugins/OStatus/lib/salmon.php b/plugins/OStatus/lib/salmon.php index 9d4359f74f..c59de2a14e 100644 --- a/plugins/OStatus/lib/salmon.php +++ b/plugins/OStatus/lib/salmon.php @@ -28,6 +28,11 @@ */ 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. *