diff options
author | Mario Vavti <mario@mariovavti.com> | 2018-11-14 11:12:20 +0100 |
---|---|---|
committer | Mario Vavti <mario@mariovavti.com> | 2018-11-14 11:12:20 +0100 |
commit | dfc5159aa3c3a9f1190e19ab9a69b21f91d87fd1 (patch) | |
tree | c78eed1693d04fc927c5c2401974010adce14d5e /include/zot.php | |
parent | a9fd3608ea50ec4522075b3315a35c8eed9581d7 (diff) | |
parent | 886cdb440bfb92c28332d482a84e0a2f92333cb1 (diff) | |
download | volse-hubzilla-dfc5159aa3c3a9f1190e19ab9a69b21f91d87fd1.tar.gz volse-hubzilla-dfc5159aa3c3a9f1190e19ab9a69b21f91d87fd1.tar.bz2 volse-hubzilla-dfc5159aa3c3a9f1190e19ab9a69b21f91d87fd1.zip |
Merge branch 'dev'
Diffstat (limited to 'include/zot.php')
-rw-r--r-- | include/zot.php | 37 |
1 files changed, 35 insertions, 2 deletions
diff --git a/include/zot.php b/include/zot.php index 1a632cf87..49fc89e33 100644 --- a/include/zot.php +++ b/include/zot.php @@ -3507,8 +3507,41 @@ function process_channel_sync_delivery($sender, $arr, $deliveries) { if(array_key_exists('config',$arr) && is_array($arr['config']) && count($arr['config'])) { foreach($arr['config'] as $cat => $k) { - foreach($arr['config'][$cat] as $k => $v) - set_pconfig($channel['channel_id'],$cat,$k,$v); + + $pconfig_updated = []; + $pconfig_del = []; + + foreach($arr['config'][$cat] as $k => $v) { + + if (strpos($k,'pcfgud:')===0) { + + $realk = substr($k,7); + $pconfig_updated[$realk] = $v; + unset($arr['config'][$cat][$k]); + + } + + if (strpos($k,'pcfgdel:')===0) { + $realk = substr($k,8); + $pconfig_del[$realk] = datetime_convert(); + unset($arr['config'][$cat][$k]); + } + } + + foreach($arr['config'][$cat] as $k => $v) { + + if (!isset($pconfig_updated[$k])) { + $pconfig_updated[$k] = NULL; + } + + set_pconfig($channel['channel_id'],$cat,$k,$v,$pconfig_updated[$k]); + + } + + foreach($pconfig_del as $k => $updated) { + del_pconfig($channel['channel_id'],$cat,$k,$updated); + } + } } |