Exemplo n.º 1
0
 public static PageWatcherController instance()
 {
     return _instance ?? ( _instance = new PageWatcherController( ) );
 }
Exemplo n.º 2
0
        private static void pageWatcherNotificationEvent(PageWatcherController.RcPageChange rcItem)
        {
            string[] messageParams = {
                                         rcItem.title, rcItem.user, rcItem.comment, rcItem.diffUrl, rcItem.byteDiff,
                                         rcItem.flags
                                     };
            string message = new Message().get("pageWatcherEventNotification", messageParams);

            DAL.Select q = new DAL.Select("channel_name");
            q.addJoin("channel", DAL.Select.JoinTypes.Inner,
                      new DAL.WhereConds(false, "pwc_channel", "=", false, "channel_id"));
            q.addJoin("watchedpages", DAL.Select.JoinTypes.Inner,
                      new DAL.WhereConds(false, "pw_id", "=", false, "pwc_pagewatcher"));
            q.addWhere(new DAL.WhereConds("pw_title", rcItem.title));
            q.setFrom("pagewatcherchannels");

            ArrayList channels = DAL.singleton().executeSelect(q);

            foreach (object[] item in channels)
            {
                string channel = (string) item[0];
                if (Configuration.singleton()["silence",channel] == "false")
                    irc.ircPrivmsg(channel, message);
            }
        }