aboutsummaryrefslogtreecommitdiffstats
path: root/Zotlabs
diff options
context:
space:
mode:
authorMario <mario@mariovavti.com>2024-12-06 19:24:14 +0000
committerMario <mario@mariovavti.com>2024-12-06 19:24:14 +0000
commit66d502d8e1f958fd3fcff3e6c8991b9720c69bc4 (patch)
tree4befc3ef77069bc13cec711d2ce7386cefd114a6 /Zotlabs
parent66acfc66ce832bc2749d7af78b8985da7018a9a8 (diff)
downloadvolse-hubzilla-66d502d8e1f958fd3fcff3e6c8991b9720c69bc4.tar.gz
volse-hubzilla-66d502d8e1f958fd3fcff3e6c8991b9720c69bc4.tar.bz2
volse-hubzilla-66d502d8e1f958fd3fcff3e6c8991b9720c69bc4.zip
an attempt to fix some comments on/off anomalies
Diffstat (limited to 'Zotlabs')
-rw-r--r--Zotlabs/Lib/Activity.php6
-rw-r--r--Zotlabs/Lib/Libzot.php3
-rw-r--r--Zotlabs/Module/Item.php6
3 files changed, 10 insertions, 5 deletions
diff --git a/Zotlabs/Lib/Activity.php b/Zotlabs/Lib/Activity.php
index d5620d7c6..8ff26389d 100644
--- a/Zotlabs/Lib/Activity.php
+++ b/Zotlabs/Lib/Activity.php
@@ -2306,6 +2306,8 @@ class Activity {
if ($s['mid'] === $s['parent_mid']) {
$s['item_thread_top'] = 1;
+ $s['item_nocomment'] = 0;
+ $s['comments_closed'] = NULL_DATE;
// it is a parent node - decode the comment policy info if present
if ($act->objprop('commentPolicy')) {
@@ -2313,7 +2315,7 @@ class Activity {
if ($until !== false) {
$s['comments_closed'] = datetime_convert('UTC', 'UTC', substr($act->obj['commentPolicy'], $until + 6));
if ($s['comments_closed'] < datetime_convert()) {
- $s['nocomment'] = true;
+ $s['item_nocomment'] = 1;
}
}
@@ -3803,6 +3805,7 @@ class Activity {
->setPrivate($sourceItem['item_private'])
->setRestrict($sourceItem['item_restrict'])
->setNocomment($sourceItem['item_nocomment'])
+ ->setCommentsClosed($sourceItem['comments_closed'])
->setType($sourceItem['item_type'])
->setCommentPolicy($sourceItem['comment_policy'])
->setPublicPolicy($sourceItem['public_policy'])
@@ -3810,6 +3813,7 @@ class Activity {
}
$result = post_activity_item($item->toArray(), deliver: $deliver, channel: $channel, observer: $channel, addAndSync: false);
logger('addToCollection: ' . print_r($result, true));
+
return $result;
}
diff --git a/Zotlabs/Lib/Libzot.php b/Zotlabs/Lib/Libzot.php
index 1392656ab..f2fa78427 100644
--- a/Zotlabs/Lib/Libzot.php
+++ b/Zotlabs/Lib/Libzot.php
@@ -1294,6 +1294,7 @@ class Libzot {
$item['item_private'] = 1;
}
+/* This is already managed in Activity::decode_note()
if ($item['mid'] === $item['parent_mid']) {
if (is_array($AS->obj) && array_key_exists('commentPolicy', $AS->obj)) {
$p = strstr($AS->obj['commentPolicy'], 'until=');
@@ -1312,7 +1313,7 @@ class Libzot {
}
}
}
-
+*/
if (!empty($AS->meta['hubloc']) || $AS->sigok) {
$item['item_verified'] = true;
}
diff --git a/Zotlabs/Module/Item.php b/Zotlabs/Module/Item.php
index 97ccb312e..06175109f 100644
--- a/Zotlabs/Module/Item.php
+++ b/Zotlabs/Module/Item.php
@@ -207,7 +207,6 @@ class Item extends Controller {
$expires = NULL_DATE;
- $comments_closed = NULL_DATE;
$route = '';
$parent_item = null;
@@ -454,7 +453,7 @@ class Item extends Controller {
$title = escape_tags(trim($_REQUEST['title']));
$summary = escape_tags(trim($_REQUEST['summary']));
$body = trim($_REQUEST['body']);
- $item_flags = $orig_post['item_flags'];
+ $item_flags = $orig_post['item_flags'];
$item_origin = $orig_post['item_origin'];
$item_unseen = $orig_post['item_unseen'];
$item_starred = $orig_post['item_starred'];
@@ -468,7 +467,7 @@ class Item extends Controller {
$item_mentionsme = $orig_post['item_mentionsme'];
$item_nocomment = $orig_post['item_nocomment'];
$item_obscured = $orig_post['item_obscured'];
- $item_verified = $orig_post['item_verified'];
+ $item_verified = $orig_post['item_verified'];
$item_retained = $orig_post['item_retained'];
$item_rss = $orig_post['item_rss'];
$item_deleted = $orig_post['item_deleted'];
@@ -793,6 +792,7 @@ class Item extends Controller {
$item_origin = (($origin) ? 1 : 0);
$item_consensus = (($consensus) ? 1 : 0);
$item_nocomment = (($nocomment) ? 1 : 0);
+ $comments_closed = (($nocomment) ? $comments_closed : NULL_DATE);
// determine if this is a wall post