private void client_PrivateMessage(Client sender, PrivateMessage privateMessage) { if (Channel.IsChannel(privateMessage.Recipient)) { Channel channel = Chats.SingleOrDefault(chat => chat.Name == privateMessage.Recipient) as Channel; if (channel == null) { channel = new Channel(privateMessage.Recipient); Chats.Add(channel); } channel.Messages.Add(privateMessage); User user = users.SingleOrDefault(usr => usr.Complete == privateMessage.User); if (user == null) { user = new User(privateMessage.User, true); users.Add(user); } if (user.IsNickServIdentified == null) { user.RequestNickServAuthentication(client); } } else { } }
public void Channel() { Channel globalChannel = new Channel("#global"); Channel localChannel = new Channel("&local"); Assert.IsTrue(globalChannel.IsGlobal); Assert.IsFalse(globalChannel.IsLocal); Assert.IsFalse(localChannel.IsGlobal); Assert.IsTrue(localChannel.IsLocal); }
public void ChannelParses() { var globalChannel = new Channel("#global"); var localChannel = new Channel("&local"); Assert.IsTrue(globalChannel.IsGlobal); Assert.IsFalse(globalChannel.IsLocal); Assert.IsFalse(localChannel.IsGlobal); Assert.IsTrue(localChannel.IsLocal); }