]> git.mxchange.org Git - friendica.git/commitdiff
Set the picture accesibility separate from the permissions
authorMichael <heluecht@pirati.ca>
Wed, 11 Mar 2020 21:36:29 +0000 (21:36 +0000)
committerMichael <heluecht@pirati.ca>
Wed, 11 Mar 2020 21:36:29 +0000 (21:36 +0000)
src/Model/Photo.php

index 2ac95e952dd8165a42f228694b5cb80bcad7bf25..67c4fa2ea390ca563a19b67cc4de54f95d5f772b 100644 (file)
@@ -655,6 +655,12 @@ class Photo
                                continue;
                        }
 
+                       if (DI::pConfig()->get($uid, 'system', 'accessible-photos')) {
+                               $condition = ['resource-id' => $image_rid, 'uid' => $uid];
+                               Logger::info('Set accessibility', ['condition' => $condition]);
+                               Photo::update(['accessible' => true], $condition);
+                       }
+
                        // Ensure to only modify photos that you own
                        $srch = '<' . intval($original_contact_id) . '>';
 
@@ -677,10 +683,6 @@ class Photo
                        $fields = ['allow_cid' => $str_contact_allow, 'allow_gid' => $str_group_allow,
                                        'deny_cid' => $str_contact_deny, 'deny_gid' => $str_group_deny];
 
-                       if (DI::pConfig()->get($uid, 'system', 'accessible-photos')) {
-                               $fields['accessible'] = true;
-                       }
-
                        $condition = ['resource-id' => $image_rid, 'uid' => $uid];
                        Logger::info('Set permissions', ['condition' => $condition, 'permissions' => $fields]);
                        Photo::update($fields, $condition);