public Mono<Set<Long>> authAndUpdateTypingStatus(
            @NotNull Long requesterId,
            boolean isGroupMessage,
            @NotNull Long toId) {
        try {
            Validator.notNull(requesterId, "requesterId");
            Validator.notNull(toId, "toId");
        } catch (ResponseException e) {
            return Mono.error(e);
        }
        if (!isTypingStatusEnabled) {
            return Mono.error(
                    ResponseException.get(ResponseStatusCode.UPDATING_TYPING_STATUS_IS_DISABLED));
        }
        if (isGroupMessage) {
            return groupMemberService.isGroupMember(toId, requesterId, true)
                    .flatMap(isMember -> {
                        if (!isMember) {
                            return Mono.error(ResponseException.get(
                                    ResponseStatusCode.NOT_GROUP_MEMBER_TO_SEND_TYPING_STATUS));
                        }
                        return groupMemberService.queryGroupMemberIds(toId, true);
                    });
        } else {
            return userRelationshipService.hasRelationshipAndNotBlocked(toId, requesterId)
                    .flatMap(hasRelationshipAndNotBlocked -> {
                        if (!hasRelationshipAndNotBlocked) {
                            return Mono.error(ResponseException
                                    .get(ResponseStatusCode.NOT_FRIEND_TO_SEND_TYPING_STATUS));
                        }
                        return Mono.just(Set.of(toId));
                    });
        }
    }
@throws com.mongodb.DuplicateKeyException if {@code readDate} isn't after the read date in DB
                                          when "isAllowMoveReadDateForward" is enabled
turms-service/src/main/java/im/turms/service/domain/conversation/service/ConversationService.java