@ServiceRequestMapping(UPDATE_USER_REQUEST)
    public ClientRequestHandler handleUpdateUserRequest() {
        return clientRequest -> {
            UpdateUserRequest request = clientRequest.turmsRequest()
                    .getUpdateUserRequest();
            String password = request.hasPassword()
                    ? request.getPassword()
                    : null;
            String name = request.hasName()
                    ? request.getName()
                    : null;
            String intro = request.hasIntro()
                    ? request.getIntro()
                    : null;
            String profilePicture = request.hasProfilePicture()
                    ? request.getProfilePicture()
                    : null;
            ProfileAccessStrategy profileAccessStrategy = request.getProfileAccessStrategy();
            Map<String, Value> userDefinedAttributes = request.getUserDefinedAttributesCount() > 0
                    ? request.getUserDefinedAttributesMap()
                    : null;
            return userService
                    .updateUser(clientRequest.userId(),
                            password,
                            name,
                            intro,
                            profilePicture,
                            profileAccessStrategy,
                            null,
                            null,
                            null,
                            userDefinedAttributes)
                    .flatMap(changed -> {
                        if (!changed) {
                            return Mono.just(RequestHandlerResult.OK);
                        }
                        if (!notifyNonBlockedRelatedUsersOfUserInfoUpdated
                                // TODO: make configurable.
                                || (name == null
                                        && intro == null
                                        && profilePicture == null
                                        && userDefinedAttributes == null)) {
                            return Mono.just(RequestHandlerResult.of(
                                    notifyRequesterOtherOnlineSessionsOfUserInfoUpdated,
                                    clientRequest.turmsRequest()));
                        }
                        Recyclable<List<Long>> recyclableList = ListRecycler.obtain();
                        return userRelationshipService
                                .queryRelatedUserIds(Set.of(clientRequest.userId()), false)
                                .collect(Collectors.toCollection(recyclableList::getValue))
                                .map(relatedUserIds -> {
                                    if (relatedUserIds.isEmpty()) {
                                        return RequestHandlerResult.of(
                                                notifyRequesterOtherOnlineSessionsOfUserInfoUpdated,
                                                clientRequest.turmsRequest());
                                    }
                                    if (password == null) {
                                        return RequestHandlerResult.of(
                                                notifyRequesterOtherOnlineSessionsOfUserInfoUpdated,
                                                CollectionUtil.newSet(relatedUserIds),
                                                clientRequest.turmsRequest());
                                    }
                                    RequestHandlerResult.Notification notificationForRelatedUsers =
                                            RequestHandlerResult.Notification.of(false,
                                                    CollectionUtil.newSet(relatedUserIds),
                                                    ClientMessagePool.getTurmsRequestBuilder()
                                                            .setUpdateUserRequest(ClientMessagePool
                                                                    .getUpdateUserRequestBuilder()
                                                                    .mergeFrom(request)
                                                                    .clearPassword())
                                                            .build());
                                    if (notifyRequesterOtherOnlineSessionsOfUserInfoUpdated) {
                                        return RequestHandlerResult.of(List.of(
                                                RequestHandlerResult.Notification.of(true,
                                                        clientRequest.turmsRequest()),
                                                notificationForRelatedUsers));
                                    }
                                    return RequestHandlerResult.of(notificationForRelatedUsers);
                                })
                                .doFinally(signalType -> recyclableList.recycle());
                    });
        };
    }
Do not notify the user status change to the related users and members of joined groups
because the client itself should query whether there are any user status changes, according
to their own business scenarios.
turms-service/src/main/java/im/turms/service/domain/user/access/servicerequest/controller/UserServiceController.java