RSSClient: Add the location header provided URL to the error message, if we fail...
[citadel.git] / citadel / modules / rssclient / rss_atom_parser.h
index b5bd79c4b9b66322f30520329f86d0d800554b3a..a9ff561c5a8fe5c49bc7a333e7e236366ded2650 100644 (file)
@@ -1,23 +1,24 @@
 /*
  * Bring external RSS feeds into rooms.
  *
- * Copyright (c) 2007-2010 by the citadel.org team
+ * Copyright (c) 2007-2012 by the citadel.org team
  *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 3 of the License, or
- * (at your option) any later version.
+ * This program is open source software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License version 3.
+ * 
+ * 
  *
  * This program is distributed in the hope that it will be useful,
  * but WITHOUT ANY WARRANTY; without even the implied warranty of
  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  * GNU General Public License for more details.
  *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+ * 
+ * 
+ * 
  */
 
+#include "internet_addressing.h"
 
 #define RSS_UNSET       (1<<0)
 #define RSS_RSS         (1<<1)
@@ -55,39 +56,69 @@ struct rss_item {
        StrBuf *author_url;
        StrBuf *author_email;
 };
+void flush_rss_item(rss_item *ri);
 
 struct rss_room_counter {
        int count;
        long QRnumber;
 };
 
+typedef struct __networker_save_message {
+       struct CtdlMessage Msg;
+       StrBuf *MsgGUID;
+       StrBuf *Message;
+
+       StrBuf *author_email;
+       StrBuf *author_or_creator;
+       StrBuf *title;
+       StrBuf *description;
+
+       StrBuf *link;
+       StrBuf *linkTitle;
+
+       StrBuf *reLink;
+       StrBuf *reLinkTitle;
+} networker_save_message;
+
+typedef struct RSSCfgLine RSSCfgLine;
+struct RSSCfgLine {
+       RSSCfgLine *next;
+       StrBuf *Url;
+       time_t last_known_good;
+};
+
+typedef struct __pRSSConfig {
+       const RSSCfgLine *pCfg;
+       long             QRnumber;
+}pRSSConfig;
+
 struct rss_aggregator {
        AsyncIO          IO;
        XML_Parser       xp;
 
-       int              RefCount;
        int              ItemType;
        int              roomlist_parts;
 
        time_t           last_error_when;
        time_t           next_poll;
        StrBuf          *Url;
+       StrBuf          *RedirectUrl;
        StrBuf          *rooms;
-       long             QRnumber;
+       pRSSConfig       Cfg;
        HashList        *OtherQRnumbers;
                        
        StrBuf          *CData;
        StrBuf          *Key;
-                       
+
        rss_item        *Item;
-       
-       const rss_xml_handler *Current;
+       recptypes        recp;
+       HashPos         *Pos;
+       HashList        *Messages;
+       networker_save_message *ThisMsg;
 };
 
 
 
+eNextState RSSAggregator_ParseReply(AsyncIO *IO);
 
-
-eNextState ParseRSSReply(AsyncIO *IO);
-
-void rss_save_item(rss_item *ri, rss_aggregator *Cfg);
+eNextState RSS_FetchNetworkUsetableEntry(AsyncIO *IO);