]> code.citadel.org Git - citadel.git/blobdiff - webcit/messages.c
If user clicks in the empty part of a mailbox view, display a blank pane instead...
[citadel.git] / webcit / messages.c
index 0c1c444ad0797447599577ce300e28dbf55963bb..207787d67fbcb626f7c51fb62dc28c664b189034 100644 (file)
@@ -399,6 +399,8 @@ void embed_message(void) {
        StrBuf *CmdBuf = NULL;
 
        msgnum = StrBufExtract_long(WCC->Hdr->HR.ReqLine, 0, '/');
+       if (msgnum <= 0) return;
+
        switch (WCC->Hdr->HR.eReqType)
        {
        case eGET:
@@ -1403,6 +1405,8 @@ void display_enter(void)
                                if (which == l_subj)
                                {
                                        StrBuf *subj = NewStrBuf();
+                                       StrBuf *FlatSubject;
+
                                        if (!strcasecmp(bstr("replying_mode"), "forward")) {
                                                if (strncasecmp(ChrPtr(Line) + 5, "Fw:", 3)) {
                                                        StrBufAppendBufPlain(subj, HKEY("Fw: "), 0);
@@ -1416,7 +1420,10 @@ void display_enter(void)
                                        StrBufAppendBufPlain(subj, 
                                                             ChrPtr(Line) + 5, 
                                                             StrLength(Line) - 5, 0);
-                                       PutBstr(HKEY("subject"), subj);
+                                       FlatSubject = NewStrBufPlain(NULL, StrLength(subj));
+                                       StrBuf_RFC822_to_Utf8(FlatSubject, subj, NULL, NULL);
+
+                                       PutBstr(HKEY("subject"), FlatSubject);
                                }
 
                                else if (which == l_wefw)
@@ -1441,7 +1448,12 @@ void display_enter(void)
                                }
 
                                else if (which == l_from) {
+                                       StrBuf *FlatFrom;
                                        from = NewStrBufPlain(ChrPtr(Line) + 5, StrLength(Line) - 5);
+                                       FlatFrom = NewStrBufPlain(NULL, StrLength(from));
+                                       StrBuf_RFC822_to_Utf8(FlatFrom, from, NULL, NULL);
+                                       FreeStrBuf(&from);
+                                       from = FlatFrom;
                                        for (i=0; i<StrLength(from); ++i) {
                                                if (ChrPtr(from)[i] == ',')
                                                        StrBufPeek(from, NULL, i, ' ');
@@ -1461,7 +1473,12 @@ void display_enter(void)
                                }
                                
                                else if (which == l_rfca) {
+                                       StrBuf *FlatRFCA;
                                        rfca = NewStrBufPlain(ChrPtr(Line) + 5, StrLength(Line) - 5);
+                                       FlatRFCA = NewStrBufPlain(NULL, StrLength(rfca));
+                                       StrBuf_RFC822_to_Utf8(FlatRFCA, rfca, NULL, NULL);
+                                       FreeStrBuf(&rfca);
+                                       rfca = FlatRFCA;
                                }
                        }