public PrivateMessage(IrcMessage message, ServerInfo serverInfo) { Source = message.Parameters[0]; Message = message.Parameters[1]; User = new IrcUser(message.Prefix); if (serverInfo.ChannelTypes.Any(c => Source.StartsWith(c.ToString()))) IsChannelMessage = true; else Source = User.Nick; }
internal PrivateMessage(IrcClient client, IrcMessage message, ServerInfo serverInfo) { Source = message.Parameters[0]; Message = message.Parameters[1]; User = client.Users.GetOrAdd(message.Prefix); if (serverInfo.ChannelTypes.Any(c => Source.StartsWith(c.ToString()))) IsChannelMessage = true; else Source = User.Nick; }
public PrivateMessage(IrcMessage message) { Source = message.Payload.Remove(message.Payload.IndexOf(' ')); Message = message.Payload.Substring(message.Payload.IndexOf(':') + 1); User = new IrcUser(message.Prefix); if (Source.StartsWith("#")) IsChannelMessage = true; else Source = User.Nick; }
public PrivateMessage(IrcMessage message) { Source = message.Parameters[0]; Message = message.Parameters[1]; User = new IrcUser(message.Prefix); if (Source.StartsWith("#")) IsChannelMessage = true; else Source = User.Nick; }
private void HandleMessage(string rawMessage) { OnRawMessageRecieved(new RawMessageEventArgs(rawMessage, false)); var message = new IrcMessage(rawMessage); if (Handlers.ContainsKey(message.Command.ToUpper())) Handlers[message.Command.ToUpper()](this, message); else { // TODO: Fire an event or something } }
public void SendIrcMessage(IrcMessage message) { SendRawMessage(message.RawMessage); }
/// <summary> /// Send a raw IRC message. Behaves like /quote in most IRC clients. /// </summary> public void SendIrcMessage(IrcMessage message) { SendRawMessage(message.RawMessage); }