Exemplo n.º 1
0
        /// <summary>
        /// Initializes a new instance of the <see cref="IrcChannelInvitationEventArgs"/> class.
        /// </summary>
        /// <param name="channel">The channel to which the recipient user is invited.</param>
        /// <param name="inviter">The user inviting the recipient user to the channel.</param>
        public IrcChannelInvitationEventArgs(IrcChannel channel, IrcUser inviter)
            : base(channel)
        {
            if (inviter == null)
            {
                throw new ArgumentNullException("inviter");
            }

            this.Inviter = inviter;
        }
Exemplo n.º 2
0
        internal IrcChannelUser(IrcUser user, IEnumerable <char> modes = null)
        {
            this.user = user;

            this.modes         = new HashSet <char>();
            this.modesReadOnly = new ReadOnlySet <char>(this.modes);
            if (modes != null)
            {
                this.modes.AddRange(modes);
            }
        }
Exemplo n.º 3
0
 protected override void OnChannelModeChanged(IrcChannel channel, IrcUser source, string newModes, IEnumerable <string> newModeParameters)
 {
     // Twitch doesn't actually send JOIN messages. This means we need to add users
     // to the channel when changing their mode if we haven't already.
     foreach (string username in newModeParameters)
     {
         IrcUser user = GetUserFromNickName(username);
         if (channel.GetChannelUser(user) == null)
         {
             channel.HandleUserJoined(new IrcChannelUser(user));
         }
     }
 }
Exemplo n.º 4
0
 internal void HandleUserInvited(IrcUser user)
 {
     lock (((ICollection)this.modesReadOnly).SyncRoot)
         OnUserInvited(new IrcUserEventArgs(user));
 }
Exemplo n.º 5
0
 internal void HandleUserKicked(IrcUser user, string comment)
 {
     lock (((ICollection)this.modesReadOnly).SyncRoot)
         HandleUserKicked(this.users.Single(u => u.User == user), comment);
 }
Exemplo n.º 6
0
        internal void HandleTopicChanged(IrcUser source, string newTopic)
        {
            this.Topic = newTopic;

            OnTopicChanged(new IrcUserEventArgs(source));
        }
Exemplo n.º 7
0
 /// <inheritdoc cref="Invite(string)"/>
 /// <param name="user">The user to invite to the channel</param>
 public void Invite(IrcUser user)
 {
     Invite(user.NickName);
 }
Exemplo n.º 8
0
 /// <inheritdoc/>
 /// <summary>
 /// Initializes a new instance of the <see cref="IrcUserEventArgs"/> class.
 /// </summary>
 /// <param name="user">The user that the event concerns, or <see langword="null"/> for no user.</param>
 public IrcUserEventArgs(IrcUser user, string comment = null)
     : base(comment)
 {
     this.User = user;
 }
Exemplo n.º 9
0
 internal void HandleInviteReceived(IrcUser inviter, IrcChannel channel)
 {
     OnInviteReceived(new IrcChannelInvitationEventArgs(channel, inviter));
 }