def do_update_user_status(user_profile: UserProfile, away: Optional[bool], status_text: Optional[str], client_id: int) -> None:
    if away:
        status = UserStatus.AWAY
    else:
        status = UserStatus.NORMAL
    realm = user_profile.realm
    update_user_status(user_profile_id=user_profile.id, status=status, status_text=status_text, client_id=client_id)
    event = dict(type='user_status', user_id=user_profile.id)
    if (away is not None):
        event['away'] = away
    if (status_text is not None):
        event['status_text'] = status_text
    send_event(realm, event, active_user_ids(realm.id))
def do_update_user_status(user_profile: UserProfile, away: Optional[bool], status_text: Optional[str], client_id: int) -> None:
    if away:
        status = UserStatus.AWAY
    else:
        status = UserStatus.NORMAL
    realm = user_profile.realm
    update_user_status(user_profile_id=user_profile.id, status=status, status_text=status_text, client_id=client_id)
    event = dict(type='user_status', user_id=user_profile.id)
    if (away is not None):
        event['away'] = away
    if (status_text is not None):
        event['status_text'] = status_text
    send_event(realm, event, active_user_ids(realm.id))