Ejemplo n.º 1
0
        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
            {
            }
        }
Ejemplo n.º 2
0
        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);
        }
Ejemplo n.º 3
0
        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);
        }