aboutsummaryrefslogtreecommitdiffstats
path: root/Zotlabs/Lib/Libzot.php
diff options
context:
space:
mode:
authorMario Vavti <mario@mariovavti.com>2021-10-09 20:08:23 +0200
committerMario Vavti <mario@mariovavti.com>2021-10-09 20:08:23 +0200
commit094536e6339eaba87cc0b372418a50b865fe0a97 (patch)
tree71f8e1f1d421322dbe52ca631e6bd32bd05e8b43 /Zotlabs/Lib/Libzot.php
parent4f2a439873d105b91a5dbbd4dc72d2e2183349a8 (diff)
parent63bdab2b5fd456979587e3c065c274c6475c17b1 (diff)
downloadvolse-hubzilla-094536e6339eaba87cc0b372418a50b865fe0a97.tar.gz
volse-hubzilla-094536e6339eaba87cc0b372418a50b865fe0a97.tar.bz2
volse-hubzilla-094536e6339eaba87cc0b372418a50b865fe0a97.zip
Merge branch 'dev' of https://framagit.org/hubzilla/core into dev
Diffstat (limited to 'Zotlabs/Lib/Libzot.php')
-rw-r--r--Zotlabs/Lib/Libzot.php11
1 files changed, 6 insertions, 5 deletions
diff --git a/Zotlabs/Lib/Libzot.php b/Zotlabs/Lib/Libzot.php
index 200a2c486..31b8f04de 100644
--- a/Zotlabs/Lib/Libzot.php
+++ b/Zotlabs/Lib/Libzot.php
@@ -1486,10 +1486,11 @@ class Libzot {
* @param boolean $relay
* @param boolean $public (optional) default false
* @param boolean $request (optional) default false
+ * @param boolean $force (optional) default false - should only be set for manual fetch
* @return array
*/
- static function process_delivery($sender, $act, $arr, $deliveries, $relay, $public = false, $request = false) {
+ static function process_delivery($sender, $act, $arr, $deliveries, $relay, $public = false, $request = false, $force = false) {
$result = [];
@@ -1591,7 +1592,7 @@ class Libzot {
if ((!$tag_delivery) && (!$local_public)) {
$allowed = (perm_is_allowed($channel['channel_id'], $sender, $perm));
- if (!$allowed) {
+ if ((!$allowed) && $perm === 'post_comments') {
$parent = q("select * from item where mid = '%s' and uid = %d limit 1",
dbesc($arr['parent_mid']),
intval($channel['channel_id'])
@@ -1617,7 +1618,7 @@ class Libzot {
// doesn't exist.
if ($perm === 'send_stream') {
- if (get_pconfig($channel['channel_id'], 'system', 'hyperdrive', false) || $arr['verb'] === ACTIVITY_SHARE) {
+ if ($force || get_pconfig($channel['channel_id'], 'system', 'hyperdrive', false) || $arr['verb'] === ACTIVITY_SHARE) {
$allowed = true;
}
}
@@ -1892,7 +1893,7 @@ class Libzot {
return $result;
}
- static public function fetch_conversation($channel, $mid) {
+ static public function fetch_conversation($channel, $mid, $force = false) {
// Use Zotfinger to create a signed request
@@ -1996,7 +1997,7 @@ class Libzot {
logger('FOF Activity received: ' . print_r($arr, true), LOGGER_DATA, LOG_DEBUG);
logger('FOF Activity recipient: ' . $channel['channel_hash'], LOGGER_DATA, LOG_DEBUG);
- $result = self::process_delivery($arr['owner_xchan'], $AS, $arr, [$channel['channel_hash']], false, false, true);
+ $result = self::process_delivery($arr['owner_xchan'], $AS, $arr, [$channel['channel_hash']], false, false, true, $force);
if ($result) {
$ret = array_merge($ret, $result);
}