mirror of
https://github.com/zulip/zulip.git
synced 2025-11-09 08:26:11 +00:00
markdown: Fix #-mention of private channel's topic made by system bots.
Previously when system bots used to `#-mention` a private channel's topics in cases like moving messages of a private channel, then the #-mentions were not rendered by the markdown. This was because the system bots did not have authorization to mention these channels. This is fixed by passing down an `acting_user` parameter in code paths involving sending these move message notifications so that permission of acting_user to mention the topic is verified for rendering the markdown, rather than that of the system bot.
This commit is contained in:
@@ -423,16 +423,12 @@ class MentionData:
|
||||
def get_stream_name_map(
|
||||
self, stream_names: set[str], acting_user: UserProfile | None
|
||||
) -> dict[str, int]:
|
||||
return self.mention_backend.get_stream_name_map(
|
||||
stream_names, acting_user=self.message_sender
|
||||
)
|
||||
return self.mention_backend.get_stream_name_map(stream_names, acting_user=acting_user)
|
||||
|
||||
def get_topic_info_map(
|
||||
self, channel_topics: set[ChannelTopicInfo]
|
||||
self, channel_topics: set[ChannelTopicInfo], acting_user: UserProfile | None
|
||||
) -> dict[ChannelTopicInfo, int | None]:
|
||||
return self.mention_backend.get_topic_info_map(
|
||||
channel_topics, acting_user=self.message_sender
|
||||
)
|
||||
return self.mention_backend.get_topic_info_map(channel_topics, acting_user=acting_user)
|
||||
|
||||
|
||||
def silent_mention_syntax_for_user(user_profile: UserProfile) -> str:
|
||||
|
||||
Reference in New Issue
Block a user