aboutsummaryrefslogtreecommitdiffstats
path: root/include/zot.php
diff options
context:
space:
mode:
authorM.Dent <dentm42@dm42.net>2018-10-28 17:23:31 -0400
committerM.Dent <dentm42@dm42.net>2018-10-28 17:23:31 -0400
commit3ab0ef1902a9ff1f33cf5540a866745dc98a11a9 (patch)
tree523ac2eeede1cb9c1ded36bbc1e58f5735d09a5a /include/zot.php
parentc7c35b8b5a64e44f01e7557a43d13e518dc62aa8 (diff)
downloadvolse-hubzilla-3ab0ef1902a9ff1f33cf5540a866745dc98a11a9.tar.gz
volse-hubzilla-3ab0ef1902a9ff1f33cf5540a866745dc98a11a9.tar.bz2
volse-hubzilla-3ab0ef1902a9ff1f33cf5540a866745dc98a11a9.zip
Add timestamp and associated logic to pconfig
Diffstat (limited to 'include/zot.php')
-rw-r--r--include/zot.php37
1 files changed, 35 insertions, 2 deletions
diff --git a/include/zot.php b/include/zot.php
index 1a632cf87..a5202d01b 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] = $v;
+ 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);
+ }
+
}
}