diff --git a/boot.php b/boot.php
index 194ee6a01..8e42c5fad 100644
--- a/boot.php
+++ b/boot.php
@@ -28,6 +28,7 @@ define ( 'NAMESPACE_THREAD' , 'http://purl.org/syndication/thread/1.0' )
define ( 'NAMESPACE_TOMB' , 'http://purl.org/atompub/tombstones/1.0' );
define ( 'NAMESPACE_ACTIVITY', 'http://activitystrea.ms/spec/1.0/' );
define ( 'NAMESPACE_ACTIVITY_SCHEMA', 'http://activitystrea.ms/schema/1.0/');
+define ( 'NAMESPACE_SALMON_ME', 'http://salmon-protocol.org/ns/magic-env');
define ( 'ACTIVITY_LIKE', NAMESPACE_ACTIVITY_SCHEMA . 'like' );
define ( 'ACTIVITY_DISLIKE', NAMESPACE_DFRN . '/dislike' );
diff --git a/include/items.php b/include/items.php
index 799af48ac..e4376fbee 100644
--- a/include/items.php
+++ b/include/items.php
@@ -127,12 +127,15 @@ function get_feed_for(&$a, $dfrn_id, $owner_id, $last_update, $direction = 0) {
$hubxml = ((strlen($hub)) ? '' . "\n" : '');
+ $salmon = '' . "\n" ;
+ $salmon = ''; // remove this line when salmon handler is finished
$atom .= replace_macros($feed_template, array(
'$feed_id' => xmlify($a->get_baseurl() . '/profile/' . $owner_nick),
'$feed_title' => xmlify($owner['name']),
'$feed_updated' => xmlify(datetime_convert('UTC', 'UTC', $updated . '+00:00' , ATOM_TIME)) ,
'$hub' => $hubxml,
+ '$salmon' => $salmon,
'$name' => xmlify($owner['name']),
'$profile_page' => xmlify($owner['url']),
'$photo' => xmlify($owner['photo']),
diff --git a/include/notifier.php b/include/notifier.php
index f7d2844c3..ce4e5fed4 100644
--- a/include/notifier.php
+++ b/include/notifier.php
@@ -157,6 +157,7 @@
'$feed_title' => xmlify($owner['name']),
'$feed_updated' => xmlify(datetime_convert('UTC', 'UTC', $updated . '+00:00' , ATOM_TIME)) ,
'$hub' => $hubxml,
+ '$salmon' => '', // private feed, we don't use salmon here
'$name' => xmlify($owner['name']),
'$profile_page' => xmlify($owner['url']),
'$photo' => xmlify($owner['photo']),
diff --git a/mod/pubsub.php b/mod/pubsub.php
index 1feb80031..7dea2afb1 100644
--- a/mod/pubsub.php
+++ b/mod/pubsub.php
@@ -87,7 +87,7 @@ function pubsub_post(&$a) {
$debugging = get_config('system','debugging');
if($debugging)
- file_put_contents('pubsub.out',$xml);
+ file_put_contents('pubsub.out',$xml,FILE_APPEND);
$nick = (($a->argc > 1) ? notags(trim($a->argv[1])) : '');
$contact_id = (($a->argc > 2) ? intval($a->argv[2]) : 0);
diff --git a/mod/salmon.php b/mod/salmon.php
new file mode 100644
index 000000000..d68c74658
--- /dev/null
+++ b/mod/salmon.php
@@ -0,0 +1,52 @@
+= 500)
+ $err = 'Error';
+ if($val == 200)
+ $err = 'OK';
+
+ header($_SERVER["SERVER_PROTOCOL"] . ' ' . $val . ' ' . $err);
+ killme();
+
+}
+
+function salmon_post(&$a) {
+
+ $xml = file_get_contents('php://input');
+
+ $debugging = get_config('system','debugging');
+ if($debugging)
+ file_put_contents('salmon.out',$xml,FILE_APPEND);
+
+ $nick = (($a->argc > 1) ? notags(trim($a->argv[1])) : '');
+ $mentions = (($a->argc > 2 && $a->argv[2] === 'mention') ? true : false);
+
+ $r = q("SELECT * FROM `user` WHERE `nickname` = '%s' LIMIT 1",
+ dbesc($nick)
+ );
+ if(! count($r))
+ salmon_return(500);
+
+ $importer = $r[0];
+
+ require_once('include/items.php');
+
+ // Create a fake feed wrapper so simplepie doesn't choke
+
+ $tpl = load_view_file('view/atom_feed.tpl');
+
+ $base = substr($xml,strpos($xml,'';
+
+salmon_return(500); // until the handler is finished
+
+// consume_salmon($xml,$importer);
+
+ salmon_return(200);
+}
+
+
+
diff --git a/mod/xrd.php b/mod/xrd.php
index e60fda48d..d36b47519 100644
--- a/mod/xrd.php
+++ b/mod/xrd.php
@@ -21,7 +21,8 @@ function xrd_content(&$a) {
$o = replace_macros($tpl, array(
'$accturi' => $uri,
'$profile_url' => $a->get_baseurl() . '/profile/' . $r[0]['nickname'],
- '$photo' => $a->get_baseurl() . '/photo/profile/' . $r[0]['uid']
+ '$photo' => $a->get_baseurl() . '/photo/profile/' . $r[0]['uid'],
+ '$salmon' => $a->get_baseurl() . '/salmon/' . $r[0]['nickname'] . '/mention'
));
echo $o;
diff --git a/view/atom_feed.tpl b/view/atom_feed.tpl
index 893d42036..7918c0d09 100644
--- a/view/atom_feed.tpl
+++ b/view/atom_feed.tpl
@@ -11,6 +11,7 @@
Mistpark
$hub
+ $salmon
$feed_updated
diff --git a/view/xrd_person.tpl b/view/xrd_person.tpl
index 121062160..b559bfadc 100644
--- a/view/xrd_person.tpl
+++ b/view/xrd_person.tpl
@@ -14,4 +14,6 @@
href='$profile_url' />
+
+