public virtual async Task AddMemberAsync(
            Guid?tenantId,
            Guid userId,
            Guid friendId,
            string remarkName = "",
            CancellationToken cancellationToken = default)
        {
            using (_currentTenant.Change(tenantId))
            {
                if (!await _userChatFriendRepository.IsAddedAsync(userId, friendId))
                {
                    var userFriend = new UserChatFriend(userId, friendId, remarkName);
                    userFriend.SetStatus(UserFriendStatus.Added);

                    await _userChatFriendRepository.InsertAsync(userFriend);
                }

                var userChatFriend = await _userChatFriendRepository
                                     .FindByUserFriendIdAsync(friendId, userId);

                userChatFriend.SetStatus(UserFriendStatus.Added);

                await _userChatFriendRepository.UpdateAsync(userChatFriend, cancellationToken : cancellationToken);
            }
        }
        public virtual async Task <UserAddFriendResult> AddRequestAsync(
            Guid?tenantId,
            Guid userId,
            Guid friendId,
            string remarkName  = "",
            string description = "",
            CancellationToken cancellationToken = default)
        {
            using (_currentTenant.Change(tenantId))
            {
                if (await _userChatFriendRepository.IsAddedAsync(userId, friendId))
                {
                    throw new BusinessException(MessageServiceErrorCodes.UseHasBeenAddedTheFriendOrSendAuthorization);
                }

                var status          = UserFriendStatus.NeedValidation;
                var userChatSetting = await _userChatSettingRepository.FindByUserIdAsync(friendId, cancellationToken);

                if (userChatSetting != null)
                {
                    if (!userChatSetting.AllowAddFriend)
                    {
                        throw new BusinessException(MessageServiceErrorCodes.UseRefuseToAddFriend);
                    }

                    status = userChatSetting.RequireAddFriendValition
                        ? UserFriendStatus.NeedValidation
                        : UserFriendStatus.Added;
                }

                var userChatFriend = new UserChatFriend(userId, friendId, remarkName, description, tenantId)
                {
                    CreationTime = _clock.Now,
                    CreatorId    = userId,
                };
                userChatFriend.SetStatus(status);

                await _userChatFriendRepository.InsertAsync(userChatFriend, cancellationToken : cancellationToken);

                return(new UserAddFriendResult(status));
            }
        }