Exemplo n.º 1
0
 private void __evt_Error(XmlRcs.ErrorEventArgs er)
 {
     if (this.On_Error != null)
         this.On_Error(this, er);
 }
Exemplo n.º 2
0
 void Provider_On_Exception(object sender, XmlRcs.ExEventArgs args)
 {
     HandleException(args.Exception);
 }
Exemplo n.º 3
0
 private void OnChange(object sender, XmlRcs.EditEventArgs ex)
 {
     ex.Change.EmptyNulls();
     XmlRcs.RecentChange edit = ex.Change;
     if (edit.Type != XmlRcs.RecentChange.ChangeType.Edit && edit.Type != XmlRcs.RecentChange.ChangeType.New)
         return;
     if (edit.Type == XmlRcs.RecentChange.ChangeType.Edit && edit.RevID < 1)
     {
         Syslog.ErrorLog("RC: Invalid revid: " + edit.OriginalXml);
         return;
     }
     List<RecentChanges> recentChanges = new List<RecentChanges>();
     RecentChanges.LastMessage = DateTime.Now;
     lock (RecentChanges.recentChangesList)
     {
         recentChanges.AddRange(RecentChanges.recentChangesList);
     }
     foreach (RecentChanges curr in recentChanges)
     {
         if (GetConfig(curr.channel, "RC.Enabled", false))
         {
             lock (curr.MonitoredPages)
             {
                 foreach (RecentChanges.IWatch iwatch in curr.MonitoredPages)
                 {
                     if (iwatch.Site == edit.ServerName || iwatch.Site == "*")
                     {
                         if ((!edit.Minor && edit.Bot && GetConfig(curr.channel, "Bot.Enabled", true)) || (!edit.Bot && edit.Minor && GetConfig(curr.channel, "Minor.Enabled", true)) || (!edit.Bot && !edit.Minor) || (edit.Minor && GetConfig(curr.channel, "Minor.Enabled", true) && edit.Bot && GetConfig(curr.channel, "Bot.Enabled", true)))
                         {
                             if (edit.Title == iwatch.Page)
                             {
                                 if (edit.LengthNew != 0 || edit.LengthOld != 0)
                                 {
                                     int size = edit.LengthNew - edit.LengthOld;
                                     string sx = size.ToString();
                                     if (size >= 0)
                                     sx = "+" + sx;
                                     edit.Summary = "[" + sx + "] " + edit.Summary;
                                 }
                                 if (iwatch.Site == null)
                                     DebugLog("NULL pointer on idata 1", 2);
                                 IRC.DeliverMessage(Format(edit.ServerName, edit.ServerName, edit.Title, edit.User, edit.RevID.ToString(), edit.Summary,
                                     curr.channel, edit.Bot, edit.Type == XmlRcs.RecentChange.ChangeType.New, edit.Minor), curr.channel.Name, libirc.Defs.Priority.Low);
                             }
                             else if (iwatch.Page.EndsWith("*") && edit.Title.StartsWith(iwatch.Page.Replace("*", "")))
                             {
                                 if (iwatch.Site == null)
                                 {
                                     DebugLog("NULL pointer on idata 2", 2);
                                 }
                                 IRC.DeliverMessage(Format(edit.ServerName, edit.ServerName, edit.Title, edit.User, edit.RevID.ToString(), edit.Summary, curr.channel, edit.Bot,
                                         edit.Type == XmlRcs.RecentChange.ChangeType.New, edit.Minor), curr.channel.Name, libirc.Defs.Priority.Low);
                             }
                         }
                     }
                 }
             }
         }
     }
 }
Exemplo n.º 4
0
 private void OnError(object sender, XmlRcs.ErrorEventArgs ex)
 {
     if (!string.IsNullOrEmpty(Configuration.System.DebugChan))
     {
         if (ex.Fatal)
             IRC.DeliverMessage("DEBUG XmlRcs FATAL: " + ex.Message, Configuration.System.DebugChan);
         else
             IRC.DeliverMessage("DEBUG XmlRcs ERROR: " + ex.Message, Configuration.System.DebugChan);
     }
     ErrorLog(ex.Message);
 }
Exemplo n.º 5
0
 public void ExceptionHandler(object sender, XmlRcs.ExEventArgs args)
 {
     ErrorLog(args.Exception.ToString());
 }