this should fix the auto-friend stuff
This commit is contained in:
parent
1e665f4da1
commit
ce2fd23461
@ -272,6 +272,7 @@ function zot_refresh($them,$channel = null) {
|
|||||||
intval($channel['channel_id']),
|
intval($channel['channel_id']),
|
||||||
intval(ABOOK_FLAG_SELF)
|
intval(ABOOK_FLAG_SELF)
|
||||||
);
|
);
|
||||||
|
|
||||||
if($r) {
|
if($r) {
|
||||||
$y = q("update abook set abook_their_perms = %d
|
$y = q("update abook set abook_their_perms = %d
|
||||||
where abook_xchan = '%s' and abook_channel = %d
|
where abook_xchan = '%s' and abook_channel = %d
|
||||||
@ -291,8 +292,9 @@ function zot_refresh($them,$channel = null) {
|
|||||||
intval($channel['channel_id']),
|
intval($channel['channel_id']),
|
||||||
intval(ABOOK_FLAG_SELF)
|
intval(ABOOK_FLAG_SELF)
|
||||||
);
|
);
|
||||||
|
|
||||||
if($z)
|
if($z)
|
||||||
$default_perms = intval($z[0]['my_perms']);
|
$default_perms = intval($z[0]['abook_my_perms']);
|
||||||
|
|
||||||
$y = q("insert into abook ( abook_account, abook_channel, abook_xchan, abook_their_perms, abook_my_perms, abook_created, abook_updated, abook_flags ) values ( %d, %d, '%s', %d, %d, '%s', '%s', %d )",
|
$y = q("insert into abook ( abook_account, abook_channel, abook_xchan, abook_their_perms, abook_my_perms, abook_created, abook_updated, abook_flags ) values ( %d, %d, '%s', %d, %d, '%s', '%s', %d )",
|
||||||
intval($channel['channel_account_id']),
|
intval($channel['channel_account_id']),
|
||||||
@ -304,7 +306,9 @@ function zot_refresh($them,$channel = null) {
|
|||||||
dbesc(datetime_convert()),
|
dbesc(datetime_convert()),
|
||||||
intval(($default_perms) ? 0 : ABOOK_FLAG_PENDING)
|
intval(($default_perms) ? 0 : ABOOK_FLAG_PENDING)
|
||||||
);
|
);
|
||||||
|
|
||||||
if($y) {
|
if($y) {
|
||||||
|
|
||||||
logger("New introduction received for {$channel['channel_name']}");
|
logger("New introduction received for {$channel['channel_name']}");
|
||||||
if($default_perms) {
|
if($default_perms) {
|
||||||
// send back a permissions update for auto-friend/auto-permissions
|
// send back a permissions update for auto-friend/auto-permissions
|
||||||
|
@ -113,7 +113,6 @@ function connections_post(&$a) {
|
|||||||
else
|
else
|
||||||
notice( t('Failed to update connection record.') . EOL);
|
notice( t('Failed to update connection record.') . EOL);
|
||||||
|
|
||||||
|
|
||||||
if((x($a->data,'abook')) && $a->data['abook']['abook_my_perms'] != $abook_my_perms
|
if((x($a->data,'abook')) && $a->data['abook']['abook_my_perms'] != $abook_my_perms
|
||||||
&& (! ($a->data['abook']['abook_flags'] & ABOOK_FLAG_SELF))) {
|
&& (! ($a->data['abook']['abook_flags'] & ABOOK_FLAG_SELF))) {
|
||||||
proc_run('php', 'include/notifier.php', 'permission_update', $contact_id);
|
proc_run('php', 'include/notifier.php', 'permission_update', $contact_id);
|
||||||
|
Reference in New Issue
Block a user