Skip to content

Commit

Permalink
test
Browse files Browse the repository at this point in the history
  • Loading branch information
live627 committed Aug 3, 2021
1 parent e29d466 commit 73ce7e8
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions Sources/Recent.php
Expand Up @@ -831,7 +831,7 @@ function UnreadTopics()
WHERE lt.id_member = {int:current_member}
AND t.' . $query_this_board . (empty($earliest_msg) ? '' : '
AND t.id_last_msg > {int:earliest_msg}') . ($modSettings['postmod_active'] ? '
AND t.approved = {int:is_approved}' : '') . ' AND lt.unwatched != 1',
AND t.approved = {int:is_approved}' : ''),
array_merge($query_parameters, array(
'current_member' => $user_info['id'],
'earliest_msg' => !empty($earliest_msg) ? $earliest_msg : 0,
Expand Down Expand Up @@ -930,7 +930,7 @@ function UnreadTopics()
SELECT COUNT(*), MIN(t.id_last_msg)
FROM {db_prefix}topics AS t' . (!empty($have_temp_table) ? '
LEFT JOIN {db_prefix}log_topics_unread AS lt ON (lt.id_topic = t.id_topic)' : '
LEFT JOIN {db_prefix}log_topics AS lt ON (lt.id_topic = t.id_topic AND lt.id_member = {int:current_member} AND lt.unwatched != 1)') . '
LEFT JOIN {db_prefix}log_topics AS lt ON (lt.id_topic = t.id_topic AND lt.id_member = {int:current_member})') . '
LEFT JOIN {db_prefix}log_mark_read AS lmr ON (lmr.id_board = t.id_board AND lmr.id_member = {int:current_member})
WHERE t.' . $query_this_board . ($context['showing_all_topics'] && !empty($earliest_msg) ? '
AND t.id_last_msg > {int:earliest_msg}' : (!$context['showing_all_topics'] && empty($_SESSION['first_login']) ? '
Expand Down Expand Up @@ -995,7 +995,7 @@ function UnreadTopics()
LEFT JOIN {db_prefix}attachments AS af ON (af.id_member = mems.id_member)
LEFT JOIN {db_prefix}attachments AS al ON (al.id_member = meml.id_member)' : '') . '' . (!empty($have_temp_table) ? '
LEFT JOIN {db_prefix}log_topics_unread AS lt ON (lt.id_topic = t.id_topic)' : '
LEFT JOIN {db_prefix}log_topics AS lt ON (lt.id_topic = t.id_topic AND lt.id_member = {int:current_member} AND lt.unwatched != 1)') . '
LEFT JOIN {db_prefix}log_topics AS lt ON (lt.id_topic = t.id_topic AND lt.id_member = {int:current_member})') . '
LEFT JOIN {db_prefix}log_mark_read AS lmr ON (lmr.id_board = t.id_board AND lmr.id_member = {int:current_member})
WHERE t.' . $query_this_board . '
AND t.id_last_msg >= {int:min_message}
Expand Down Expand Up @@ -1106,7 +1106,7 @@ function UnreadTopics()
WHERE t.' . $query_this_board . '
AND m.id_member = {int:current_member}
AND COALESCE(lt.id_msg, lmr.id_msg, 0) < t.id_last_msg' . ($modSettings['postmod_active'] ? '
AND t.approved = {int:is_approved}' : '') . ' AND lt.unwatched != 1',
AND t.approved = {int:is_approved}' : ''),
array_merge($query_parameters, array(
'current_member' => $user_info['id'],
'is_approved' => 1,
Expand Down Expand Up @@ -1170,7 +1170,7 @@ function UnreadTopics()
WHERE t.' . $query_this_board . '
AND t.id_last_msg >= {int:min_message}
AND (COALESCE(lt.id_msg, lmr.id_msg, 0)) < t.id_last_msg
AND t.approved = {int:is_approved} AND lt.unwatched != 1
AND t.approved = {int:is_approved}
ORDER BY {raw:order}
LIMIT {int:offset}, {int:limit}',
array_merge($query_parameters, array(
Expand Down

5 comments on commit 73ce7e8

@Arantor
Copy link

@Arantor Arantor commented on 73ce7e8 Aug 3, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The whole point of unwatched here is to allow for excluding topics from unread replies. If you’re getting things excluded it’s probably because something is wrongly setting values in the database…

@BearlyDoug
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Arantor, you might want to see my thread in the 2.1 support board about this. The behavior is a major deviation from past versions of SMF. This is for the "Show new replies to your posts." functionality (rebranded as "Updated Topics"), which is not behaving correctly.

@Arantor
Copy link

@Arantor Arantor commented on 73ce7e8 Aug 3, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No, there’s a separate problem here. The unwatched status should only be set if a topic is marked “not watching” (as opposed to “no alerts or emails”)

The “not watching” status is for “never tell me about this topic even if it has new items”, while “no alerts and emails” should be the same as 2.0 for topics you haven’t explicitly opted into notifications.

it’s a bug alright, but not the one you think it is, this code is fine, it’s the rest of the system putting junk preferences in that’s the problem.

I know I messed up a great many things in 2.1, this wasn’t one of them.

@live627
Copy link
Owner Author

@live627 live627 commented on 73ce7e8 Aug 3, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi Arantor, it's been awhile.

@LexArma
Copy link

@LexArma LexArma commented on 73ce7e8 Aug 3, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I know I messed up a great many things in 2.1, this wasn’t one of them.

Hi there stranger, nice to see you haven't completely dropped off the face of the earth. :)

Please sign in to comment.