internal BounceEventArgs(IrcMessageData data, string server, int port) : base(data) { Server = server; Port = port; }
internal ActionEventArgs(IrcMessageData data, string actionmsg) : base(data, "ACTION", actionmsg) => ActionMessage = actionmsg;
internal DevoiceEventArgs(IrcMessageData data, string channel, string who, string whom) : base(data, channel, who, whom) { }
public static WhoInfo Parse(IrcMessageData data) { var whoInfo = new WhoInfo { // :fu-berlin.de 352 meebey_ * ~meebey e176002059.adsl.alicedsl.de fu-berlin.de meebey_ H :0 Mirco Bauer.. Channel = data.RawMessageArray[3], Ident = data.RawMessageArray[4], Host = data.RawMessageArray[5], Server = data.RawMessageArray[6], Nick = data.RawMessageArray[7] }; // HACK: realname field can be empty on bugged IRCds like InspIRCd-2.0 // :topiary.voxanon.net 352 Mirco #anonplusradio CpGc igot.avhost Voxanon CpGc H if (data.MessageArray == null || data.MessageArray.Length < 2) { whoInfo.Realname = ""; } else { string hopcountStr = data.MessageArray[0]; if (Int32.TryParse(hopcountStr, out int hopcount)) { whoInfo.HopCount = hopcount; } else { #if LOG4NET Logger.MessageParser.Warn("Parse(): couldn't parse hopcount (as int): '" + hopcountStr + "'"); #endif } // skip hop count whoInfo.Realname = String.Join(" ", data.MessageArray, 1, data.MessageArray.Length - 1); } string usermode = data.RawMessageArray[8]; bool owner = false; bool chanadmin = false; bool op = false; bool halfop = false; bool voice = false; bool ircop = false; bool away = false; bool registered = false; int usermodelength = usermode.Length; for (int i = 0; i < usermodelength; i++) { switch (usermode[i]) { case 'H': away = false; break; case 'G': away = true; break; case '~': owner = true; break; case '&': chanadmin = true; break; case '@': op = true; break; case '%': halfop = true; break; case '+': voice = true; break; case '*': ircop = true; break; case 'r': registered = true; break; } } whoInfo.IsAway = away; whoInfo.IsOwner = owner; whoInfo.IsChannelAdmin = chanadmin; whoInfo.IsOp = op; whoInfo.IsHalfop = halfop; whoInfo.IsVoice = voice; whoInfo.IsIrcOp = ircop; whoInfo.IsRegistered = registered; return(whoInfo); }
internal ListEventArgs(IrcMessageData data, ChannelInfo listInfo) : base(data) => ListInfo = listInfo;
internal ErrorEventArgs(IrcMessageData data, string errormsg) : base(data) => ErrorMessage = errormsg;
internal PingEventArgs(IrcMessageData data, string pingdata) : base(data) => PingData = pingdata;
internal NickChangeEventArgs(IrcMessageData data, string oldnick, string newnick) : base(data) { OldNickname = oldnick; NewNickname = newnick; }
internal TopicEventArgs(IrcMessageData data, string channel, string topic) : base(data) { Channel = channel; Topic = topic; }
internal QuitEventArgs(IrcMessageData data, string who, string quitmessage) : base(data) { Who = who; QuitMessage = quitmessage; }
internal AwayEventArgs(IrcMessageData data, string who, string awaymessage) : base(data) { Who = who; AwayMessage = awaymessage; }
internal WhoEventArgs(IrcMessageData data, WhoInfo whoInfo) : base(data) => WhoInfo = whoInfo;
internal PartEventArgs(IrcMessageData data, string channel, string who, string partmessage) : base(data) { Channel = channel; Who = who; PartMessage = partmessage; }
internal InviteEventArgs(IrcMessageData data, string channel, string who) : base(data) { Channel = channel; Who = who; }
internal ChannelModeChangeEventArgs(IrcMessageData data, string channel, List <ChannelModeChangeInfo> modeChanges) : base(data) { Channel = channel; ModeChanges = modeChanges; }
internal TopicChangeEventArgs(IrcMessageData data, string channel, string who, string newtopic) : base(data) { Channel = channel; Who = who; NewTopic = newtopic; }
internal CtcpEventArgs(IrcMessageData data, string ctcpcmd, string ctcpparam) : base(data) { CtcpCommand = ctcpcmd; CtcpParameter = ctcpparam; }
internal UnbanEventArgs(IrcMessageData data, string channel, string who, string hostmask) : base(data) { Channel = channel; Who = who; Hostmask = hostmask; }
internal MotdEventArgs(IrcMessageData data, string motdmsg) : base(data) => MotdMessage = motdmsg;
internal ChannelRoleChangeEventArgs(IrcMessageData data, string channel, string who, string whom) : base(data) { Channel = channel; Who = who; Whom = whom; }
internal PongEventArgs(IrcMessageData data, TimeSpan lag) : base(data) => Lag = lag;
internal ChannelAdminEventArgs(IrcMessageData data, string channel, string who, string whom) : base(data, channel, who, whom) { }
internal IrcEventArgs(IrcMessageData data) => Data = data;
internal NamesEventArgs(IrcMessageData data, string channel, string[] userlist, string[] rawUserList) : base(data) { Channel = channel; UserList = userlist; RawUserList = rawUserList; }