public override void Hook_Quit(libirc.UserInfo user, string Message) { Notification result = Notification.RetrieveSource(user.Nick); while (result != null) { lock (Notification.NotificationList) { if (Notification.NotificationList.Contains(result)) { Notification.NotificationList.Remove(result); } } result = Notification.RetrieveSource(user.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); } } }