]> code.citadel.org Git - citadel.git/blobdiff - webcit/rss.c
* shuffle auth arround...
[citadel.git] / webcit / rss.c
index ab01a2aef1d598d1062a8966a3047c0bf2848969..3279f9215e1a8807dd98ec331733f5a939feb5b7 100644 (file)
@@ -12,7 +12,6 @@
 #define ALLOW_ANON_RSS 0
 #define ANON_RSS_USER ""
 #define ANON_RSS_PASS ""
-time_t if_modified_since;    /**< the last modified stamp */
 
 /*
  * view rss Config menu
@@ -43,7 +42,7 @@ void display_rss_control(char *reply_to, char *subject)
  * roomname the room we sould print out as rss 
  * request_method the way the rss is requested????
  */
-void display_rss(const StrBuf *roomname, StrBuf *request_method)
+void display_rss(void)
 {
        message_summary *Msg;
        wcsession *WCC = WC;
@@ -73,7 +72,8 @@ void display_rss(const StrBuf *roomname, StrBuf *request_method)
        char msgn[256];
        char content_type[256];
        char charset[256];
-       
+       const StrBuf *roomname;
+
        if (!WCC->logged_in) {
                #ifdef ALLOW_ANON_RSS
                StrBuf *User;
@@ -97,7 +97,7 @@ void display_rss(const StrBuf *roomname, StrBuf *request_method)
                #endif
        }
 
-       if (gotoroom(roomname)) {
+       if (gotoroom(WCC->Hdr->ReqLine)) {
                lprintf(3, "RSS: Can't goto requested room\n");
                hprintf("HTTP/1.1 404 Not Found\r\n");
                hprintf("Content-Type: text/html\r\n");
@@ -135,7 +135,7 @@ void display_rss(const StrBuf *roomname, StrBuf *request_method)
                }
        }
        /*/ Commented out. Play dumb for now, also doesn't work with anonrss hack */
-       /* if (if_modified_since > 0 && if_modified_since > now) {
+       /* if (WCC->Hdr->if_modified_since > 0 && WCC->Hdr->if_modified_since > now) {
                lprintf(3, "RSS: Feed not updated since the last time you looked\n");
                hprintf("HTTP/1.1 304 Not Modified\r\n");
                hprintf("Last-Modified: %s\r\n", date);
@@ -156,7 +156,7 @@ void display_rss(const StrBuf *roomname, StrBuf *request_method)
        hprintf("Content-Type: application/rss+xml\r\n");
        hprintf("Server: %s\r\n", PACKAGE_STRING);
        hprintf("Connection: close\r\n");
-       if (!strcasecmp(ChrPtr(request_method), "HEAD"))
+       if (WCC->Hdr->eReqType == eHEAD)
                return;
 
        /* <?xml.. etc confuses our subst parser, so do it here */
@@ -165,7 +165,7 @@ void display_rss(const StrBuf *roomname, StrBuf *request_method)
        SVPutBuf("ROOM", WCC->wc_roomname, 1);
        SVPutBuf("NODE", WCC->serv_info->serv_humannode, 1);
        /* TODO:  Fix me */
-       svprintf(HKEY("ROOM_LINK"), WCS_STRING, "%s://%s/", (is_https ? "https" : "http"), ChrPtr(WCC->http_host));
+       svprintf(HKEY("ROOM_LINK"), WCS_STRING, "%s://%s/", (is_https ? "https" : "http"), ChrPtr(WCC->Hdr->http_host));
        
        /** Get room info for description */
        serv_puts("RINF");
@@ -370,3 +370,10 @@ ENDITEM:
 }
 
 
+void 
+InitModule_RSS
+(void)
+{
+       WebcitAddUrlHandler(HKEY("do_welcome"), display_rss, COOKIEUNNEEDED|FORCE_SESSIONCLOSE);
+
+}