Пример #1
0
        static public void KickAction(Message message)
        {
            var ctx = ContextCollection.GetByName(message.ParamsArray[1]);

            if (ContextCollection.Server.Client.Nickname == message.ParamsArray[2])
            {
                ContextCollection.Server.WriteLine(string.Format("You were kicked from {0} by {1} ({2})", message.ParamsArray[1], message.Nick, message.Text));
                ContextCollection.Remove(ctx);
            }
            else
            {
                ctx.WriteLine(RTF.ColourString(string.Format("{0} has been kicked by {1} ({2})", message.ParamsArray[2], message.Nick, message.Text), IrcColor.Orange));
                ctx.UsersList.Remove(message.ParamsArray[2]);
                Program.MainWindow.UpdateUsersList();
            }
        }
Пример #2
0
        static public void CloseCommand(string _params)
        {
            if (ContextCollection.Current is IrcServer)
            {
                ContextCollection.Current.WriteLine("You cannot close the server context!");
            }
            else
            {
                var ctxToClose = ContextCollection.Current;

                if (ctxToClose is IrcChannel)
                {
                    PartCommand(ctxToClose.Name);
                }

                ContextCollection.Current = ContextCollection.Server;
                ContextCollection.Remove(ctxToClose);
                Program.MainWindow.UpdateContext();
            }
        }
Пример #3
0
        static public void PartAction(Message message)
        {
            if (message.Nick == ContextCollection.Server.Client.Nickname)
            {
                ContextCollection.Remove(ContextCollection.GetByName(message.ParamsArray[1]));
            }
            else
            {
                var ctx = ContextCollection.GetByName(message.ParamsArray[1]);

                if (ctx != null)
                {
                    ((IrcChannel)ctx).Users.Remove(message.Nick);
                    ctx.WriteLine(RTF.ColourString(message.Nick + " has left.", IrcColor.Orange));


                    Program.MainWindow.UpdateUsersList();
                }
            }
        }