X-Git-Url: https://code.citadel.org/?a=blobdiff_plain;f=webcit%2Fmessages.c;h=9579688559610499737438d17e9ec94d337f5460;hb=0af85763b23dfbefdc9faee3b62651046084ae22;hp=bb17f729665e5264d78800f37797c7cbb1b7eb5e;hpb=35f9e6feddac7af888f49a86c7c44d6bbc9cda36;p=citadel.git diff --git a/webcit/messages.c b/webcit/messages.c index bb17f7296..957968855 100644 --- a/webcit/messages.c +++ b/webcit/messages.c @@ -1581,14 +1581,20 @@ StrBuf *load_mimepart(long msgnum, char *partnum) void MimeLoadData(wc_mime_attachment *Mime) { StrBuf *Buf; + const char *Ptr; off_t bytes; /* TODO: is there a chance the content type is different from the one we know? */ + serv_printf("DLAT %ld|%s", Mime->msgnum, ChrPtr(Mime->PartNum)); Buf = NewStrBuf(); StrBuf_ServGetln(Buf); if (GetServerStatus(Buf, NULL) == 6) { - bytes = extract_long(&(ChrPtr(Buf)[4]), 0); - + Ptr = &(ChrPtr(Buf)[4]); + bytes = StrBufExtractNext_long(Buf, &Ptr, '|'); + StrBufSkip_NTokenS(Buf, &Ptr, '|', 3); /* filename, cbtype, mimetype */ + if (Mime->Charset == NULL) Mime->Charset = NewStrBuf(); + StrBufExtract_NextToken(Mime->Charset, Buf, &Ptr, '|'); + if (Mime->Data == NULL) Mime->Data = NewStrBufPlain(NULL, bytes); StrBuf_ServGetBLOBBuffered(Mime->Data, bytes);