aboutsummaryrefslogtreecommitdiffstats
path: root/include/conversation.php
diff options
context:
space:
mode:
authorMario <mario@mariovavti.com>2024-09-18 09:34:10 +0000
committerMario <mario@mariovavti.com>2024-09-18 09:34:10 +0000
commite79958978122596e0b0beb89b843b055fb02893e (patch)
tree09f7f4941a9af5acfbc9ca215a1f91e66eab9a4d /include/conversation.php
parent10acf90d06f6b5162430bc7a8cf51ba0d343f6a0 (diff)
downloadvolse-hubzilla-e79958978122596e0b0beb89b843b055fb02893e.tar.gz
volse-hubzilla-e79958978122596e0b0beb89b843b055fb02893e.tar.bz2
volse-hubzilla-e79958978122596e0b0beb89b843b055fb02893e.zip
allow uploading to comments if ocap tokens are enabled
Diffstat (limited to 'include/conversation.php')
-rw-r--r--include/conversation.php20
1 files changed, 13 insertions, 7 deletions
diff --git a/include/conversation.php b/include/conversation.php
index b3ba96a82..ee599c28d 100644
--- a/include/conversation.php
+++ b/include/conversation.php
@@ -3,6 +3,7 @@
use Zotlabs\Lib\Activity;
use Zotlabs\Lib\Apps;
use Zotlabs\Lib\Config;
+use Zotlabs\Lib\PConfig;
require_once('include/items.php');
@@ -438,17 +439,22 @@ function conversation($items, $mode, $update, $page_mode = 'traditional', $prepa
$uploading = false;
- if(local_channel()) {
- $cur_channel = App::get_channel();
- if($cur_channel['channel_allow_cid'] === '' && $cur_channel['channel_allow_gid'] === ''
- && $cur_channel['channel_deny_cid'] === '' && $cur_channel['channel_deny_gid'] === ''
+ $channel = App::get_channel();
+ $observer = App::get_observer();
+
+ if (local_channel()) {
+ // Allow uploading if there is no default privacy and the view_storage permission is set to PERMS_PUBLIC
+ if ($channel['channel_allow_cid'] === '' && $channel['channel_allow_gid'] === ''
+ && $channel['channel_deny_cid'] === '' && $channel['channel_deny_gid'] === ''
&& intval(\Zotlabs\Access\PermissionLimits::Get(local_channel(),'view_storage')) === PERMS_PUBLIC) {
$uploading = true;
}
- }
- $channel = App::get_channel();
- $observer = App::get_observer();
+ // Allow uploading if OCAP tokens are enabled
+ if (PConfig::Get(local_channel(), 'system', 'ocap_enabled')) {
+ $uploading = true;
+ }
+ }
if (!$update) {
$_SESSION['return_url'] = App::$query_string;