예제 #1
0
        public async Task <ChannelSummaryResponse> CreateDirectChannelAsync(CreateDirectChannelRequest request)
        {
            var channel = await _channelService.CreateDirectChannelAsync(request);

            // subscribe creator on channel
            await _pushNotificationService.SubscribeUserOnTagAsync(request.SaasUserId, PushNotificationsTagTemplates.GetChatChannelTag(channel.Id.ToString()));

            var member = await _memberService.GetMemberByIdAsync(request.MemberId);

            // subscribe member on channel
            await _pushNotificationService.SubscribeUserOnTagAsync(member.SaasUserId, PushNotificationsTagTemplates.GetChatChannelTag(channel.Id.ToString()));

            await _channelNotificationService.OnAddChannel(channel);

            //todo filter creator connection id on join channel
            await _channelNotificationService.OnJoinChannel(member, channel);

            return(channel);
        }