mirror of
https://github.com/zulip/zulip.git
synced 2025-11-13 18:36:36 +00:00
fix_unreads: Remove dead duplicate build_topic_unmute_checker.
The only caller for this function, which is part of a very old
migration, was removed in b77da6b834.
This commit is contained in:
@@ -19,36 +19,6 @@ logger = logging.getLogger("zulip.fix_unreads")
|
|||||||
logger.setLevel(logging.WARNING)
|
logger.setLevel(logging.WARNING)
|
||||||
|
|
||||||
|
|
||||||
def build_topic_mute_checker(
|
|
||||||
cursor: CursorWrapper, user_profile: UserProfile
|
|
||||||
) -> Callable[[int, str], bool]:
|
|
||||||
"""
|
|
||||||
This function is similar to the function of the same name
|
|
||||||
in zerver/lib/topic_mutes.py, but it works without the ORM,
|
|
||||||
so that we can use it in migrations.
|
|
||||||
"""
|
|
||||||
query = SQL(
|
|
||||||
"""
|
|
||||||
SELECT
|
|
||||||
recipient_id,
|
|
||||||
topic_name
|
|
||||||
FROM
|
|
||||||
zerver_usertopic
|
|
||||||
WHERE
|
|
||||||
user_profile_id = %s
|
|
||||||
"""
|
|
||||||
)
|
|
||||||
cursor.execute(query, [user_profile.id])
|
|
||||||
rows = cursor.fetchall()
|
|
||||||
|
|
||||||
tups = {(recipient_id, topic_name.lower()) for (recipient_id, topic_name) in rows}
|
|
||||||
|
|
||||||
def is_muted(recipient_id: int, topic: str) -> bool:
|
|
||||||
return (recipient_id, topic.lower()) in tups
|
|
||||||
|
|
||||||
return is_muted
|
|
||||||
|
|
||||||
|
|
||||||
def update_unread_flags(cursor: CursorWrapper, user_message_ids: List[int]) -> None:
|
def update_unread_flags(cursor: CursorWrapper, user_message_ids: List[int]) -> None:
|
||||||
query = SQL(
|
query = SQL(
|
||||||
"""
|
"""
|
||||||
|
|||||||
Reference in New Issue
Block a user