`if ($to_user_id)` only ensures that the value is not zero, negative values pass and are probably sorted out by code that checks whether recipients actually exist. As such `$to_user_id != ANONYMOUS` would probably be sufficient because negative and zero values are caught by recipient check. But let's go with `$to_user_id && $to_user_id !== ANONYMOUS` to not alter the logic too much.