Пример #1
0
 protected internal virtual void OnUserMessageReceived(PrivateMessageEventArgs e)
 {
     if(UserMessageReceived != null) UserMessageReceived(this, e);
 }
Пример #2
0
 public static void HandlePrivmsg(IrcClient client, IrcMessage message)
 {
     var eventArgs = new PrivateMessageEventArgs(message, client.ServerInfo);
     client.OnPrivateMessageReceived(eventArgs);
     if(eventArgs.PrivateMessage.IsChannelMessage) {
         try {
             // Populate this user's hostname and user from the message
             // TODO: Merge all users from all channels into one list and keep references to
             //       which channels they're in
             var channel = client.Channels[eventArgs.PrivateMessage.Source];
             var u = channel.Users[eventArgs.PrivateMessage.User.Nick];
             u.Hostname = eventArgs.PrivateMessage.User.Hostname;
             u.User = eventArgs.PrivateMessage.User.User;
         }
         catch { /* silently ignored */ }
         client.OnChannelMessageReceived(eventArgs);
     }
     else
         client.OnUserMessageReceived(eventArgs);
 }
Пример #3
0
 protected internal virtual void OnChannelMessageReceived(PrivateMessageEventArgs e)
 {
     if(ChannelMessageReceived != null) ChannelMessageReceived(this, e);
 }