From b5683bfac4fd5e0e6cc15995c5c4f574e54e33da Mon Sep 17 00:00:00 2001 From: friendica Date: Sun, 8 Mar 2015 14:11:38 -0700 Subject: change default affinity (abook_closeness) to 80 for all new connections going forward (was 99). This way it can be adjusted down later without requiring you to change all your existing connections upward (since your existing connections are likely all sitting at 99 at the moment). The default setting is also configurable with a pconfig system.new_abook_closeness --- include/follow.php | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) (limited to 'include/follow.php') diff --git a/include/follow.php b/include/follow.php index 2d6791420..e13b5f775 100644 --- a/include/follow.php +++ b/include/follow.php @@ -227,10 +227,16 @@ function new_contact($uid,$url,$channel,$interactive = false, $confirm = false) ); } else { - $r = q("insert into abook ( abook_account, abook_channel, abook_xchan, abook_flags, abook_their_perms, abook_my_perms, abook_created, abook_updated ) + + $closeness = get_pconfig($uid,'system','new_abook_closeness'); + if($closeness === false) + $closeness = 80; + + $r = q("insert into abook ( abook_account, abook_channel, abook_closeness, abook_xchan, abook_flags, abook_their_perms, abook_my_perms, abook_created, abook_updated ) values( %d, %d, '%s', %d, %d, %d, '%s', '%s' ) ", intval($aid), intval($uid), + intval($closeness), dbesc($xchan_hash), intval(($is_http) ? ABOOK_FLAG_FEED : 0), intval(($is_http) ? $their_perms|PERMS_R_STREAM|PERMS_A_REPUBLISH : $their_perms), -- cgit v1.2.3 From 904596c7da50f63fd23c9008c97f6cc86d8c8697 Mon Sep 17 00:00:00 2001 From: Alexandre Hannud Abdo Date: Mon, 9 Mar 2015 03:07:48 -0300 Subject: Fix missing value in insert for default closeness --- include/follow.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'include/follow.php') diff --git a/include/follow.php b/include/follow.php index e13b5f775..fd4e1597a 100644 --- a/include/follow.php +++ b/include/follow.php @@ -233,7 +233,7 @@ function new_contact($uid,$url,$channel,$interactive = false, $confirm = false) $closeness = 80; $r = q("insert into abook ( abook_account, abook_channel, abook_closeness, abook_xchan, abook_flags, abook_their_perms, abook_my_perms, abook_created, abook_updated ) - values( %d, %d, '%s', %d, %d, %d, '%s', '%s' ) ", + values( %d, %d, %d, '%s', %d, %d, %d, '%s', '%s' ) ", intval($aid), intval($uid), intval($closeness), -- cgit v1.2.3