Exemplo n.º 1
0
        public void Send(IChannel channel, string messageString)
        {
            IrcChannel ircChannel = this.channels[channel];
            INetwork network = this.connections[ircChannel.Client];
            IUser user = channel.Network.LocalUser;
            ircChannel.Client.LocalUser.SendMessage(ircChannel, messageString);

            Message message = new Message(network, channel, user, messageString, false);

            channel.Log.Add(message);
            this.client.Log.Add(message);
        }
Exemplo n.º 2
0
        void ircChannel_MessageReceived(object sender, IrcMessageEventArgs e)
        {
            IrcChannel ircChannel = (IrcChannel)sender;
            IrcUser ircUser = (IrcUser)e.Source;
            INetwork network = this.connections[ircChannel.Client];
            IChannel channel = this.channels[ircChannel];
            IUser user = this.users[ircUser];

            Application.Current.Dispatcher.InvokeAsync(() =>
            {
                bool highlighted = e.Text.Contains(network.LocalUser.Nickname);
                Message message = new Message(network, channel, user, e.Text, highlighted);
                channel.Log.Add(message);
                this.client.Log.Add(message);
                this.client.Alert |= highlighted && !this.client.WindowActive;
            });
        }