Update of /cvsroot/mahogany/M/include
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv27696/include
Modified Files:
MessageView.h
Log Message:
Improved MIME part selection: now we look inside nested multipart parts, so
that we don't show the text part if we have a multipart/alternative message
with text/plain part and mixed/related subpart containing text/html inside.
Real handling of mixed/related still not implemented though...
Index: MessageView.h
===================================================================
RCS file: /cvsroot/mahogany/M/include/MessageView.h,v
retrieving revision 1.65
retrieving revision 1.66
diff -b -u -2 -r1.65 -r1.66
--- MessageView.h 16 Jan 2006 20:32:01 -0000 1.65
+++ MessageView.h 20 Jan 2006 02:01:46 -0000 1.66
@@ -518,12 +518,34 @@
void ShowHeaders();
- /// process part and decided what to do with it (call ShowPart or skip)
- void ProcessPart(const MimePart *part);
+ /**
+ Possible values for the second parameter of ProcessPart.
+ */
+ enum MimePartAction
+ {
+ /// Show the part in the viewer
+ Part_Show,
+
+ /// Just test if the viewer can show this part
+ Part_Test,
+ };
+
+ /**
+ Process part and take the given action.
+
+ @param part the MIME part we work with
+ @param action specifies whether we want to really show this part or just
+ to test whether we can do it
+ @return true if we can process this part
+ */
+ bool ProcessPart(const MimePart *part, MimePartAction action = Part_Show);
/// process a multipart part
- void ProcessMultiPart(const MimePart *part, const String& subtype);
+ bool ProcessMultiPart(const MimePart *part,
+ const String& subtype,
+ MimePartAction action = Part_Show);
/// process a multipart/alternative part
- bool ProcessAlternativeMultiPart(const MimePart *part);
+ bool ProcessAlternativeMultiPart(const MimePart *part,
+ MimePartAction action = Part_Show);
/// process a multipart/signed part
@@ -534,5 +556,14 @@
/// call ProcessPart() for all subparts of this part
- void ProcessAllNestedParts(const MimePart *part);
+ bool ProcessAllNestedParts(const MimePart *part,
+ MimePartAction action = Part_Show);
+
+ /**
+ Return true if the current viewer can process the given part.
+ */
+ bool CanViewerProcessPart(const MimePart *part)
+ {
+ return ProcessPart(part, Part_Test);
+ }
public:
-------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc. Do you grep through log files
for problems? Stop! Download the new AJAX search engine that makes
searching your log files as easy as surfing the web. DOWNLOAD SPLUNK!
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=103432&bid=230486&dat=121642
_______________________________________________
Mahogany-cvsupdates mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/mahogany-cvsupdates