Merge pull request #4033 from annando/diaspora-autofriend

Possible fix for issue 4013
This commit is contained in:
Hypolite Petovan 2017-12-07 16:12:49 -05:00 committed by GitHub
commit 16140c8f9f
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -992,16 +992,18 @@ class Diaspora
* That makes us friends.
* Normally this should have handled by getting a request - but this could get lost
*/
if ($contact["rel"] == CONTACT_IS_FOLLOWER && in_array($importer["page-flags"], array(PAGE_FREELOVE))) {
dba::update(
'contact',
array('rel' => CONTACT_IS_FRIEND, 'writable' => true),
array('id' => $contact["id"], 'uid' => $contact["uid"])
);
$contact["rel"] = CONTACT_IS_FRIEND;
logger("defining user ".$contact["nick"]." as friend");
}
// It is deactivated by now, due to side effects. See issue https://github.com/friendica/friendica/pull/4033
// It is not removed by now. Possibly the code is needed?
//if (!$is_comment && $contact["rel"] == CONTACT_IS_FOLLOWER && in_array($importer["page-flags"], array(PAGE_FREELOVE))) {
// dba::update(
// 'contact',
// array('rel' => CONTACT_IS_FRIEND, 'writable' => true),
// array('id' => $contact["id"], 'uid' => $contact["uid"])
// );
//
// $contact["rel"] = CONTACT_IS_FRIEND;
// logger("defining user ".$contact["nick"]." as friend");
//}
// We don't seem to like that person
if ($contact["blocked"] || $contact["readonly"] || $contact["archive"]) {