Ejemplo n.º 1
0
 public override void Hook_Initialise(Forms.Main main)
 {
     menu = new Gtk.MenuItem("Display ignored text");
     collector = new Graphics.Window();
     collector.CreateChat(null, false, false, false);
     menu.Activated += new EventHandler(Display);
     collector.WindowName = "Ignored";
     main.ToolsMenu.Append(menu);
     menu.Show();
 }
Ejemplo n.º 2
0
        /// <summary>
        /// Destroy this class, be careful, it can't be used in any way after you
        /// call this
        /// </summary>
        public void Destroy()
        {
            if (IsDestroyed)
            {
                // avoid calling this function multiple times, otherwise it could crash
                Core.DebugLog("Destroy() called multiple times on " + ServerName);
                return;
            }

            Core.DebugLog("Destroying network " + ServerName);

            isDestroyed = true;

            lock (ChannelList)
            {
                ChannelList.Clear();
            }

            if (wChannelList != null)
            {
                wChannelList.Hide();
                wChannelList.Dispose();
                wChannelList = null;
            }

            lock (PrivateChat)
            {
                // release all windows
                foreach (User user in PrivateChat)
                {
                    user.Destroy();
                }
                PrivateChat.Clear();
            }

            lock (Channels)
            {
                foreach (Channel xx in Channels)
                {
                    xx.Destroy();
                }
                Channels.Clear();
            }

            lock (PrivateWins)
            {
                foreach (Graphics.Window cw in PrivateWins.Values)
                {
                    cw._Destroy();
                }
                PrivateWins.Clear();
            }

            _Protocol = null;
            SystemWindow = null;

            lock (Descriptions)
            {
                Descriptions.Clear();
            }

            Core.SystemForm.ChannelList.RemoveServer(this);
        }
Ejemplo n.º 3
0
        /// <summary>
        /// Creates a new network, requires name and protocol type
        /// </summary>
        /// <param name="Server">Server name</param>
        /// <param name="protocol">Protocol that own this instance</param>
        public Network(string Server, Protocol protocol)
        {
            randomuqid = Core.RetrieveRandom();
            lock (Descriptions)
            {
                Descriptions.Clear();
                Descriptions.Add('n', "no /knock is allowed on channel");
                Descriptions.Add('r', "registered channel");
                Descriptions.Add('m', "talking is restricted");
                Descriptions.Add('i', "users need to be invited to join");
                Descriptions.Add('s', "channel is secret (doesn't appear on list)");
                Descriptions.Add('p', "channel is private");
                Descriptions.Add('A', "admins only");
                Descriptions.Add('O', "opers chan");
                Descriptions.Add('t', "topic changes can be done only by operators");
            }
            _Protocol = protocol;
            ServerName = Server;
            Quit = Configuration.UserData.quit;
            Nickname = Configuration.UserData.nick;

            UserName = Configuration.UserData.user;
            Ident = Configuration.UserData.ident;
            if (protocol.GetType() == typeof(ProtocolSv))
            {
                SystemWindow = protocol.CreateChat("!" + ServerName, false, this, false, "!" + randomuqid + ServerName, false, true);
                Core.SystemForm.ChannelList.InsertNetwork(this, (ProtocolSv)protocol);
            }
            else
            {
                SystemWindow = protocol.CreateChat("!system", true, this, false, null, false, true);
                Core.SystemForm.ChannelList.InsertNetwork(this);
            }
            Hooks._Network.CreatingNetwork(this);
        }
Ejemplo n.º 4
0
 /// <summary>
 /// Retrieve window
 /// </summary>
 /// <returns></returns>
 public Graphics.Window RetrieveWindow()
 {
     if (Chat == null)
     {
         if (_Network == null)
         {
             throw new Core.PidgeonException("Network is NULL for " + Name);
         }
         if (_Network._Protocol == null)
         {
             throw new Core.PidgeonException("Protocol is NULL for " + _Network.ServerName);
         }
         lock (_Network._Protocol.Windows)
         {
             foreach (var curr in _Network._Protocol.Windows)
             {
                 if (curr.Key == _Network.SystemWindowID + Name)
                 {
                     this.Chat = curr.Value;
                     return curr.Value;
                 }
             }
         }
     }
     return Chat;
 }
Ejemplo n.º 5
0
        /// <summary>
        /// Destroy this class, be careful, it can't be used in any way after you
        /// call this
        /// </summary>
        public void Destroy()
        {
            if (IsDestroyed)
            {
                // prevent this from being called multiple times
                return;
            }

            destroyed = true;

            if (Configuration.Kernel.Debugging)
            {
                Core.DebugLog("Destroying channel " + Name);
            }

            Core.SystemForm.ChannelList.RemoveChannel(this);

            lock (UserList)
            {
                UserList.Clear();
            }

            Chat = null;
            ChannelWork = false;
            _Network = null;

            if (Invites != null)
            {
                lock (Invites)
                {
                    Invites.Clear();
                }
            }

            if (Exceptions != null)
            {
                lock (Exceptions)
                {
                    Exceptions.Clear();
                }
            }

            if (Bans != null)
            {
                lock (Bans)
                {
                    Bans.Clear();
                }
            }
        }
Ejemplo n.º 6
0
 /// <summary>
 /// Constructor (normal)
 /// </summary>
 public Channel(Network network)
 {
     _Network = network;
     ChannelWork = true;
     ChannelMode = new NetworkMode(NetworkMode.ModeType.Channel, _Network);
     Topic = "";
     TopicUser = "";
     Chat = null;
 }
Ejemplo n.º 7
0
        /// <summary>
        /// Destroy this instance.
        /// </summary>
        public void _Destroy()
        {
            if (IsDestroyed)
            {
                return;
            }

            destroyed = true;
            lock (UndrawnLines)
            {
                UndrawnLines.Clear();
            }
            lock (ContentLines)
            {
                ContentLines.Clear();
            }
            simpleview.Destroy();
            RT = null;
            owner = null;
            this.Destroy();
        }
Ejemplo n.º 8
0
 /// <summary>
 /// Creates a new scrollback instance
 /// </summary>
 /// <param name="_ParentWindow"></param>
 public Scrollback(Graphics.Window _ParentWindow)
 {
     Font.Family = Configuration.CurrentSkin.LocalFont;
     Font.Size = Configuration.CurrentSkin.FontSize;
     this.owner = _ParentWindow;
     ReloadWaiting = true;
 }
Ejemplo n.º 9
0
 /// <summary>
 /// Connect to quassel core
 /// </summary>
 /// <returns></returns>
 public override bool Open()
 {
     sw = CreateChat("!root", true, null);
     Core.SystemForm.ChannelList.InsertQuassel(this);
     _Thread = new System.Threading.Thread(Start);
     _Thread.Name = "Quassel main";
     Core.SystemThreads.Add(_Thread);
     _Thread.Start();
     return true;
 }
Ejemplo n.º 10
0
 private void ClearWins()
 {
     lock (Windows)
     {
         foreach (Graphics.Window xx in Windows.Values)
         {
             xx._Destroy();
         }
     }
     Current = null;
     Windows.Clear();
 }
Ejemplo n.º 11
0
 /// <summary>
 /// Request window to be shown
 /// </summary>
 /// <param name="name"></param>
 /// <returns></returns>
 public virtual bool ShowChat(string name)
 {
     lock (Windows)
     {
         if (Windows.ContainsKey(name))
         {
             Current = Windows[name];
             Core.SystemForm.SwitchWindow(Current);
             Current.Redraw();
             if (Current.isChannel)
             {
                 if (Core.SelectedNetwork != null)
                 {
                     Core.SelectedNetwork.RenderedChannel = Core.SelectedNetwork.getChannel(Current.WindowName);
                 }
             }
             Core.SystemForm.setChannel(name);
             if (Current.Making == false)
             {
                 Current.textbox.setFocus();
             }
             Core.SystemForm.Chat = Windows[name];
             Current.Making = false;
             Core.SystemForm.UpdateStatus();
         }
     }
     return true;
 }
Ejemplo n.º 12
0
 /// <summary>
 /// Open the connection to foreign client OR open a local listener
 /// </summary>
 /// <returns></returns>
 public override bool Open()
 {
     systemwindow = CreateChat(UserName, false, null, false, null, false, true);
     systemwindow._Protocol = this;
     Core.SystemForm.ChannelList.InsertDcc(this);
     thread = new Thread(main);
     thread.Name = "DCC chat " + UserName;
     Core.SystemThreads.Add(thread);
     thread.Start();
     return true;
 }