make sure new contacts who are not yet in the address book are sync'd across clone instances
This commit is contained in:
parent
f8c709830f
commit
e11f2a9b02
@ -1745,6 +1745,20 @@ function process_channel_sync_delivery($sender,$arr,$deliveries) {
|
|||||||
if(! array_key_exists('abook_xchan',$clean))
|
if(! array_key_exists('abook_xchan',$clean))
|
||||||
continue;
|
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)) {
|
if(count($clean)) {
|
||||||
foreach($clean as $k => $v) {
|
foreach($clean as $k => $v) {
|
||||||
$r = dbq("UPDATE abook set " . dbesc($k) . " = '" . dbesc($v)
|
$r = dbq("UPDATE abook set " . dbesc($k) . " = '" . dbesc($v)
|
||||||
|
Reference in New Issue
Block a user