aboutsummaryrefslogtreecommitdiffstats
path: root/Zotlabs
diff options
context:
space:
mode:
authorMario <mario@mariovavti.com>2020-09-19 19:19:03 +0000
committerMario <mario@mariovavti.com>2020-09-19 22:34:32 +0200
commit521a5074c9266b8e0a89ea3c1ad352c7e84128da (patch)
tree47026f4c8141fbab37290389c740e5a4c8ac510f /Zotlabs
parent430c48e8280857d96df343f1035fd22254f04ad7 (diff)
downloadvolse-hubzilla-521a5074c9266b8e0a89ea3c1ad352c7e84128da.tar.gz
volse-hubzilla-521a5074c9266b8e0a89ea3c1ad352c7e84128da.tar.bz2
volse-hubzilla-521a5074c9266b8e0a89ea3c1ad352c7e84128da.zip
5.0RC testing: their_perms should be reset before they are recreated. Otherwise withdrawn permissions will not take effect locally.
(cherry picked from commit 9c8d73208123a2566aa44db4dfe53201cc8cb3ab)
Diffstat (limited to 'Zotlabs')
-rw-r--r--Zotlabs/Lib/Libzot.php8
1 files changed, 8 insertions, 0 deletions
diff --git a/Zotlabs/Lib/Libzot.php b/Zotlabs/Lib/Libzot.php
index dda6d5d95..f4eb26463 100644
--- a/Zotlabs/Lib/Libzot.php
+++ b/Zotlabs/Lib/Libzot.php
@@ -316,14 +316,22 @@ class Libzot {
$x = self::import_xchan($record['data'], (($force) ? UPDATE_FLAGS_FORCED : UPDATE_FLAGS_UPDATED));
+
if(! $x['success'])
return false;
if($channel && $record['data']['permissions']) {
$permissions = explode(',',$record['data']['permissions']);
+
if($permissions && is_array($permissions)) {
$old_read_stream_perm = get_abconfig($channel['channel_id'],$x['hash'],'their_perms','view_stream');
+ // We need to reset their_perms prior to setting the new ones.
+ // Otherwise withdrawn permissions will not take effect locally.
+ q("DELETE FROM abconfig WHERE chan = %d AND xchan = '%s' AND cat = 'their_perms'",
+ intval($channel['channel_id']),
+ dbesc($x['hash'])
+ );
foreach($permissions as $p) {
set_abconfig($channel['channel_id'],$x['hash'],'their_perms',$p,'1');
}