topics: Follow topics that are merged into even after merge.

Previously, when there were two topics -- A and B, and a user
follows topic A, then when messages of topic B are merged into
topic A then topic A loses its follow status.

This is fixed by updating the algorithm for getting the visibility
policy after merge to be followed in the above case.

Fixes #35226
This commit is contained in:
Rohan Gudimetla
2025-07-26 19:13:32 +05:30
committed by Tim Abbott
parent 8330e7c283
commit cb01bdf0c4
2 changed files with 107 additions and 3 deletions

View File

@@ -488,6 +488,9 @@ def get_visibility_policy_after_merge(
# rather than hiding them.
visibility_policies = {orig_topic_visibility_policy, target_topic_visibility_policy}
if UserTopic.VisibilityPolicy.FOLLOWED in visibility_policies:
return UserTopic.VisibilityPolicy.FOLLOWED
if UserTopic.VisibilityPolicy.UNMUTED in visibility_policies:
return UserTopic.VisibilityPolicy.UNMUTED