-
- /* node name */
- StrBufExtract_NextToken(ConversionBuffer, Line, pos, '|');
- if ((StrLength(ConversionBuffer) !=0 ) &&
- ( ((WCC->CurRoom.QRFlags & QR_NETWORK)
- || ((strcasecmp(ChrPtr(ConversionBuffer), ChrPtr(WCC->serv_info->serv_nodename))
- && (strcasecmp(ChrPtr(ConversionBuffer), ChrPtr(WCC->serv_info->serv_fqdn))))))))
- {
- StrBufAppendBufPlain(Msg->from, HKEY(" @ "), 0);
- StrBufAppendBuf(Msg->from, ConversionBuffer, 0);
- }
-
- /* Internet address (not used)
- * StrBufExtract_token(Msg->inetaddr, Line, 4, '|');
- */
- StrBufSkip_NTokenS(Line, pos, '|', 1);
- Msg->subj = NewStrBufPlain(NULL, StrLength(Line));
-
- FlushStrBuf(ConversionBuffer);
- /* we assume the subject is the last parameter inside of the list;
- * thus we don't use the tokenizer to fetch it, since it will hick up
- * on tokenizer chars inside of the subjects
- StrBufExtract_NextToken(ConversionBuffer, Line, pos, '|');
- */
- if (*pos != StrBufNOTNULL) {
- StrBufPlain(ConversionBuffer, *pos,
- StrLength(Line) - (*pos - ChrPtr(Line)));
- *pos = StrBufNOTNULL;
- if ((StrLength(ConversionBuffer) > 0) &&
- (*(ChrPtr(ConversionBuffer) +
- StrLength(ConversionBuffer) - 1) == '|'))
- StrBufCutRight(ConversionBuffer, 1);
- }
-
- if (StrLength(ConversionBuffer) == 0)
- StrBufAppendBufPlain(Msg->subj, _("(no subject)"), -1,0);
- else {
- StrBuf_RFC822_to_Utf8(Msg->subj, ConversionBuffer, WCC->DefaultCharset, NULL);
- if ((StrLength(Msg->subj) > 75) &&
- (StrBuf_Utf8StrLen(Msg->subj) > 75)) {
- StrBuf_Utf8StrCut(Msg->subj, 72);
- StrBufAppendBufPlain(Msg->subj, HKEY("..."), 0);
- }
- }
-
- if ((StrLength(Msg->from) > 25) &&
- (StrBuf_Utf8StrLen(Msg->from) > 25)) {
- StrBuf_Utf8StrCut(Msg->from, 23);
- StrBufAppendBufPlain(Msg->from, HKEY("..."), 0);
- }
- return 1;
-}
-
-/* Spit out the new summary view. This is basically a static page, so clients can cache the layout, all the dirty work is javascript :) */
-void new_summary_view(void) {
- DoTemplate(HKEY("msg_listview"),NULL,&NoCtx);
-}
-
-
-int mailview_GetParamsGetServerCall(SharedMessageStatus *Stat,
- void **ViewSpecific,
- long oper,
- char *cmd,
- long len)
-{
- if (!WC->is_ajax) {
- new_summary_view();
- return 200;
- } else {
- Stat->defaultsortorder = 2;
- Stat->sortit = 1;
- Stat->load_seen = 1;
- /* Generally using maxmsgs|startmsg is not required
- in mailbox view, but we have a 'safemode' for clients
- (*cough* Exploder) that simply can't handle too many */
- if (havebstr("maxmsgs")) Stat->maxmsgs = ibstr("maxmsgs");
- else Stat->maxmsgs = 9999999;
- if (havebstr("startmsg")) Stat->startmsg = lbstr("startmsg");
- snprintf(cmd, len, "MSGS %s|%s||1",
- (oper == do_search) ? "SEARCH" : "ALL",
- (oper == do_search) ? bstr("query") : ""
- );
- }
- return 200;
-}
-
-int mailview_RenderView_or_Tail(SharedMessageStatus *Stat,
- void **ViewSpecific,
- long oper)
-{
- WCTemplputParams SubTP;
-
- if (WC->is_ajax)
- DoTemplate(HKEY("mailsummary_json"),NULL, &SubTP);
-