aboutsummaryrefslogtreecommitdiffstats
path: root/include/salmon.php
diff options
context:
space:
mode:
authorMike Macgirvin <mike@macgirvin.com>2010-10-25 21:52:30 -0700
committerMike Macgirvin <mike@macgirvin.com>2010-10-25 21:52:30 -0700
commitc16f314ec348205f4741e0171335168720e652d2 (patch)
tree008aaaf38da2b478eca0a91a0cf4de7bb08dd26f /include/salmon.php
parent1335ef759522ef9f877c8e8fd806cf9bba36297d (diff)
downloadvolse-hubzilla-c16f314ec348205f4741e0171335168720e652d2.tar.gz
volse-hubzilla-c16f314ec348205f4741e0171335168720e652d2.tar.bz2
volse-hubzilla-c16f314ec348205f4741e0171335168720e652d2.zip
two-way subscriptions working with federated social accounts
Diffstat (limited to 'include/salmon.php')
-rw-r--r--include/salmon.php13
1 files changed, 10 insertions, 3 deletions
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('<entry>',$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