aboutsummaryrefslogtreecommitdiffstats
path: root/Zotlabs/Lib
diff options
context:
space:
mode:
authorMario <mario@mariovavti.com>2021-12-21 09:09:43 +0000
committerMario <mario@mariovavti.com>2021-12-21 09:09:43 +0000
commiteee027d9ffe89ff48ab6c573f9aa96a33b81b4c9 (patch)
treef9a5818de3c83767f34450f7f6833598cd6f10e9 /Zotlabs/Lib
parent1b1fb5d26ac0d0b72d15cb57c337979c1ba15388 (diff)
parentc36e0805d813121f0587c9f2d585fb32bfd346fa (diff)
downloadvolse-hubzilla-eee027d9ffe89ff48ab6c573f9aa96a33b81b4c9.tar.gz
volse-hubzilla-eee027d9ffe89ff48ab6c573f9aa96a33b81b4c9.tar.bz2
volse-hubzilla-eee027d9ffe89ff48ab6c573f9aa96a33b81b4c9.zip
Merge branch 'dev' of https://framagit.org/hubzilla/core into dev
Diffstat (limited to 'Zotlabs/Lib')
-rw-r--r--Zotlabs/Lib/Libsync.php31
1 files changed, 29 insertions, 2 deletions
diff --git a/Zotlabs/Lib/Libsync.php b/Zotlabs/Lib/Libsync.php
index ef10e8046..36a0a044c 100644
--- a/Zotlabs/Lib/Libsync.php
+++ b/Zotlabs/Lib/Libsync.php
@@ -230,8 +230,35 @@ class Libsync {
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 = [];
+
+ foreach($arr['config'][$cat] as $k => $v) {
+ if ($cat === 'hz_delpconfig' && strpos($k, 'b64.') === 0) {
+ $delpconfig = explode(':', unpack_link_id($k));
+
+ // delete the provided pconfig
+ del_pconfig($channel['channel_id'], $delpconfig[0], $delpconfig[1], $v);
+
+ // delete the messenger pconfig
+ del_pconfig($channel['channel_id'], 'hz_delpconfig', $k);
+ }
+
+ if (strpos($k,'pcfgud:') === 0) {
+ $realk = substr($k,7);
+ $pconfig_updated[$realk] = $v;
+ unset($arr['config'][$cat][$k]);
+ }
+ }
+
+ foreach($arr['config'][$cat] as $k => $v) {
+ if (!isset($pconfig_updated[$k])) {
+ $pconfig_updated[$k] = NULL;
+ }
+
+ if ($cat !== 'hz_delpconfig') {
+ set_pconfig($channel['channel_id'],$cat,$k,$v,$pconfig_updated[$k]);
+ }
+ }
}
}