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
This commit is contained in:
parent
480dac1af2
commit
b5683bfac4
@ -709,13 +709,19 @@ function diaspora_request($importer,$xml) {
|
||||
|
||||
$their_perms = PERMS_R_STREAM|PERMS_R_PROFILE|PERMS_R_PHOTOS|PERMS_R_ABOOK|PERMS_W_STREAM|PERMS_W_COMMENT|PERMS_W_MAIL|PERMS_W_CHAT|PERMS_R_STORAGE|PERMS_R_PAGES;
|
||||
|
||||
|
||||
$closeness = get_pconfig($importer['channel_id'],'system','new_abook_closeness');
|
||||
if($closeness === false)
|
||||
$closeness = 80;
|
||||
|
||||
|
||||
$r = q("insert into abook ( abook_account, abook_channel, abook_xchan, abook_my_perms, abook_their_perms, abook_closeness, abook_rating, abook_created, abook_updated, abook_connected, abook_dob, abook_flags) values ( %d, %d, '%s', %d, %d, %d, %d, '%s', '%s', '%s', '%s', %d )",
|
||||
intval($importer['channel_account_id']),
|
||||
intval($importer['channel_id']),
|
||||
dbesc($ret['xchan_hash']),
|
||||
intval($default_perms),
|
||||
intval($their_perms),
|
||||
intval(99),
|
||||
intval($closeness),
|
||||
intval(0),
|
||||
dbesc(datetime_convert()),
|
||||
dbesc(datetime_convert()),
|
||||
|
@ -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),
|
||||
|
@ -464,9 +464,15 @@ function zot_refresh($them,$channel = null, $force = false) {
|
||||
// Keep original perms to check if we need to notify them
|
||||
$previous_perms = get_all_perms($channel['channel_id'],$x['hash']);
|
||||
|
||||
$y = q("insert into abook ( abook_account, abook_channel, abook_xchan, abook_their_perms, abook_my_perms, abook_created, abook_updated, abook_dob, abook_flags ) values ( %d, %d, '%s', %d, %d, '%s', '%s', '%s', %d )",
|
||||
|
||||
$closeness = get_pconfig($channel['channel_id'],'system','new_abook_closeness');
|
||||
if($closeness === false)
|
||||
$closeness = 80;
|
||||
|
||||
$y = q("insert into abook ( abook_account, abook_channel, abook_closeness, abook_xchan, abook_their_perms, abook_my_perms, abook_created, abook_updated, abook_dob, abook_flags ) values ( %d, %d, '%s', %d, %d, '%s', '%s', '%s', %d )",
|
||||
intval($channel['channel_account_id']),
|
||||
intval($channel['channel_id']),
|
||||
intval($closeness),
|
||||
dbesc($x['hash']),
|
||||
intval($their_perms),
|
||||
intval($default_perms),
|
||||
|
@ -1 +1 @@
|
||||
2015-03-07.964
|
||||
2015-03-08.965
|
||||
|
Reference in New Issue
Block a user