Exemplo n.º 1
0
        /// <summary>
        /// Called when a user is banned on the channel
        /// </summary>
        /// <param name="hostmask">The hostmask of the person being banned</param>
        /// <param name="who">The nickname of the person who performed the ban</param>
        public static void OnIrcBan(string hostmask, string who)
        {
            lock (State.GlobalSync)
            {
                if (state == BanSystemState.WaitingForChannel) throw new Exception("Invalid bansystem state for this command");
                ExtendedBanInfo info = new ExtendedBanInfo();
                info.SetBy = who;
                info.SetAt = DateTime.UtcNow;
                extended[hostmask] = info;

                if (who == "Q" && next_q_ban == hostmask)
                {
                    //expected, no refresh
                    next_q_ban = null;
                }
                else if (who != Irc.Nickname)
                {
                    //unexpected, refresh
                    RefreshFromIrc();
                }
            }
        }
Exemplo n.º 2
0
 /// <summary>
 /// Called when a channel ban list item has been received
 /// </summary>
 /// <param name="hostmask">The hostmask that was banned</param>
 /// <param name="who">The nickname that set the ban</param>
 /// <param name="when">The time at which the ban was set</param>
 public static void OnIrcBanList(string hostmask, string who, DateTime when)
 {
     lock (State.GlobalSync)
     {
         if (state != BanSystemState.WaitingForChannel) throw new Exception("Invalid state for this command");
         ExtendedBanInfo info = new ExtendedBanInfo();
         info.SetBy = who;
         info.SetAt = when;
         extended[hostmask] = info;
     }
 }