Пример #1
0
 public override bool Parse(Message aMessage)
 {
     _messages.Enqueue(aMessage);
     return _waitHandle.Set();
 }
Пример #2
0
        void ClientOnMessage(object sender, EventArgs<Model.Domain.Channel, string, string> e)
        {
            var message = new Message
            {
                Channel = e.Value1,
                Nick = e.Value2,
                Text = e.Value3
            };
            Parser.Parse(message);

            // check if the bot sends a message and hold back xdcc list requests one more time
            var entry = _xdccListQueue.FirstOrDefault(x => x.User == e.Value2);
            if (entry != null)
            {
                entry.IncreaseTime();
            }
        }
Пример #3
0
		public abstract bool Parse(Message aMessage);
Пример #4
0
        public void ParseXdccFile(string aNick, string[] aLines)
        {
            Model.Domain.Channel tChan = null;
            var user = _client.GetIrcUser(aNick);
            if (user != null)
            {
                foreach (string channel in user.JoinedChannels)
                {
                    tChan = Server.Channel(channel);
                    if (tChan != null)
                    {
                        break;
                    }
                }
            }

            if (tChan == null)
            {
                _log.Error(".ParseXdccFile() cant find channel for nick " + aNick);
                return;
            }

            foreach (var line in aLines)
            {
                var message = new Message
                {
                    Channel = tChan,
                    Nick = aNick,
                    Text = line
                };
                _parser.Parse(message);
            }
        }
Пример #5
0
 protected void Parse(XG.Plugin.Irc.Parser.AParser aParser, string aMessage)
 {
     aMessage = XG.Plugin.Irc.Parser.Helper.RemoveSpecialIrcChars(aMessage);
     var message = new Message
     {
         Channel = Channel,
         Nick = Bot.Name,
         Text = aMessage
     };
     aParser.Parse(message);
 }