/// <summary> /// Build a KickEventArgs. /// </summary> /// <param name="kickednick">The nick of the user been kicked.</param> /// <param name="kickeruser">The UserInfo of the user who kicked the user.</param> /// <param name="reason">The reason why he kicked.</param> /// <param name="from">From which channel.</param> /// <param name="isyou">Is the current user of the IRCConnection.</param> public KickEventArgs(string kickednick, UserInfo kickeruser, string reason, string from) { this.m_kickednick = kickednick; this.m_user = kickeruser; this.m_reason = reason; this.m_from = from; }
public void SetData(string msg,UserInfo usr, string from, bool Is) { this.m_user = usr; this.m_message = msg; this.m_from = from; this.m_isfromchannel = Is; }
private void cmdTOPIC(string[] args) { _Parsed = true; string[] source = args[0].Split(new char[] { '!' }); string nick = source[0].Replace(":", ""); string realname = source[1].Split(arobas)[0]; string hostname = source[1].Split(arobas)[1]; UserInfo user = new UserInfo(nick, realname, hostname, false); string channel = args[2]; string topic = UtilityService.JoinString(args, 3, args.Length).Remove(0, 1); TopicEventArgs e = new TopicEventArgs(user, topic, channel); oTopicEvent(this, e); }
/// <summary> /// Build a NoticeEventArgs. /// </summary> /// <param name="user">The user where the notice came from.</param> /// <param name="message">The message.</param> /// <param name="from">Destination.</param> public NoticeEventArgs(UserInfo user, string message, string from) { this.m_user = user; this.m_message = message; this.m_from = from; }
public JoinEventArgs(string channel, UserInfo joineduser,string reason) { this.m_channel = channel; this.m_user = joineduser; this.reason = reason; }
/// <summary> /// Build a JoinEventArgs. /// </summary> /// <param name="channel">The channel where the user joined.</param> /// <param name="joineduser">UserInfo of the joineduser.</param> public JoinEventArgs(string channel, UserInfo joineduser) { this.m_channel = channel; this.m_user = joineduser; }
/// <summary> /// Build a banlist item /// </summary> /// <param name="hostbanned">Host banned in a string.</param> /// <param name="user">UserInfo class of the user that banned this host.</param> /// <param name="datetime">DateTime class when the user banned this host.</param> public BanListItem(string hostbanned, UserInfo user, DateTime datetime, int p_nbMinsBanned) { this.m_hostbanned = hostbanned; this.m_user = user; this.m_datetime = datetime; this.m_nbMinsBanned= p_nbMinsBanned; }
private void cmdPRIVMSG(string[] args) { _Parsed = true; string[] source = args[0].Split(new char[] { '!' }); string nick = source[0].Replace(":", ""); string realname = source[1].Split(arobas)[0]; string hostname = source[1].Split(arobas)[1]; UserInfo user = new UserInfo(nick, realname, hostname, false); string channel = args[2]; string message = UtilityService.JoinString(args, 3, args.Length).Remove(0, 1); PrivMsgEventArgs e; if (channel.StartsWith("#") == false) { e = new PrivMsgEventArgs(user, message, nick, false); } else { e = new PrivMsgEventArgs(user, message, channel, true); } _Pmargs = e; oPrivMsgEvent(this, e); }
private void cmdQUIT(string[] args) { string[] source = args[0].Split(new char[] { '!' }); string nick = source[0].Replace(":", ""); string realname = source[1].Split(arobas)[0]; string hostname = source[1].Split(arobas)[1]; UserInfo user = new UserInfo(nick, realname, hostname, false); string reason = UtilityService.JoinString(args, 2, args.Length).Trim(new char[] { ':' }); JoinEventArgs e = new JoinEventArgs("", user,reason); if (oQuitEvent != null) oQuitEvent(this, e); //connection.OnQuitCommandReceived(user, reason); }
public ActionEventArgs(UserInfo user, string from, string message) { this.m_user = user; this.m_from = from; this.m_message = message; }
/// <summary> /// Build the CTCPReceivedEventArgs. /// </summary> /// <param name="user">The user who came from the CTCP.</param> /// <param name="ctcptype">CTCP type.</param> /// <param name="from">From whom(can be a user nick or a channel).</param> public CTCPReceivedEventArgs(UserInfo user, string ctcptype, string from) { this.m_user = user; this.m_ctcptype = ctcptype; this.m_from = from; }
public PrivMsgEventArgs(UserInfo user, string message, string from, bool isfromachannel) { this.m_user = user; this.m_message = message; this.m_from = from; this.m_isfromchannel = isfromachannel; }
private void rtbTalk_KeyDown(object sender, KeyEventArgs e) { if (e.KeyCode == Keys.Enter) { //privmsg #channel :messagePart if (rtbTalk.Text.StartsWith("/")) { ircCore1.SendRaw(rtbTalk.Text.Substring(1)); } else if (rtbTalk.Text.Length > 0) { PrivMsgEventArgs nPME = new PrivMsgEventArgs(); UserInfo uinfo = new UserInfo(); uinfo.RealName = dc.GetName(); uinfo.Nick = dc.GetNick(); rtbTalk.Text = rtbTalk.Text.Replace("\n", ""); rtbMsg.AppendText(rtbTalk.Text + "\n"); string nic = (string)lbPrivates.SelectedItem; ircCore1.SendRaw("PRIVMSG #" + nic + " :" + rtbTalk.Text + "\r\n"); } rtbTalk.Text = ""; e.SuppressKeyPress = true; } }
private void rtbTalk_KeyDown(object sender, KeyEventArgs e) { if (e.KeyCode == Keys.Up) { rtbTalk.Text = LastSent; rtbTalk.Select(rtbTalk.Text.Length, 0); e.SuppressKeyPress = true; } if (e.KeyCode == Keys.Tab) { if (rtbTalk.Text.Length > 1 ) { string name; string test = FindLastWord(rtbTalk.Text); foreach (string s in currentCML.nicks) { if (s.Length == 0) continue; if (s[0] == '@' || s[0] == '+') name = s.Substring(1); else name = s; if (name.ToLower().StartsWith(test)) { rtbTalk.Text = rtbTalk.Text.Substring(0, lidx); if (IsFirstWord) { rtbTalk.AppendText(name + ": "); } else rtbTalk.AppendText(" " + name); } } } e.SuppressKeyPress = true; } if (e.KeyCode == Keys.Enter) { //privmsg #channel :messagePart if (rtbTalk.Text.StartsWith("/")) { ircCore1.SendRaw(rtbTalk.Text.Substring(1)); } else if (rtbTalk.Text.Length > 0) { PrivMsgEventArgs nPME = new PrivMsgEventArgs(); UserInfo uinfo = new UserInfo(); uinfo.RealName = dc.GetName(); uinfo.Nick = dc.GetNick(); rtbTalk.Text = rtbTalk.Text.Replace("\n", ""); nPME.SetData(rtbTalk.Text, uinfo, selectedChannel, false); ChanMessageList cml; if (!ChannelList.TryGetValue(nPME.From, out cml)) { cml = new ChanMessageList(); ChannelList.Add(nPME.From, cml); } cml.AddPrivMsg(nPME); AppendText(nPME, true); ircCore1.SendRaw("PRIVMSG #" + selectedChannel + " :" + rtbTalk.Text + "\r\n"); LastSent = rtbTalk.Text; } rtbTalk.Text = ""; e.SuppressKeyPress = true; } }
private void cmdMODE(string[] args) { _Parsed = true; string[] source = args[0].Split(new char[] { '!' }); string nick = source[0].Replace(":", ""); string realname; string hostname; if (args[0].IndexOf("!") > -1) { realname = source[1].Split(arobas)[0]; hostname = source[1].Split(arobas)[1]; } else { hostname = null; realname = null; } string channel = args[2].Replace(":", ""); string mode = UtilityService.JoinString(args, 3, args.Length); UserInfo user = new UserInfo(nick, realname, hostname, false); ModeEventArgs e = new ModeEventArgs(user, mode, channel); if (oModeEvent != null) oModeEvent(this, e); }
private void cmdNOTICE(string[] args) { _Parsed = true; string[] source = args[0].Split(new char[] { '!' }); string nick = source[0].Replace(":", ""); string realname; string hostname; if (args[0].IndexOf("!") > -1) { realname = source[1].Split(arobas)[0]; hostname = source[1].Split(arobas)[1]; } else { hostname = null; realname = null; } UserInfo user = new UserInfo(nick, realname, hostname, false); string channel = args[2]; if (channel.StartsWith("@")) channel = channel.Remove(0, 1); string message = UtilityService.JoinString(args, 3, args.Length).Remove(0, 1); if (message.StartsWith(UtilityService.CTCPMarker)) { CTCPReplyEventArgs e_ctcp; string reply = message.Replace(UtilityService.CTCPMarker, ""); string ctcptype = (reply.Split(new char[] { ' ' }))[0]; reply = reply.Replace(ctcptype, ""); if (ctcptype.ToUpper() == "PING") { DateTime now = DateTime.Now; DateTime ping = UtilityService.ConvertCtimeToDateTime(reply); TimeSpan difference = now - ping; reply = Convert.ToInt32(difference.TotalSeconds).ToString() + " second(s)"; } e_ctcp = new CTCPReplyEventArgs(user, ctcptype, reply); //connection.OnCTCPReplyEventReceived(e_ctcp); } else { NoticeEventArgs e = new NoticeEventArgs(user, message, channel); if (oNoticeEvent != null) oNoticeEvent(this, e); // connection.OnNoticeEventReceived(e); } }
/// <summary> /// Build a CTCPReplyEventArgs. /// </summary> /// <param name="user">The user who reply to the CTCP message.</param> /// <param name="ctcptype">CTCP type.</param> /// <param name="reply">The reply of the CTCP message.</param> public CTCPReplyEventArgs(UserInfo user, string ctcptype, string reply) { this.m_user = user; this.m_ctcptype = ctcptype; this.m_reply = reply; }
//>> :kubrick.freenode.net 470 foxjazz #csharp ##csharp :Forwarding to another channel private void cmdKICK(string[] args) { string[] source = args[0].Split(new char[] { '!' }); string nick = source[0].Replace(":", ""); string realname = source[1].Split(arobas)[0]; string hostname = source[1].Split(arobas)[1]; UserInfo user = new UserInfo(nick, realname, hostname, false); string channel = args[2].Replace(":", ""); string kickednick = args[3]; string reason = UtilityService.JoinString(args, 4, args.Length).Trim(new char[] { ':' }); KickEventArgs e; //bool isyou = false; //if (kickednick == connection.UserInformation.Nick) //{ // isyou = true; //} e = new KickEventArgs(kickednick, user, reason, channel); oKickEvent(this, e); }
/// <summary> /// Build a TopicEventArgs. /// </summary> /// <param name="user">The user who changed the topic.</param> /// <param name="topic">The new topic.</param> /// <param name="channel">The channel where the topic was changed.</param> public TopicEventArgs(UserInfo user, string topic, string channel) { this.m_user = user; this.m_topic = topic; this.m_channel = channel; }
private void cmdJOIN(string[] args) { _Parsed = true; string[] source = args[0].Split(new char[] { '!' }); string nick = source[0].Replace(":", ""); string realname = source[1].Split(arobas)[0]; string hostname = source[1].Split(arobas)[1]; UserInfo user = new UserInfo(nick, realname, hostname, false); string channel = args[2].Replace(":", ""); JoinEventArgs e = new JoinEventArgs(channel, user); if (oJoinEvent != null) oJoinEvent(this, e); }
/// <summary> /// Build a ModeEventArgs. /// </summary> /// <param name="user">The user who change the mode</param> /// <param name="mode">The mode string.</param> /// <param name="channel">The channel where the mode was changed.</param> public ModeEventArgs(UserInfo user, string mode, string channel) { this.m_user = user; this.m_mode = mode; this.m_channel = channel; }