Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
hubzilla
core
Commits
23828f53
Commit
23828f53
authored
Jan 05, 2023
by
Mario
Browse files
pubstream: when going to conv from unthreaded mode stay in the module
parent
f909e129
Pipeline
#562855
passed with stage
in 1 minute and 5 seconds
Changes
2
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Zotlabs/Module/Pubstream.php
View file @
23828f53
...
...
@@ -40,7 +40,8 @@ class Pubstream extends \Zotlabs\Web\Controller {
$site_firehose
=
((
intval
(
get_config
(
'system'
,
'site_firehose'
,
0
)))
?
true
:
false
);
$mid
=
((
x
(
$_REQUEST
,
'mid'
))
?
unpack_link_id
(
$_REQUEST
[
'mid'
])
:
''
);
$mid
=
((
$_REQUEST
[
'mid'
])
?
unpack_link_id
(
$_REQUEST
[
'mid'
])
:
''
);
if
(
$mid
===
false
)
{
notice
(
t
(
'Malformed message id.'
)
.
EOL
);
return
;
...
...
@@ -261,7 +262,6 @@ class Pubstream extends \Zotlabs\Web\Controller {
);
// use effective_uid param of xchan_query to help sort out comment permission
// for sys_channel owned items.
...
...
@@ -277,8 +277,7 @@ class Pubstream extends \Zotlabs\Web\Controller {
}
// fake it
$mode
=
((
$hashtags
)
?
'search'
:
'pubstream'
);
$mode
=
((
$hashtags
)
?
'pubstream-new'
:
'pubstream'
);
$o
.
=
conversation
(
$items
,
$mode
,
$update
,
$page_mode
);
...
...
include/conversation.php
View file @
23828f53
...
...
@@ -675,7 +675,7 @@ function conversation($items, $mode, $update, $page_mode = 'traditional', $prepa
if
(
$items
)
{
if
(
i
n_array
(
$mode
,
[
'network-new'
,
'search'
,
'community'
,
'moderate'
]
))
{
if
(
i
s_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'
]);
}
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment