aboutsummaryrefslogtreecommitdiffstats
path: root/Zotlabs/Lib
diff options
context:
space:
mode:
authorMario <mario@mariovavti.com>2020-09-19 19:19:03 +0000
committerMario <mario@mariovavti.com>2020-09-19 19:19:03 +0000
commit9c8d73208123a2566aa44db4dfe53201cc8cb3ab (patch)
treeac93cd9835f04c2202f882f3ba8a60cb1941f499 /Zotlabs/Lib
parente9227b0ffe5ab40e61ee083ae07bbaad278b190c (diff)
downloadvolse-hubzilla-9c8d73208123a2566aa44db4dfe53201cc8cb3ab.tar.gz
volse-hubzilla-9c8d73208123a2566aa44db4dfe53201cc8cb3ab.tar.bz2
volse-hubzilla-9c8d73208123a2566aa44db4dfe53201cc8cb3ab.zip
5.0RC testing: their_perms should be reset before they are recreated. Otherwise withdrawn permissions will not take effect locally.
Diffstat (limited to 'Zotlabs/Lib')
-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');
}