private void UserKicked(Dictionary<string, dynamic> dict) { Connection con = Connections[(int)dict["cid"]]; ChatBuffer buf = con.Buffers[(int)dict["bid"]]; long eid = dict["eid"]; String kicker = dict["kicker"]; String msg = dict["msg"]; String kicked = dict["nick"]; Usermask mask = new Usermask { Identprefix = dict["kicker_ident_prefix"], User = dict["kicker_name"], Userhost = dict["kicker_host"], Mask = dict["kicker_hostmask"] }; buf.KickMember(kicker, msg, kicked, mask, eid); }
internal void SetUserMode(string from, Usermask fromMask, string nick, string mode, Usermask targetMask) { Member member = _members.Find(x => x.Nickname == nick); if (member == null) return; member.Mode = mode; if (memberModeChanged != null) memberModeChanged(this, new MemberModeChangedEventArgs { Member = member, FromNick = nick, FromMask = fromMask, NewMode = mode }); }
private void UserChannelMode(Dictionary<string, dynamic> dict) { Connection con = Connections[(int)dict["cid"]]; ChatBuffer buf = con.Buffers[(int)dict["bid"]]; string @from = dict.ContainsKey("from") ? dict["from"] : dict["server"]; String nick = dict["nick"]; String mode = dict["diff"]; Usermask fromMask = new Usermask(); if (dict.ContainsKey("from")) fromMask = new Usermask { Identprefix = dict["ident_prefix"], User = dict["from_name"], Userhost = dict["from_host"], Mask = dict["hostmask"] }; Usermask targetMask = new Usermask { Identprefix = dict["target_ident_prefix"], User = dict["target_name"], Userhost = dict["target_host"], Mask = dict["target_hostmask"] }; buf.SetUserMode(from, fromMask, nick, mode, targetMask); }
internal void KickMember(string kicker, string msg, string kicked, Usermask mask, long eid) { Member kickerMember = GetMember(kicker); Member kickedMember = GetMember(kicked); if (kickedMember == null) kickerMember = new Member {Nickname = kicker}; if (kickedMember == null) kickedMember = new Member {Nickname = kicker}; RemoveMember(kickedMember, "", -1, false); if (memberKicked != null) memberKicked(this, new MemberKickedEventArgs {Eid = eid, Kicked = kickedMember, Kicker = kickerMember, Message = msg}); AddMessage(new Message { ChannelName = Name, Eid = eid, From = kicker, Text = "has kicked " + kicked + " (" + msg + ")" }); }