diff options
author | Mario <mario@mariovavti.com> | 2018-11-05 10:40:29 +0100 |
---|---|---|
committer | Mario <mario@mariovavti.com> | 2018-11-05 10:40:29 +0100 |
commit | d6523c67a64e590de4d5cddc6efeb5b2f8276eec (patch) | |
tree | 831a81b4ad43c07d712f7108a9810d5bbcbeefa9 /include | |
parent | 4320f047dbdabc11d606374c8120affc7f662de4 (diff) | |
parent | 346a4f593332009014fc8b3595bd56c6ca9ff9b5 (diff) | |
download | volse-hubzilla-d6523c67a64e590de4d5cddc6efeb5b2f8276eec.tar.gz volse-hubzilla-d6523c67a64e590de4d5cddc6efeb5b2f8276eec.tar.bz2 volse-hubzilla-d6523c67a64e590de4d5cddc6efeb5b2f8276eec.zip |
Merge branch 'patch-20181028a' into 'dev'
Add timestamp to pconfig
See merge request hubzilla/core!1355
Diffstat (limited to 'include')
-rw-r--r-- | include/config.php | 4 | ||||
-rw-r--r-- | include/zot.php | 37 |
2 files changed, 37 insertions, 4 deletions
diff --git a/include/config.php b/include/config.php index 0be791715..ec3547a82 100644 --- a/include/config.php +++ b/include/config.php @@ -59,8 +59,8 @@ function set_pconfig($uid, $family, $key, $value) { return Zlib\PConfig::Set($uid,$family,$key,$value); } -function del_pconfig($uid, $family, $key) { - return Zlib\PConfig::Delete($uid,$family,$key); +function del_pconfig($uid, $family, $key, $updated = NULL) { + return Zlib\PConfig::Delete($uid,$family,$key,$updated); } function load_xconfig($xchan) { 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); + } + } } |