Ejemplo n.º 1
0
 private static void LogUnimplementedMessage(IrcMessage msg)
 {
     Trace.WriteLine(msg.ToString(), "Unimplemented Message");
 }
Ejemplo n.º 2
0
        /// <summary>
        ///   Sends a <see cref="IrcMessage" /> over a <see cref="ClientConnection" /> to an IRC server.
        /// </summary>
        /// <param name="message">The <see cref="IrcMessage" /> to send.</param>
        public virtual async Task Send(IrcMessage message)
        {
            if (message == null)
            {
                return;
            }

            var e = new CancelIrcMessageEventArgs<IrcMessage>(message);
            this.OnMessageSending(e);
            if (e.Cancel)
            {
                return;
            }

            message.Validate(this.ServerSupports);
            await this.Connection.Write(message + Environment.NewLine);
        }
Ejemplo n.º 3
0
 /// <summary>
 ///   Determines if the given message originated from the currently connected server.
 /// </summary>
 public virtual bool IsMessageFromServer(IrcMessage msg)
 {
     if (msg == null)
     {
         return false;
     }
     return msg.Sender.Nickname == this.ServerName;
 }
Ejemplo n.º 4
0
 /// <summary>
 /// Adds a custom message to consider for parsing raw messages received from the server.
 /// </summary>
 public static void AddCustomMessage(IrcMessage msg)
 {
     instance.Value._customs.AddLast(msg);
 }