def do_change_subscription_property(user_profile: UserProfile, sub: Subscription, stream: Stream, property_name: str, value: Any) -> None:
    database_property_name = property_name
    event_property_name = property_name
    database_value = value
    event_value = value
    if (property_name == 'in_home_view'):
        database_property_name = 'is_muted'
        database_value = (not value)
    if (property_name == 'is_muted'):
        event_property_name = 'in_home_view'
        event_value = (not value)
    setattr(sub, database_property_name, database_value)
    sub.save(update_fields=[database_property_name])
    log_subscription_property_change(user_profile.email, stream.name, database_property_name, database_value)
    event = dict(type='subscription', op='update', email=user_profile.email, property=event_property_name, value=event_value, stream_id=stream.id, name=stream.name)
    send_event(user_profile.realm, event, [user_profile.id])
def do_change_subscription_property(user_profile: UserProfile, sub: Subscription, stream: Stream, property_name: str, value: Any) -> None:
    database_property_name = property_name
    event_property_name = property_name
    database_value = value
    event_value = value
    if (property_name == 'in_home_view'):
        database_property_name = 'is_muted'
        database_value = (not value)
    if (property_name == 'is_muted'):
        event_property_name = 'in_home_view'
        event_value = (not value)
    setattr(sub, database_property_name, database_value)
    sub.save(update_fields=[database_property_name])
    log_subscription_property_change(user_profile.email, stream.name, database_property_name, database_value)
    event = dict(type='subscription', op='update', email=user_profile.email, property=event_property_name, value=event_value, stream_id=stream.id, name=stream.name)
    send_event(user_profile.realm, event, [user_profile.id])