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)
22 CheckConvertBufs(WCC);
24 totallen = StrLength(Line);
25 Msg->from = NewStrBufPlain(NULL, totallen);
26 len = StrBufExtract_NextToken(ConversionBuffer, Line, pos, '|');
28 /* Handle senders with RFC2047 encoding */
29 StrBuf_RFC822_2_Utf8(Msg->from,
38 len = StrBufExtract_NextToken(ConversionBuffer, Line, pos, '|');
40 ( ((WCC->CurRoom.QRFlags & QR_NETWORK)
41 || ((strcasecmp(ChrPtr(ConversionBuffer), ChrPtr(WCC->serv_info->serv_nodename))
42 && (strcasecmp(ChrPtr(ConversionBuffer), ChrPtr(WCC->serv_info->serv_fqdn))))))))
44 StrBufAppendBufPlain(Msg->from, HKEY(" @ "), 0);
45 StrBufAppendBuf(Msg->from, ConversionBuffer, 0);
48 /* Internet address (not used)
49 * StrBufExtract_token(Msg->inetaddr, Line, 4, '|');
51 StrBufSkip_NTokenS(Line, pos, '|', 1);
52 Msg->subj = NewStrBufPlain(NULL, totallen);
54 FlushStrBuf(ConversionBuffer);
55 /* we assume the subject is the last parameter inside of the list;
56 * thus we don't use the tokenizer to fetch it, since it will hick up
57 * on tokenizer chars inside of the subjects
58 StrBufExtract_NextToken(ConversionBuffer, Line, pos, '|');
61 if (*pos != StrBufNOTNULL) {
62 len = totallen - (*pos - ChrPtr(Line));
63 StrBufPlain(ConversionBuffer, *pos, len);
66 (*(ChrPtr(ConversionBuffer) + len - 1) == '|'))
67 StrBufCutRight(ConversionBuffer, 1);
71 StrBufAppendBufPlain(Msg->subj, _("(no subject)"), -1,0);
73 StrBuf_RFC822_2_Utf8(Msg->subj,
85 int mailview_GetParamsGetServerCall(SharedMessageStatus *Stat,
93 DoTemplate(HKEY("msg_listview"),NULL,&NoCtx);
98 int mailview_Cleanup(void **ViewSpecific)
100 /* Note: wDumpContent() will output one additional </div> tag. */
101 /* We ought to move this out into template */
108 InitModule_MAILVIEW_RENDERERS
111 RegisterCTX(CTX_MIME_ATACH);
112 RegisterReadLoopHandlerset(
114 mailview_GetParamsGetServerCall,
115 NULL, /* TODO: is this right? */
117 ParseMessageListHeaders_Detail,