]> code.citadel.org Git - citadel.git/blobdiff - webcit/smtpqueue.c
* move serv_info into the session, here we can control its de/allocation the right...
[citadel.git] / webcit / smtpqueue.c
index d7eceb04624419456945e7eac9f64ad8ce4bb151..43f5cd90ac064ecb079d0e622a008766d52fd9c5 100644 (file)
@@ -83,14 +83,14 @@ void display_queue_msg(long msgnum)
                        }
 
                        if (!strcasecmp(keyword, "bounceto")) {
+                               char *atsign;
                                extract_token(sender, buf, 1, '|', sizeof sender);
 
                                /* Strip off local hostname if it's our own */
-                               char *atsign;
                                atsign = strchr(sender, '@');
                                if (atsign != NULL) {
                                        ++atsign;
-                                       if (!strcasecmp(atsign, serv_info.serv_nodename)) {
+                                       if (!strcasecmp(atsign, ChrPtr(WC->serv_info->serv_nodename))) {
                                                --atsign;
                                                *atsign = 0;
                                        }
@@ -164,19 +164,24 @@ void display_queue_msg(long msgnum)
 
 
 void display_smtpqueue_inner_div(void) {
+       message_summary *Msg;
+       wcsession *WCC = WC;
        int i;
        int num_msgs;
+       StrBuf *Buf;
 
        /* Check to see if we can go to the __CitadelSMTPspoolout__ room.
         * If not, we don't have access to the queue.
         */
-       gotoroom("__CitadelSMTPspoolout__");
-       if (!strcasecmp(WC->wc_roomname, "__CitadelSMTPspoolout__")) {
+       Buf = NewStrBufPlain(HKEY("__CitadelSMTPspoolout__"));
+       gotoroom(Buf);
+       FreeStrBuf(&Buf);
+       if (!strcasecmp(ChrPtr(WCC->wc_roomname), "__CitadelSMTPspoolout__")) {
 
                num_msgs = load_msg_ptrs("MSGS ALL", 0);
                if (num_msgs > 0) {
                         wprintf("<table class=\"mailbox_summary\" rules=rows "
-                               "cellpadding=2 style=\"width:100%%;-moz-user-select:none;\">"
+                               "cellpadding=2 style=\"width:100%%;\">"
                        );
 
                        wprintf("<tr><td><b><i>");
@@ -192,7 +197,9 @@ void display_smtpqueue_inner_div(void) {
                        wprintf("</i></b></td></tr>\n");
 
                        for (i=0; i<num_msgs; ++i) {
-                               display_queue_msg(WC->msgarr[i]);
+                               Msg = GetMessagePtrAt(i, WCC->summ);
+
+                               display_queue_msg((Msg==NULL)? 0 : Msg->msgnum);
                        }
 
                        wprintf("</table>");
@@ -265,7 +272,12 @@ void display_smtpqueue(void)
 
 }
 
-
-
+void 
+InitModule_SMTP_QUEUE
+(void)
+{
+       WebcitAddUrlHandler(HKEY("display_smtpqueue"), display_smtpqueue, 0);
+       WebcitAddUrlHandler(HKEY("display_smtpqueue_inner_div"), display_smtpqueue_inner_div, 0);
+}
 
 /*@}*/