/// <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; }
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); } }
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)); } } }
internal void HandleUserInvited(IrcUser user) { lock (((ICollection)this.modesReadOnly).SyncRoot) OnUserInvited(new IrcUserEventArgs(user)); }
internal void HandleUserKicked(IrcUser user, string comment) { lock (((ICollection)this.modesReadOnly).SyncRoot) HandleUserKicked(this.users.Single(u => u.User == user), comment); }
internal void HandleTopicChanged(IrcUser source, string newTopic) { this.Topic = newTopic; OnTopicChanged(new IrcUserEventArgs(source)); }
/// <inheritdoc cref="Invite(string)"/> /// <param name="user">The user to invite to the channel</param> public void Invite(IrcUser user) { Invite(user.NickName); }
/// <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; }
internal void HandleInviteReceived(IrcUser inviter, IrcChannel channel) { OnInviteReceived(new IrcChannelInvitationEventArgs(channel, inviter)); }