aboutsummaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
authorfriendica <info@friendica.com>2013-09-08 20:38:15 -0700
committerfriendica <info@friendica.com>2013-09-08 20:38:15 -0700
commite11f2a9b022cbca170e3f1ce5fcd4d17ec63d3c6 (patch)
tree8d47a16194424f885ca68b7bd63980aca8b80007 /include
parentf8c709830fe9268ccf9abe4801eb7a6ca39eff2d (diff)
downloadvolse-hubzilla-e11f2a9b022cbca170e3f1ce5fcd4d17ec63d3c6.tar.gz
volse-hubzilla-e11f2a9b022cbca170e3f1ce5fcd4d17ec63d3c6.tar.bz2
volse-hubzilla-e11f2a9b022cbca170e3f1ce5fcd4d17ec63d3c6.zip
make sure new contacts who are not yet in the address book are sync'd across clone instances
Diffstat (limited to 'include')
-rw-r--r--include/zot.php14
1 files changed, 14 insertions, 0 deletions
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)