public void RequireDifferentUsersForChatCreation(string username)
        {
            var user = _userValidationService.RequireAndGetUserByUsername(username);

            if (user.Id == _authorizedUser.Id)
            {
                throw new LogicApiException("You can not create a Chat with yourself");
            }
        }
        public void RequireUserIsChannelMember(string username, Guid channelId)
        {
            var user = _userValidationService.RequireAndGetUserByUsername(username);

            RequireUserByIdIsChannelMember(
                user.Id,
                channelId,
                "User is not a member of this channel."
                );
        }
Esempio n. 3
0
        public void RequireUsernameIsGroupMember(string username, Guid groupId)
        {
            var user = _userValidationService.RequireAndGetUserByUsername(username);

            RequireUserIdIsGroupMember(
                user.Id,
                groupId,
                "User is not a member of this group."
                );
        }