Exemple #1
0
        private void OnNickChanged(IrcMessage message)
        {
            var e       = new IrcNickEventArgs(message);
            var handler = this.NickChanged;

            if (this.IsSelf(e.OldNickname))
            {
                this.Nickname = e.NewNickname;
                handler       = this.SelfNickChanged;
            }
            this.RaiseEvent(handler, e);
        }
        private void Session_NickChanged(object sender, IrcNickEventArgs e)
        {
            bool isIgnored = App.IsIgnoreMatch(e.Message.From, IgnoreActions.NickChange);

            if (this.IsChannel && _nickList.Contains(e.OldNickname))
            {
                if (!isIgnored)
                {
                    this.Write("Nick", e.Message.Time, string.Format("{0} is now known as {1}", e.OldNickname, e.NewNickname));
                }
                _nickList.ChangeNick(e.OldNickname, e.NewNickname);
            }
        }
        private void Session_SelfNickChanged(object sender, IrcNickEventArgs e)
        {
            if (this.IsServer || this.IsChannel)
            {
                this.Write("Nick", e.Message.Time, string.Format("You are now known as {0}", e.NewNickname));
            }
            this.SetTitle();

            if (this.IsChannel)
            {
                _nickList.ChangeNick(e.OldNickname, e.NewNickname);
            }
        }
Exemple #4
0
        private void Session_NickChanged(object sender, IrcNickEventArgs e)
        {
            this.BeginInvoke(() =>
                {
                    if (e.IsSelf)
                    {
                        if (this.IsServer || this.IsChannel)
                        {
                            this.Write("Nick", string.Format("You are now known as {0}", e.NewNickname));
                        }
                        this.SetTitle();
                    }
                    else if (this.IsChannel && this.IsPresent(e.OldNickname))
                    {
                        this.Write("Nick", string.Format("{0} is now known as {1}", e.OldNickname, e.NewNickname));
                    }

                    if (this.IsChannel && this.IsPresent(e.OldNickname))
                    {
                        this.ChangeNick(e.OldNickname, e.NewNickname);
                    }
                });
        }