private void RequireUserByIdIsChannelMember(Guid userId, Guid channelId, string errorMessage)
        {
            var channelUser = _channelUserRepository.GetByUserIdAndChannelId(userId, channelId);

            if (channelUser == null)
            {
                throw new LogicApiException(errorMessage);
            }
        }
Exemplo n.º 2
0
        private void RemoveUserFromChannel(Models.User user, Guid channelId)
        {
            var channel     = _channelRepository.Get(channelId);
            var channelUser = _channelUserRepository.GetByUserIdAndChannelId(user.Id, channelId);

            _channelUserRepository.Remove(channelUser);
            _channelUserStore.RemoveByUserIdAndChannelId(user.Id, channelId);
            _channelEventService.AddUserRemovedFromChannelEvent(channel.Group, _authorizedUser, user, channel);
        }