aboutsummaryrefslogtreecommitdiffstats
path: root/include/conversation.php
diff options
context:
space:
mode:
authorMario <mario@mariovavti.com>2023-01-05 10:29:42 +0100
committerMario <mario@mariovavti.com>2023-01-05 10:29:42 +0100
commit23828f53bcd762f778b97c57a6d29ab59e83082d (patch)
tree7c801a5f10ef17b1e9a12be83d67171ea6566f2e /include/conversation.php
parentf909e129ab6a937b329f86947dd6fb1bf7bda662 (diff)
downloadvolse-hubzilla-23828f53bcd762f778b97c57a6d29ab59e83082d.tar.gz
volse-hubzilla-23828f53bcd762f778b97c57a6d29ab59e83082d.tar.bz2
volse-hubzilla-23828f53bcd762f778b97c57a6d29ab59e83082d.zip
pubstream: when going to conv from unthreaded mode stay in the module
Diffstat (limited to 'include/conversation.php')
-rw-r--r--include/conversation.php25
1 files changed, 19 insertions, 6 deletions
diff --git a/include/conversation.php b/include/conversation.php
index 46621a243..caad5bb0e 100644
--- a/include/conversation.php
+++ b/include/conversation.php
@@ -675,7 +675,7 @@ function conversation($items, $mode, $update, $page_mode = 'traditional', $prepa
if($items) {
- if(in_array($mode, [ 'network-new', 'search', 'community', 'moderate' ])) {
+ if(is_unthreaded($mode)) {
// "New Item View" on network page or search page results
// - just loop through the items and format them minimally for display
@@ -772,14 +772,17 @@ function conversation($items, $mode, $update, $page_mode = 'traditional', $prepa
if(strcmp(datetime_convert('UTC','UTC',$item['created']),datetime_convert('UTC','UTC','now - 12 hours')) > 0)
$is_new = true;
- $conv_link_mid = (($mode == 'moderate') ? $item['parent_mid'] : $item['mid']);
+ $conv_link_mid = (($mode == 'moderate') ? gen_link_id($item['parent_mid']) : gen_link_id($item['mid']));
+
+ $conv_link = z_root() . '/display/' . $conv_link_mid;
- $conv_link_module = 'display';
if(local_channel()) {
- $conv_link_module = 'hq';
+ $conv_link = z_root() . '/hq/' . $conv_link_mid;
}
- $conv_link = z_root() . '/' . $conv_link_module . '/' . gen_link_id($conv_link_mid);
+ if ($mode === 'pubstream-new') {
+ $conv_link = z_root() . '/pubstream?mid=' . $conv_link_mid;
+ }
$contact = [];
@@ -996,7 +999,7 @@ function thread_action_menu($item,$mode = '') {
'href' => '#'
];
- if(! in_array($mode, [ 'network-new', 'search', 'community'])) {
+ if(!is_unthreaded($mode)) {
if($item['parent'] == $item['id'] && (get_observer_hash() != $item['author_xchan'])) {
$menu[] = [
'menu' => 'follow_thread',
@@ -1784,3 +1787,13 @@ function get_response_button_text($v,$count) {
break;
}
}
+
+function is_unthreaded($mode) {
+ return in_array($mode, [
+ 'network-new',
+ 'pubstream-new',
+ 'search',
+ 'community',
+ 'moderate'
+ ]);
+}