Update of /cvsroot/mahogany/M/include
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv12588/include
Modified Files:
MailFolder.h MessageView.h MessageViewer.h ViewFilter.h
Log Message:
when replying to PGP-encrypted messages we now use plain text (coming from the
viewer) instead of the encrypted text; for this:
1. added MessageView::OnBodyText() to accumulate the text shown in the viewer
2. added ViewFilter::Start/EndText() and ProcessURL() and overrode them in
TransparentFilter to call OnBodyText()
3. modified the view filters to use the functions above instead of using
MessageViewer methods directly
4. removed NO_QUOTE hack from MailFolder, now we don't quote anything simply
if the msgview is NULL
Index: MailFolder.h
===================================================================
RCS file: /cvsroot/mahogany/M/include/MailFolder.h,v
retrieving revision 1.194
retrieving revision 1.195
diff -b -u -2 -r1.194 -r1.195
--- MailFolder.h 28 Dec 2003 23:04:00 -0000 1.194
+++ MailFolder.h 12 Jul 2004 20:53:19 -0000 1.195
@@ -204,11 +204,8 @@
/**
msg viewer from which the reply/forward command originated: this is
- used only to get the selection from it for the cases when "include
- only selected text in reply" option is on
+ used to get the text to be quoted, if it is NULL no quoting is to be
+ done
*/
const MessageView *msgview;
-
- /// the special value for msgview meaning not to quote anything at all
- static const MessageView *NO_QUOTE;
};
Index: MessageView.h
===================================================================
RCS file: /cvsroot/mahogany/M/include/MessageView.h,v
retrieving revision 1.52
retrieving revision 1.53
diff -b -u -2 -r1.52 -r1.53
--- MessageView.h 13 May 2004 15:19:12 -0000 1.52
+++ MessageView.h 12 Jul 2004 20:53:19 -0000 1.53
@@ -161,6 +161,6 @@
void PrintPreview();
- /// return the text selected in the viewer, may be empty
- String GetSelection() const;
+ /// return the text we show (to be quoted in replies)
+ String GetText() const;
//@}
@@ -277,4 +277,10 @@
virtual void OnSelectViewer(int id) = 0;
+ /**
+ Called by view filter code only to notify that text is being added to the
+ displayed text.
+ */
+ void OnBodyText(const String& text) { m_textBody += text; }
+
protected:
/** @name Initialization
@@ -548,4 +554,7 @@
Profile *m_profile;
+ /// the full text shown to the user
+ String m_textBody;
+
//@}
Index: MessageViewer.h
===================================================================
RCS file: /cvsroot/mahogany/M/include/MessageViewer.h,v
retrieving revision 1.21
retrieving revision 1.22
diff -b -u -2 -r1.21 -r1.22
--- MessageViewer.h 6 Jan 2004 00:37:09 -0000 1.21
+++ MessageViewer.h 12 Jul 2004 20:53:19 -0000 1.22
@@ -163,17 +163,4 @@
virtual void InsertURL(const String& text, const String& url) = 0;
- /**
- mark the end of text -- only signature/trailers may follow.
-
- This is currently not used by any viewer, but will be used by composer
- later: it will know that it can ignore all the rest.
-
- Note that EndText() may be not called at all, unlike EndPart() or
- EndBody() which are always called. Alternatively, it can be also called
- several times -- then only the first call should matter and all
- subsequent ones can be safely ignored.
- */
- virtual void EndText() = 0;
-
/// mark the end of the MIME part
virtual void EndPart() = 0;
Index: ViewFilter.h
===================================================================
RCS file: /cvsroot/mahogany/M/include/ViewFilter.h,v
retrieving revision 1.10
retrieving revision 1.11
diff -b -u -2 -r1.10 -r1.11
--- ViewFilter.h 21 Dec 2003 00:36:56 -0000 1.10
+++ ViewFilter.h 12 Jul 2004 20:53:20 -0000 1.11
@@ -16,4 +16,5 @@
#include "MModule.h"
+#include "MessageViewer.h"
class MessageView;
@@ -89,4 +90,11 @@
/**
+ Called before starting to filter a new message.
+
+ This is just a counterpart to EndText().
+ */
+ virtual void StartText() { if ( m_next ) m_next->StartText(); }
+
+ /**
Pass the text through the filter.
@@ -111,4 +119,27 @@
/**
+ Pass an URL through the filter.
+
+ Currently existing filters don't really need to process the URLs but this
+ helps us to gather the URLs text in MessageView::OnBodyText() in addition
+ to the normal text.
+ */
+ virtual void ProcessURL(const String& text,
+ const String& url,
+ MessageViewer *viewer)
+ {
+ if ( m_next ) m_next->ProcessURL(text, url, viewer);
+ }
+
+ /**
+ Mark the end of text -- only signature/trailers may follow.
+
+ This is again only used by TransparentFilter currently in order to stop
+ calling MessageViewer::OnBodyText()
+ */
+ virtual void EndText() { if ( m_next ) m_next->EndText(); }
+
+
+ /**
@name State
-------------------------------------------------------
This SF.Net email sponsored by Black Hat Briefings & Training.
Attend Black Hat Briefings & Training, Las Vegas July 24-29 -
digital self defense, top technical experts, no vendor pitches,
unmatched networking opportunities. Visit www.blackhat.com
_______________________________________________
Mahogany-cvsupdates mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/mahogany-cvsupdates