5 static inline void CheckConvertBufs(struct wcsession *WCC)
7 if (WCC->ConvertBuf1 == NULL)
8 WCC->ConvertBuf1 = NewStrBuf();
9 if (WCC->ConvertBuf2 == NULL)
10 WCC->ConvertBuf2 = NewStrBuf();
13 int ParseMessageListHeaders_Detail(StrBuf *Line,
16 StrBuf *ConversionBuffer,
23 CheckConvertBufs(WCC);
25 totallen = StrLength(Line);
26 Msg->from = NewStrBufPlain(NULL, totallen);
27 len = StrBufExtract_NextToken(ConversionBuffer, Line, pos, '|');
29 /* Handle senders with RFC2047 encoding */
30 StrBuf_RFC822_2_Utf8(Msg->from,
39 len = StrBufExtract_NextToken(ConversionBuffer, Line, pos, '|');
41 ( ((WCC->CurRoom.QRFlags & QR_NETWORK)
42 || ((strcasecmp(ChrPtr(ConversionBuffer), ChrPtr(WCC->serv_info->serv_nodename))
43 && (strcasecmp(ChrPtr(ConversionBuffer), ChrPtr(WCC->serv_info->serv_fqdn))))))))
45 StrBufAppendBufPlain(Msg->from, HKEY(" @ "), 0);
46 StrBufAppendBuf(Msg->from, ConversionBuffer, 0);
49 /* Internet address (not used)
50 * StrBufExtract_token(Msg->inetaddr, Line, 4, '|');
52 StrBufSkip_NTokenS(Line, pos, '|', 1);
53 Msg->subj = NewStrBufPlain(NULL, totallen);
55 FlushStrBuf(ConversionBuffer);
56 /* we assume the subject is the last parameter inside of the list;
57 * thus we don't use the tokenizer to fetch it, since it will hick up
58 * on tokenizer chars inside of the subjects
59 StrBufExtract_NextToken(ConversionBuffer, Line, pos, '|');
62 if (*pos != StrBufNOTNULL) {
63 len = totallen - (*pos - ChrPtr(Line));
64 StrBufPlain(ConversionBuffer, *pos, len);
67 (*(ChrPtr(ConversionBuffer) + len - 1) == '|'))
68 StrBufCutRight(ConversionBuffer, 1);
72 StrBufAppendBufPlain(Msg->subj, _("(no subject)"), -1,0);
74 StrBuf_RFC822_2_Utf8(Msg->subj,
86 int mailview_GetParamsGetServerCall(SharedMessageStatus *Stat,
94 DoTemplate(HKEY("msg_listview"),NULL,&NoCtx);
99 int mailview_Cleanup(void **ViewSpecific)
101 /* Note: wDumpContent() will output one additional </div> tag. */
102 /* We ought to move this out into template */
109 InitModule_MAILVIEW_RENDERERS
112 RegisterCTX(CTX_MIME_ATACH);
113 RegisterReadLoopHandlerset(
115 mailview_GetParamsGetServerCall,
116 NULL, /* TODO: is this right? */
118 ParseMessageListHeaders_Detail,