From c16f314ec348205f4741e0171335168720e652d2 Mon Sep 17 00:00:00 2001 From: Mike Macgirvin Date: Mon, 25 Oct 2010 21:52:30 -0700 Subject: two-way subscriptions working with federated social accounts --- include/salmon.php | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) (limited to 'include/salmon.php') diff --git a/include/salmon.php b/include/salmon.php index c5ad3e825..7f4c32265 100644 --- a/include/salmon.php +++ b/include/salmon.php @@ -105,7 +105,8 @@ $namespaces = <<< EOT xmlns:media="http://purl.org/syndication/atommedia" xmlns:dfrn="http://purl.org/macgirvin/dfrn/1.0" xmlns:as="http://activitystrea.ms/spec/1.0/" - xmlns:georss="http://www.georss.org/georss" > + xmlns:georss="http://www.georss.org/georss" + xmlns:poco="http://portablecontacts.net/spec/1.0" > EOT; $slap = str_replace('',$namespaces,$slap); @@ -129,7 +130,7 @@ EOT; $rsa->setHash('sha256'); $rsa->loadKey($owner['sprvkey']); - $signature = $rsa->sign($data); + $signature = base64url_encode($rsa->sign($data)); $salmon_tpl = load_view_file('view/magicsig.tpl'); $salmon = replace_macros($salmon_tpl,array( @@ -141,7 +142,13 @@ EOT; )); // slap them - post_url($contact['notify'],$salmon); + post_url($contact['notify'],$salmon, array( + 'Content-type: application/magic-envelope+xml', + 'Content-length: ' . strlen($salmon) + )); + $a = get_app(); + echo "CURL returned: " . $a->get_curl_code() . "\n"; + return; } \ No newline at end of file -- cgit v1.2.3