diff options
author | Mario <mario@mariovavti.com> | 2020-09-19 19:19:03 +0000 |
---|---|---|
committer | Mario <mario@mariovavti.com> | 2020-09-19 22:34:32 +0200 |
commit | 521a5074c9266b8e0a89ea3c1ad352c7e84128da (patch) | |
tree | 47026f4c8141fbab37290389c740e5a4c8ac510f /Zotlabs | |
parent | 430c48e8280857d96df343f1035fd22254f04ad7 (diff) | |
download | volse-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.php | 8 |
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'); } |