public override bool Hook_OnPrivateFromUser(string message, libirc.UserInfo user) { Notification result = Notification.RetrieveTarget(user.Nick); while (result != null) { IRC.DeliverMessage(result.Source_Name + "! " + user.Nick + " just sent me a private message. This message was delivered to you because you asked me to notify you about this user's activity. For more information, see https://meta.wikimedia.org/wiki/WM-Bot", result.Source_Name); this.Deliver(result); lock (Notification.NotificationList) { Notification.NotificationList.Remove(result); } result = Notification.RetrieveTarget(user.Nick); } if (message.StartsWith(Configuration.System.CommandPrefix + "notify ")) { this.NotifyUser(message, user, user); return(true); } if (message.StartsWith(Configuration.System.CommandPrefix + "unnotify ")) { this.UnnotifyUser(message, user, user); return(true); } return(false); }
public override void Hook_Kick(Channel channel, libirc.UserInfo source, string user) { Notification result = Notification.RetrieveTarget(user); while (result != null) { IRC.DeliverMessage(result.Source_Name + "! " + user + " just got kicked from " + channel.Name + ". This message was delivered to you because you asked me to notify you about this user's activity. For more information, see http://meta.wikimedia.org/wiki/WM-Bot", result.Source_Name); this.Deliver(result); lock (Notification.NotificationList) { Notification.NotificationList.Remove(result); } result = Notification.RetrieveTarget(user); } }
public override void Hook_PRIV(Channel channel, libirc.UserInfo invoker, string message) { Notification result = Notification.RetrieveTarget(invoker.Nick); while (result != null) { IRC.DeliverMessage(result.Source_Name + "! " + invoker.Nick + " just said something in " + channel.Name + ". This message was delivered to you because you asked me to notify you about this user's activity. For more information, see http://meta.wikimedia.org/wiki/WM-Bot", result.Source_Name); this.Deliver(result); lock (Notification.NotificationList) { Notification.NotificationList.Remove(result); } result = Notification.RetrieveTarget(invoker.Nick); } }
public override void Hook_Nick(Channel channel, libirc.UserInfo Target, string OldNick, string NewNick) { Notification result = Notification.RetrieveTarget(NewNick); while (result != null) { IRC.DeliverMessage(result.Source_Name + "! " + OldNick + " just changed nicknames to " + NewNick + " which you wanted to talk with, in " + channel.Name + ". This message was delivered to you because you asked me to notify" + "you about this user's activity. For more information, see " + "http://meta.wikimedia.org/wiki/WM-Bot", result.Source_Name); lock (Notification.NotificationList) { Notification.NotificationList.Remove(result); } result = Notification.RetrieveTarget(NewNick); } result = Notification.RetrieveTarget(OldNick); while (result != null) { IRC.DeliverMessage(result.Source_Name + "! " + OldNick + " just changed a nickname to " + Target.Nick + " which you wanted to talk with, in " + channel.Name + ". This message was delivered to you because you asked me to notify" + " you about this user's activity. For more information, see " + "http://meta.wikimedia.org/wiki/WM-Bot", result.Source_Name); lock (Notification.NotificationList) { Notification.NotificationList.Remove(result); } result = Notification.RetrieveTarget(OldNick); } if (NewNick.ToLower() != OldNick.ToLower()) { result = Notification.RetrieveSource(OldNick); while (result != null) { result.Source_Name = NewNick; result = Notification.RetrieveSource(OldNick); } } }