From de1981a82aceb946573e2e0c8a4e3d1b538c46cb Mon Sep 17 00:00:00 2001 From: =?utf8?q?Wilfried=20G=C3=B6esgens?= Date: Tue, 17 Feb 2009 22:34:12 +0000 Subject: [PATCH] * while loading a message guess mimetype by filename too with xdgmime. --- webcit/msg_renderers.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/webcit/msg_renderers.c b/webcit/msg_renderers.c index 6554be70d..ed20d2eb2 100644 --- a/webcit/msg_renderers.c +++ b/webcit/msg_renderers.c @@ -537,7 +537,7 @@ void examine_mime_part(message_summary *Msg, StrBuf *HdrLine, StrBuf *FoundChars Mime->PartNum = NewStrBuf(); StrBufExtract_token(Mime->PartNum, HdrLine, 2, '|'); StrBufTrim(Mime->PartNum); - if (strchr(ChrPtr(Mime->PartNum), '.') != NULL) + if (strchr(ChrPtr(Mime->PartNum), '.') != NULL) Mime->level = 2; else Mime->level = 1; @@ -550,6 +550,10 @@ void examine_mime_part(message_summary *Msg, StrBuf *HdrLine, StrBuf *FoundChars StrBufTrim(Mime->ContentType); StrBufLowerCase(Mime->ContentType); + if (!strcmp(ChrPtr(Mime->ContentType), "application/octet-stream")) { + StrBufPlain(Mime->ContentType, + GuessMimeByFilename(SKEY(Mime->FileName)), -1); + } Mime->length = StrBufExtract_int(HdrLine, 5, '|'); if ( (StrLength(Mime->FileName) == 0) && (StrLength(Mime->Name) > 0) ) { -- 2.30.2