def notify_topic_moved_streams(user_profile: UserProfile, old_stream: Stream, old_topic: str, new_stream: Stream, new_topic: Optional[str], send_notification_to_old_thread: bool, send_notification_to_new_thread: bool) -> None:
    sender = get_system_bot(settings.NOTIFICATION_BOT)
    if (new_topic is None):
        new_topic = old_topic
    user_mention = f'@_**{user_profile.full_name}|{user_profile.id}**'
    old_topic_link = f'#**{old_stream.name}>{old_topic}**'
    new_topic_link = f'#**{new_stream.name}>{new_topic}**'
    if send_notification_to_new_thread:
        with override_language(new_stream.realm.default_language):
            internal_send_stream_message(new_stream.realm, sender, new_stream, new_topic, _('This topic was moved here from {old_location} by {user}').format(old_location=old_topic_link, user=user_mention))
    if send_notification_to_old_thread:
        with override_language(old_stream.realm.default_language):
            internal_send_stream_message(old_stream.realm, sender, old_stream, old_topic, _('This topic was moved by {user} to {new_location}').format(user=user_mention, new_location=new_topic_link))
def notify_topic_moved_streams(user_profile: UserProfile, old_stream: Stream, old_topic: str, new_stream: Stream, new_topic: Optional[str], send_notification_to_old_thread: bool, send_notification_to_new_thread: bool) -> None:
    sender = get_system_bot(settings.NOTIFICATION_BOT)
    if (new_topic is None):
        new_topic = old_topic
    user_mention = f'@_**{user_profile.full_name}|{user_profile.id}**'
    old_topic_link = f'#**{old_stream.name}>{old_topic}**'
    new_topic_link = f'#**{new_stream.name}>{new_topic}**'
    if send_notification_to_new_thread:
        with override_language(new_stream.realm.default_language):
            internal_send_stream_message(new_stream.realm, sender, new_stream, new_topic, _('This topic was moved here from {old_location} by {user}').format(old_location=old_topic_link, user=user_mention))
    if send_notification_to_old_thread:
        with override_language(old_stream.realm.default_language):
            internal_send_stream_message(old_stream.realm, sender, old_stream, old_topic, _('This topic was moved by {user} to {new_location}').format(user=user_mention, new_location=new_topic_link))