Beispiel #1
0
        public PublicChannel CreatePublicChannel(WarsimUser owner, string name)
        {
            var channel = new PublicChannel(name, owner);

            this.Channels.TryAdd(channel.Id, channel);

            return(channel);
        }
 public static WarsimClientChannel Map(PublicChannel channel)
 {
     return(new WarsimClientChannel
     {
         Id = channel.Id,
         Name = channel.Name,
         OwnerId = channel.Owner?.UserId,
         ActiveUsers = channel.ActiveUsers.Select(WarsimClientUser.Map).ToList()
     });
 }
Beispiel #3
0
        public void SendPublicChannelInvite(PublicChannel channel, IList <string> inviteeIds)
        {
            var msg = new ChannelInviteMessage
            {
                UserId      = channel.Owner.UserId,
                Username    = channel.Owner.Username,
                ChannelId   = channel.Id,
                ChannelName = channel.Name
            };

            foreach (var invitee in inviteeIds)
            {
                var not = this.AddNotificationEntity(msg, invitee);

                msg.NotificationId = not.Id;
                this.SendWebSocketNotification(invitee, msg);
            }
        }