From a0c54c5f04ba7f27cf667ba372ea86e23a331d07 Mon Sep 17 00:00:00 2001 From: Mario Vavti Date: Sat, 9 Nov 2024 10:55:10 +0100 Subject: make sure to store target information when decoding and indicate contained conversations with a colored border for now --- Zotlabs/Lib/Activity.php | 10 ++++++++++ Zotlabs/Lib/ThreadItem.php | 3 ++- view/css/conversation.css | 4 ---- view/theme/redbasic/css/style.css | 8 ++++++++ view/tpl/conv_item.tpl | 4 ++-- 5 files changed, 22 insertions(+), 7 deletions(-) diff --git a/Zotlabs/Lib/Activity.php b/Zotlabs/Lib/Activity.php index 9ba145bfa..58f63a2a5 100644 --- a/Zotlabs/Lib/Activity.php +++ b/Zotlabs/Lib/Activity.php @@ -2399,6 +2399,16 @@ class Activity { $s['obj']['actor'] = $s['obj']['actor']['id']; } + if (is_array($act->tgt) && $act->tgt) { + if (array_key_exists('type', $act->tgt)) { + $s['tgt_type'] = self::activity_obj_mapper($act->tgt['type']); + } + // We shouldn't need to store collection contents which could be large. We will often only require the meta-data + if (isset($s['tgt_type']) && str_contains($s['tgt_type'], 'Collection')) { + $s['target'] = ['id' => $act->tgt['id'], 'type' => $s['tgt_type'], 'attributedTo' => $act->tgt['attributedTo'] ?? $act->tgt['actor']]; + } + } + $generator = $act->get_property_obj('generator'); if ((!$generator) && (!$response_activity)) { $generator = $act->get_property_obj('generator', $act->obj); diff --git a/Zotlabs/Lib/ThreadItem.php b/Zotlabs/Lib/ThreadItem.php index d21d85105..90a3d3fc8 100644 --- a/Zotlabs/Lib/ThreadItem.php +++ b/Zotlabs/Lib/ThreadItem.php @@ -544,7 +544,8 @@ class ThreadItem { 'moderate_delete' => t('Delete'), 'rtl' => in_array($item['lang'], rtl_languages()), 'reactions_allowed' => $reactions_allowed, - 'reaction_str' => [t('Add yours'), t('Remove yours')] + 'reaction_str' => [t('Add yours'), t('Remove yours')], + 'is_contained' => $this->is_toplevel() && str_contains($item['tgt_type'], 'Collection') ); $arr = array('item' => $item, 'output' => $tmp_item); diff --git a/view/css/conversation.css b/view/css/conversation.css index 491cee92e..fb26c7e3f 100644 --- a/view/css/conversation.css +++ b/view/css/conversation.css @@ -96,10 +96,6 @@ /* conv_item */ -.wall-item-head-new { - border-top: 0.2rem solid var(--bs-primary); -} - .wall-item-wrapper { margin-left: .75rem; } diff --git a/view/theme/redbasic/css/style.css b/view/theme/redbasic/css/style.css index 12f5e1bad..9790fd694 100644 --- a/view/theme/redbasic/css/style.css +++ b/view/theme/redbasic/css/style.css @@ -1150,6 +1150,14 @@ a .drop-icons:hover { font-size: 1.1rem; } +.generic-content-wrapper.is-contained { + border: 1px solid var(--bs-primary-border-subtle); +} + +.generic-content-wrapper.is-new { + border-top: 2px solid var(--bs-primary); +} + .section-title-wrapper { padding: 7px 10px; background-color: var(--bs-tertiary-bg); diff --git a/view/tpl/conv_item.tpl b/view/tpl/conv_item.tpl index 96e30f42d..21c0dd73d 100644 --- a/view/tpl/conv_item.tpl +++ b/view/tpl/conv_item.tpl @@ -4,7 +4,7 @@