updating to use latest salmon NS definitions

This commit is contained in:
James Walker 2010-02-26 13:17:24 -05:00
parent fc576562a3
commit bbb0a7d5bc
4 changed files with 16 additions and 6 deletions

View File

@ -149,7 +149,8 @@ class OStatusPlugin extends Plugin
// Also, we'll add in the salmon link // Also, we'll add in the salmon link
$salmon = common_local_url($salmonAction, array('id' => $id)); $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; return true;

View File

@ -80,10 +80,14 @@ class XrdAction extends Action
'href' => common_local_url('foaf', 'href' => common_local_url('foaf',
array('nickname' => $nick))); array('nickname' => $nick)));
$salmon_url = common_local_url('salmon', // Salmon
$salmon_url = common_local_url('usersalmon',
array('id' => $this->user->id)); 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); 'href' => $salmon_url);
// Get this user's keypair // Get this user's keypair

View File

@ -707,7 +707,7 @@ class Ostatus_profile extends Memcached_DataObject
$huburi = $discover->getAtomLink('hub'); $huburi = $discover->getAtomLink('hub');
$hints['hub'] = $huburi; $hints['hub'] = $huburi;
$salmonuri = $discover->getAtomLink('salmon'); $salmonuri = $discover->getAtomLink(Salmon::NS_REPLIES);
$hints['salmon'] = $salmonuri; $hints['salmon'] = $salmonuri;
if (!$huburi) { if (!$huburi) {
@ -991,7 +991,7 @@ class Ostatus_profile extends Memcached_DataObject
$discover = new FeedDiscovery(); $discover = new FeedDiscovery();
$discover->discoverFromFeedURL($hints['feedurl']); $discover->discoverFromFeedURL($hints['feedurl']);
} }
$salmonuri = $discover->getAtomLink('salmon'); $salmonuri = $discover->getAtomLink(Salmon::NS_REPLIES);
} }
if (array_key_exists('hub', $hints)) { if (array_key_exists('hub', $hints)) {
@ -1299,7 +1299,7 @@ class Ostatus_profile extends Memcached_DataObject
case Discovery::PROFILEPAGE: case Discovery::PROFILEPAGE:
$profileUrl = $link['href']; $profileUrl = $link['href'];
break; break;
case 'salmon': case Salmon::NS_REPLIES:
$salmonEndpoint = $link['href']; $salmonEndpoint = $link['href'];
break; break;
case Discovery::UPDATESFROM: case Discovery::UPDATESFROM:

View File

@ -28,6 +28,11 @@
*/ */
class Salmon 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. * Sign and post the given Atom entry as a Salmon message.
* *