X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=include%2Fdiaspora.php;h=5bf45e241fe1013b230f041bbd7b498918f05eac;hb=dbf51229d9014089eba0da41a55f23c507f7e2ea;hp=18d37c243e212a992419f2de80a0dd09a54f096e;hpb=7f19018cd42963c15f167959e670775cfbca138a;p=friendica.git diff --git a/include/diaspora.php b/include/diaspora.php index 18d37c243e..5bf45e241f 100755 --- a/include/diaspora.php +++ b/include/diaspora.php @@ -559,7 +559,7 @@ function diaspora_decode($importer,$xml) { } - + function diaspora_request($importer,$xml) { $a = get_app(); @@ -569,7 +569,7 @@ function diaspora_request($importer,$xml) { if(! $sender_handle || ! $recipient_handle) return; - + $contact = diaspora_get_contact_by_handle($importer['uid'],$sender_handle); if($contact) { @@ -754,6 +754,20 @@ function diaspora_request($importer,$xml) { } function diaspora_post_allow($importer,$contact) { + + // perhaps we were already sharing with this person. Now they're sharing with us. + // That makes us friends. + // Normally this should have handled by getting a request - but this could get lost + if($contact['rel'] == CONTACT_IS_FOLLOWER && $importer['page-flags'] != PAGE_COMMUNITY) { + q("UPDATE `contact` SET `rel` = %d, `writable` = 1 WHERE `id` = %d AND `uid` = %d LIMIT 1", + intval(CONTACT_IS_FRIEND), + intval($contact['id']), + intval($importer['uid']) + ); + $contact['rel'] = CONTACT_IS_FRIEND; + logger('diaspora_post_allow: defining user '.$contact["nick"].' as friend'); + } + if(($contact['blocked']) || ($contact['readonly']) || ($contact['archive'])) return false; if($contact['rel'] == CONTACT_IS_SHARING || $contact['rel'] == CONTACT_IS_FRIEND)