aboutsummaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
authorFriendika <info@friendika.com>2011-08-14 20:38:31 -0700
committerFriendika <info@friendika.com>2011-08-14 20:38:31 -0700
commit0729e205c8149f5634b8622654a09382b50ec678 (patch)
tree3ed2e2725ebd97aa9b9a473e9c025d02483d1f02 /include
parent79529612226dc89b90df33ba066a530d0e716a69 (diff)
downloadvolse-hubzilla-0729e205c8149f5634b8622654a09382b50ec678.tar.gz
volse-hubzilla-0729e205c8149f5634b8622654a09382b50ec678.tar.bz2
volse-hubzilla-0729e205c8149f5634b8622654a09382b50ec678.zip
diaspora follow from friendika
Diffstat (limited to 'include')
-rw-r--r--include/diaspora.php25
1 files changed, 23 insertions, 2 deletions
diff --git a/include/diaspora.php b/include/diaspora.php
index 3310e6d32..d8be2b2cc 100644
--- a/include/diaspora.php
+++ b/include/diaspora.php
@@ -77,7 +77,7 @@ $decrypted_header = <<< EOT
<iv>$b_inner_iv</iv>
<aes_key>$b_inner_aes_key</aes_key>
<author>
- <name>{$contact['name']}</name>
+ <name>{$user['username']}</name>
<uri>$handle</uri>
</author>
</decrypted_header>
@@ -170,7 +170,7 @@ function diaspora_decode($importer,$xml) {
if(! $base) {
logger('mod-diaspora: unable to locate salmon data in xml ');
- dt_return(400);
+ http_status_exit(400);
}
@@ -519,3 +519,24 @@ function diaspora_retraction($importer,$contact,$xml) {
}
+function diaspora_share($me,$contact) {
+ $a = get_app();
+ $myaddr = $me['nickname'] . '@' . substr($a->get_baseurl(), strpos($a->get_baseurl(),'://') + 3);
+ $theiraddr = $contact['addr'];
+
+ $tpl = get_markup_template('diaspora_share.tpl');
+ $msg = replace_macros($tpl, array(
+ '$sender' => myaddr,
+ '$recipient' => $theiraddr
+ ));
+
+ $slap = diaspora_msg_build($msg,$me,$contact,$me['prvkey'],$contact['pubkey']);
+
+ post_url($contact['notify'],$slap, array(
+ 'Content-type: application/magic-envelope+xml',
+ 'Content-length: ' . strlen($slap)
+ ));
+ $return_code = $a->get_curl_code();
+ return $return_code;
+}
+