aboutsummaryrefslogtreecommitdiffstats
path: root/include/diaspora.php
diff options
context:
space:
mode:
authorfriendica <info@friendica.com>2014-09-09 21:38:51 -0700
committerfriendica <info@friendica.com>2014-09-09 21:38:51 -0700
commitc02554ad36bc26bd96137388ac0e339909ef7ece (patch)
treecccd21c81f3ab66e55d1ef1da07933ec8271905f /include/diaspora.php
parent89b65e554cbf00ac78de6f1e0edebe63417c4538 (diff)
downloadvolse-hubzilla-c02554ad36bc26bd96137388ac0e339909ef7ece.tar.gz
volse-hubzilla-c02554ad36bc26bd96137388ac0e339909ef7ece.tar.bz2
volse-hubzilla-c02554ad36bc26bd96137388ac0e339909ef7ece.zip
some fixes for auto-perms across networks
Diffstat (limited to 'include/diaspora.php')
-rwxr-xr-xinclude/diaspora.php18
1 files changed, 9 insertions, 9 deletions
diff --git a/include/diaspora.php b/include/diaspora.php
index 1d0896936..0c15bfd46 100755
--- a/include/diaspora.php
+++ b/include/diaspora.php
@@ -708,7 +708,7 @@ function diaspora_request($importer,$xml) {
if($r) {
logger("New Diaspora introduction received for {$importer['channel_name']}");
- $new_connection = q("select * from abook left join xchan on abook_xchan = xchan_hash where abook_channel = %d and abook_xchan = '%s' order by abook_created desc limit 1",
+ $new_connection = q("select * from abook left join xchan on abook_xchan = xchan_hash left join hubloc on hubloc_hash = xchan_hash where abook_channel = %d and abook_xchan = '%s' order by abook_created desc limit 1",
intval($importer['channel_id']),
dbesc($ret['xchan_hash'])
);
@@ -723,7 +723,7 @@ function diaspora_request($importer,$xml) {
if($default_perms) {
// Send back a sharing notification to them
- diaspora_share($importer['channel_id'],$new_connection[0]);
+ diaspora_share($importer,$new_connection[0]);
}
}
@@ -2156,9 +2156,9 @@ function diaspora_profile($importer,$xml,$msg) {
}
-function diaspora_share($me,$contact) {
+function diaspora_share($owner,$contact) {
$a = get_app();
- $myaddr = $me['channel_address'] . '@' . substr($a->get_baseurl(), strpos($a->get_baseurl(),'://') + 3);
+ $myaddr = $owner['channel_address'] . '@' . substr($a->get_baseurl(), strpos($a->get_baseurl(),'://') + 3);
if(! array_key_exists('xchan_hash',$contact)) {
$c = q("select * from xchan left join hubloc on xchan_hash = hubloc_hash where xchan_hash = '%s' limit 1",
@@ -2179,23 +2179,23 @@ function diaspora_share($me,$contact) {
'$recipient' => $theiraddr
));
- $slap = 'xml=' . urlencode(urlencode(diaspora_msg_build($msg,$me,$contact,$me['channel_prvkey'],$contact['xchan_pubkey'])));
+ $slap = 'xml=' . urlencode(urlencode(diaspora_msg_build($msg,$owner,$contact,$owner['channel_prvkey'],$contact['xchan_pubkey'])));
return(diaspora_transmit($owner,$contact,$slap, false));
}
-function diaspora_unshare($me,$contact) {
+function diaspora_unshare($owner,$contact) {
$a = get_app();
- $myaddr = $me['channel_address'] . '@' . substr($a->get_baseurl(), strpos($a->get_baseurl(),'://') + 3);
+ $myaddr = $owner['channel_address'] . '@' . substr($a->get_baseurl(), strpos($a->get_baseurl(),'://') + 3);
$tpl = get_markup_template('diaspora_retract.tpl');
$msg = replace_macros($tpl, array(
- '$guid' => $me['channel_guid'],
+ '$guid' => $owner['channel_guid'],
'$type' => 'Person',
'$handle' => $myaddr
));
- $slap = 'xml=' . urlencode(urlencode(diaspora_msg_build($msg,$me,$contact,$me['channel_prvkey'],$contact['xchan_pubkey'])));
+ $slap = 'xml=' . urlencode(urlencode(diaspora_msg_build($msg,$owner,$contact,$owner['channel_prvkey'],$contact['xchan_pubkey'])));
return(diaspora_transmit($owner,$contact,$slap, false));
}