aboutsummaryrefslogtreecommitdiffstats
path: root/Zotlabs/Lib/Libzot.php
diff options
context:
space:
mode:
authorMario Vavti <mario@mariovavti.com>2021-01-25 21:52:29 +0100
committerMario Vavti <mario@mariovavti.com>2021-01-25 21:52:29 +0100
commit4cf05891d7790716f273aaceb59db248d27b80cb (patch)
tree3008bfb9a776b3ef35ff25ee229d6b8cd263cb7a /Zotlabs/Lib/Libzot.php
parentd4198223bc1fd06e9b9fe969edb5d03811889def (diff)
parent1b4bbcc89113b10a43ab7010b9d00d8bedb52e64 (diff)
downloadvolse-hubzilla-4cf05891d7790716f273aaceb59db248d27b80cb.tar.gz
volse-hubzilla-4cf05891d7790716f273aaceb59db248d27b80cb.tar.bz2
volse-hubzilla-4cf05891d7790716f273aaceb59db248d27b80cb.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.php15
1 files changed, 10 insertions, 5 deletions
diff --git a/Zotlabs/Lib/Libzot.php b/Zotlabs/Lib/Libzot.php
index ee1f54ec8..13a75bb6c 100644
--- a/Zotlabs/Lib/Libzot.php
+++ b/Zotlabs/Lib/Libzot.php
@@ -1235,8 +1235,14 @@ class Libzot {
if (is_array($AS->obj) && array_key_exists('commentPolicy', $AS->obj)) {
$p = strstr($AS->obj['commentPolicy'], 'until=');
if ($p !== false) {
- $arr['comments_closed'] = datetime_convert('UTC', 'UTC', substr($p, 6));
- $arr['comment_policy'] = trim(str_replace($p, '', $AS->obj['commentPolicy']));
+ $comments_closed_at = datetime_convert('UTC', 'UTC', substr($p, 6));
+ if ($comments_closed_at === $arr['created']) {
+ $arr['item_nocomment'] = 1;
+ }
+ else {
+ $arr['comments_closed'] = $comments_closed_at;
+ $arr['comment_policy'] = trim(str_replace($p, '', $AS->obj['commentPolicy']));
+ }
}
else {
$arr['comment_policy'] = $AS->obj['commentPolicy'];
@@ -1545,8 +1551,7 @@ class Libzot {
}
$tag_delivery = tgroup_check($channel['channel_id'], $arr);
-
- $perm = 'send_stream';
+ $perm = 'send_stream';
if (($arr['mid'] !== $arr['parent_mid']) && ($relay))
$perm = 'post_comments';
@@ -1563,7 +1568,7 @@ class Libzot {
if ((!$tag_delivery) && (!$local_public)) {
$allowed = (perm_is_allowed($channel['channel_id'], $sender, $perm));
- if ((!$allowed) && $perm === 'post_comments') {
+ if (!$allowed) {
$parent = q("select * from item where mid = '%s' and uid = %d limit 1",
dbesc($arr['parent_mid']),
intval($channel['channel_id'])