aboutsummaryrefslogtreecommitdiffstats
path: root/include/conversation.php
diff options
context:
space:
mode:
authorMario <mario@mariovavti.com>2021-06-29 08:45:48 +0000
committerMario <mario@mariovavti.com>2021-06-29 08:45:48 +0000
commit0503914527643210af25d9e036238e6ebfee889e (patch)
treeba9935b5ad2e739a51db3a9e14cf03559a3c8480 /include/conversation.php
parentcb65ae68485ed0abb364bc055ff97a28ed70f899 (diff)
downloadvolse-hubzilla-0503914527643210af25d9e036238e6ebfee889e.tar.gz
volse-hubzilla-0503914527643210af25d9e036238e6ebfee889e.tar.bz2
volse-hubzilla-0503914527643210af25d9e036238e6ebfee889e.zip
fix deleting and starring in unthreaded view
Diffstat (limited to 'include/conversation.php')
-rw-r--r--include/conversation.php22
1 files changed, 15 insertions, 7 deletions
diff --git a/include/conversation.php b/include/conversation.php
index 331836846..d10582519 100644
--- a/include/conversation.php
+++ b/include/conversation.php
@@ -730,10 +730,13 @@ function conversation($items, $mode, $update, $page_mode = 'traditional', $prepa
'delete' => t('Delete'),
);
- $star = array(
- 'toggle' => t("Toggle Star Status"),
- 'isstarred' => ((intval($item['item_starred'])) ? true : false),
- );
+ $star = [];
+ if ((local_channel() && local_channel() === intval($item['uid'])) && intval($item['item_thread_top']) && feature_enabled(local_channel(), 'star_posts')) {
+ $star = [
+ 'toggle' => t("Toggle Star Status"),
+ 'isstarred' => ((intval($item['item_starred'])) ? true : false),
+ ];
+ }
$lock = (($item['item_private'] || strlen($item['allow_cid']) || strlen($item['allow_gid']) || strlen($item['deny_cid']) || strlen($item['deny_gid']))
? t('Private Message')
@@ -765,8 +768,12 @@ function conversation($items, $mode, $update, $page_mode = 'traditional', $prepa
$conv_link_mid = (($mode == 'moderate') ? $item['parent_mid'] : $item['mid']);
- $conv_link = ((in_array($item['item_type'],[ ITEM_TYPE_CARD, ITEM_TYPE_ARTICLE] )) ? $item['plink'] : z_root() . '/display/' . gen_link_id($conv_link_mid));
+ $conv_link_module = 'display';
+ if(local_channel()) {
+ $conv_link_module = 'hq';
+ }
+ $conv_link = ((in_array($item['item_type'],[ ITEM_TYPE_CARD, ITEM_TYPE_ARTICLE] )) ? $item['plink'] : z_root() . '/' . $conv_link_module . '/' . gen_link_id($conv_link_mid));
$tmp_item = array(
'template' => $tpl,
@@ -777,7 +784,8 @@ function conversation($items, $mode, $update, $page_mode = 'traditional', $prepa
'delete' => t('Delete'),
'preview_lbl' => $preview_lbl,
'id' => (($preview) ? 'P0' : $item['item_id']),
- 'mids' => json_encode(['b64.' . base64url_encode($item['mid'])]),
+ 'mid' => gen_link_id($item['mid']),
+ 'mids' => json_encode([gen_link_id($item['mid'])]),
'linktitle' => sprintf( t('View %s\'s profile @ %s'), $profile_name, $profile_url),
'profile_url' => $profile_link,
'thread_action_menu' => thread_action_menu($item,$mode),
@@ -819,7 +827,7 @@ function conversation($items, $mode, $update, $page_mode = 'traditional', $prepa
'owner_photo' => $owner_photo,
'plink' => get_plink($item,false),
'edpost' => false,
- 'star' => ((feature_enabled(local_channel(),'star_posts')) ? $star : ''),
+ 'star' => $star,
'drop' => $drop,
'vote' => $likebuttons,
'like' => '',