From e11f2a9b022cbca170e3f1ce5fcd4d17ec63d3c6 Mon Sep 17 00:00:00 2001 From: friendica Date: Sun, 8 Sep 2013 20:38:15 -0700 Subject: make sure new contacts who are not yet in the address book are sync'd across clone instances --- include/zot.php | 14 ++++++++++++++ 1 file changed, 14 insertions(+) (limited to 'include') diff --git a/include/zot.php b/include/zot.php index 33522b485..46c894351 100644 --- a/include/zot.php +++ b/include/zot.php @@ -1745,6 +1745,20 @@ function process_channel_sync_delivery($sender,$arr,$deliveries) { if(! array_key_exists('abook_xchan',$clean)) continue; + $r = q("select * from abook where abook_xchan = '%s' and abook_channel = %d limit 1", + dbesc($clean['abook_xchan']), + intval($channel['channel_id']) + ); + + // make sure we have an abook entry for this xchan on this system + + if(! $r) { + q("insert into abook ( abook_xchan, abook_channel ) values ('%s', %d ) ", + dbesc($clean['abook_xchan']), + intval($channel['channel_id']) + ); + } + if(count($clean)) { foreach($clean as $k => $v) { $r = dbq("UPDATE abook set " . dbesc($k) . " = '" . dbesc($v) -- cgit v1.2.3