Msg->msgnum = StrBufExtractNext_long(Buf, &Ptr, '|');
Msg->date = StrBufExtractNext_long(Buf, &Ptr, '|');
+
+ if ((Msg->msgnum == 0) && (StrLength(Buf) < 32)) {
+ free(Msg);
+ continue;
+ }
/*
* as citserver probably gives us messages in forward date sorting
* nummsgs should be the same order as the message date.
Msg->from = NewStrBufPlain(NULL, StrLength(Buf));
StrBufExtract_NextToken(Buf2, Buf, &Ptr, '|');
if (StrLength(Buf2) != 0) {
- /** Handle senders with RFC2047 encoding */
+ /* Handle senders with RFC2047 encoding */
StrBuf_RFC822_to_Utf8(Msg->from, Buf2, WCC->DefaultCharset, FoundCharset);
}
/*
* command loop for reading messages
*
- * Set oper to "readnew" or "readold" or "readfwd" or "headers"
+ * Set oper to "readnew" or "readold" or "readfwd" or "headers" or "readgt"
*/
void readloop(long oper)
{
care_for_empty_list = 1;
rlid[oper].cmd(cmd, sizeof(cmd));
- SetAccessCommand(oper);
if (havebstr("maxmsgs"))
maxmsgs = ibstr("maxmsgs");
* Transfer control of this memory from the upload struct
* to the attachment struct.
*/
- att->Data = NewStrBufPlain(WCC->upload, WCC->upload_length);
- free(WCC->upload);
- WCC->upload_length = 0;
+ att->Data = WCC->upload;
WCC->upload = NULL;
+ WCC->upload_length = 0;
display_enter();
return;
}
Buf = NewStrBuf();
if (save_to_drafts) {
- /** temporarily change to the drafts room */
+ /* temporarily change to the drafts room */
serv_puts("GOTO _DRAFTS_");
StrBuf_ServGetln(Buf);
if (GetServerStatus(Buf, NULL) != 2) {
void h_readfwd(void) { readloop(readfwd);}
void h_headers(void) { readloop(headers);}
void h_do_search(void) { readloop(do_search);}
+void h_readgt(void) { readloop(readgt);}
void jsonMessageListHdr(void)
{
WebcitAddUrlHandler(HKEY("readold"), h_readold, NEED_URL);
WebcitAddUrlHandler(HKEY("readfwd"), h_readfwd, NEED_URL);
WebcitAddUrlHandler(HKEY("headers"), h_headers, NEED_URL);
+ WebcitAddUrlHandler(HKEY("readgt"), h_readgt, NEED_URL);
WebcitAddUrlHandler(HKEY("do_search"), h_do_search, 0);
WebcitAddUrlHandler(HKEY("display_enter"), display_enter, 0);
WebcitAddUrlHandler(HKEY("post"), post_message, 0);