From c03a0525a2f8d009d6c5765e381080e9c2dc1220 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Wilfried=20G=C3=B6esgens?= Date: Wed, 5 Nov 2008 23:51:50 +0000 Subject: [PATCH] * put the right pointer into the hash --- webcit/messages.c | 12 +++++++++--- webcit/webcit.h | 2 ++ 2 files changed, 11 insertions(+), 3 deletions(-) diff --git a/webcit/messages.c b/webcit/messages.c index 473b1e049..e83f9649c 100644 --- a/webcit/messages.c +++ b/webcit/messages.c @@ -280,6 +280,7 @@ void DestroyMessageSummary(void *vMsg) DeleteHash(&Msg->Attachments); /**< list of Accachments */ DeleteHash(&Msg->Submessages); DeleteHash(&Msg->AttachLinks); + DeleteHash(&Msg->AllAttach); DestroyMimeParts(&Msg->MsgBody); @@ -501,6 +502,7 @@ void examine_mime_part(message_summary *Msg, StrBuf *HdrLine, StrBuf *FoundChars StrBufExtract_token(mime->Name, HdrLine, 0, '|'); StrBufExtract_token(Buf, HdrLine, 1, '|'); + mime->FileName = NewStrBuf(); StrBuf_RFC822_to_Utf8(mime->FileName, Buf, WC->DefaultCharset, FoundCharset); mime->PartNum = NewStrBuf(); @@ -521,16 +523,20 @@ void examine_mime_part(message_summary *Msg, StrBuf *HdrLine, StrBuf *FoundChars StrBufAppendBuf(mime->FileName, mime->Name, 0); } + if (Msg->AllAttach == NULL) + Msg->AllAttach = NewHash(1,NULL); + Put(Msg->AllAttach, SKEY(mime->PartNum), mime, DestroyMime); + if (!strcasecmp(ChrPtr(mime->ContentType), "message/rfc822")) { if (Msg->Submessages == NULL) Msg->Submessages = NewHash(1,NULL); - Put(Msg->Submessages, SKEY(mime->PartNum), mime->PartNum, reference_free_handler); + Put(Msg->Submessages, SKEY(mime->PartNum), mime, reference_free_handler); } else if ((!strcasecmp(ChrPtr(mime->Disposition), "inline")) && (!strncasecmp(ChrPtr(mime->ContentType), "image/", 6)) ){ if (Msg->AttachLinks == NULL) Msg->AttachLinks = NewHash(1,NULL); - Put(Msg->AttachLinks, SKEY(mime->PartNum), mime->PartNum, reference_free_handler); + Put(Msg->AttachLinks, SKEY(mime->PartNum), mime, reference_free_handler); } else if ((StrLength(mime->ContentType) > 0) && ( (!strcasecmp(ChrPtr(mime->Disposition), "attachment")) @@ -540,7 +546,7 @@ void examine_mime_part(message_summary *Msg, StrBuf *HdrLine, StrBuf *FoundChars if (Msg->AttachLinks == NULL) Msg->AttachLinks = NewHash(1,NULL); - Put(Msg->AttachLinks, SKEY(mime->PartNum), mime->PartNum, reference_free_handler); + Put(Msg->AttachLinks, SKEY(mime->PartNum), mime, reference_free_handler); if (strcasecmp(ChrPtr(mime->ContentType), "application/octet-stream") == 0) { FlushStrBuf(mime->ContentType); StrBufAppendBufPlain(mime->ContentType, diff --git a/webcit/webcit.h b/webcit/webcit.h index ac36328c4..a479f5f4c 100644 --- a/webcit/webcit.h +++ b/webcit/webcit.h @@ -437,6 +437,8 @@ typedef struct _message_summary { HashList *Submessages; HashList *AttachLinks; + HashList *AllAttach; + int is_new; /**< is it yet read? */ int hasattachments; /* does it have atachments? */ -- 2.39.2