aboutsummaryrefslogtreecommitdiffstats
path: root/include/channel.php
diff options
context:
space:
mode:
authorMax Kostikov <max@kostikov.co>2020-03-06 10:26:19 +0100
committerMax Kostikov <max@kostikov.co>2020-03-06 10:26:19 +0100
commitae691bdc7cbb684afc2ce6f759a4c1701b019849 (patch)
treeee4bd761efbd1ffd110575a85b4594857f377989 /include/channel.php
parent082826ee444cb1a24306a128c64cb2e7de631291 (diff)
parent85c07d57fe0f468eb8cc84584f3636b590aa929f (diff)
downloadvolse-hubzilla-ae691bdc7cbb684afc2ce6f759a4c1701b019849.tar.gz
volse-hubzilla-ae691bdc7cbb684afc2ce6f759a4c1701b019849.tar.bz2
volse-hubzilla-ae691bdc7cbb684afc2ce6f759a4c1701b019849.zip
Merge branch 'dev' into 'dev'
Sync dev See merge request kostikov/core!1
Diffstat (limited to 'include/channel.php')
-rw-r--r--include/channel.php31
1 files changed, 29 insertions, 2 deletions
diff --git a/include/channel.php b/include/channel.php
index 66ab56715..991d4675b 100644
--- a/include/channel.php
+++ b/include/channel.php
@@ -878,11 +878,38 @@ function identity_basic_export($channel_id, $sections = null, $zap_compat = fals
$ret['abook'] = $r;
for($x = 0; $x < count($ret['abook']); $x ++) {
+
$xchans[] = $ret['abook'][$x]['abook_xchan'];
+ $my_perms = [];
+ $their_perms = [];
+ $newconfig = [];
$abconfig = load_abconfig($channel_id,$ret['abook'][$x]['abook_xchan']);
- if($abconfig)
- $ret['abook'][$x]['abconfig'] = $abconfig;
+ if($abconfig) {
+ foreach ($abconfig as $abc) {
+
+ if ($abc['cat'] === 'my_perms' && intval($abc['v'])) {
+ $my_perms[] = $abc['k'];
+ continue;
+ }
+ if ($abc['cat'] === 'their_perms' && intval($abc['v'])) {
+ $their_perms[] = $abc['k'];
+ continue;
+ }
+ if ($zap_compat && preg_match('|^a:[0-9]+:{.*}$|s', $abc['v'])) {
+ $abc['v'] = serialise(unserialize($abc['v']));
+ }
+ $newconfig[] = $abc;
+ }
+
+ $ret['abook'][$x]['abconfig'] = $newconfig;
+ if ($zap_compat) {
+ $ret['abook'][$x]['abconfig'][] = [ 'chan' => $channel_id, 'xchan' => $ret['abook'][$x]['abook_chan'], 'cat' => 'system', 'k' => 'my_perms', 'v' => implode(',',$my_perms) ];
+ $ret['abook'][$x]['abconfig'][] = [ 'chan' => $channel_id, 'xchan' => $ret['abook'][$x]['abook_chan'], 'cat' => 'system', 'k' => 'their_perms', 'v' => implode(',',$their_perms) ];
+ }
+ }
+
translate_abook_perms_outbound($ret['abook'][$x]);
+
}
// pick up the zot6 xchan and hublocs also