Update of /cvsroot/mahogany/M/src/gui
In directory usw-pr-cvs1:/tmp/cvs-serv14708/src/gui

Modified Files:
        wxComposeView.cpp wxMenuDefs.cpp wxMsgCmdProc.cpp 
Log Message:
implemented "Bounce" command


Index: wxComposeView.cpp
===================================================================
RCS file: /cvsroot/mahogany/M/src/gui/wxComposeView.cpp,v
retrieving revision 1.283
retrieving revision 1.284
diff -b -u -2 -r1.283 -r1.284
--- wxComposeView.cpp   4 Jun 2002 17:43:23 -0000       1.283
+++ wxComposeView.cpp   11 Jun 2002 20:22:27 -0000      1.284
@@ -3128,11 +3128,10 @@
    switch ( m_mode )
    {
+      default:
+         FAIL_MSG( "unknown protocol" );
+         // fall through nevertheless
+
       case Mode_Mail:
-#ifdef OS_UNIX
-         if ( READ_CONFIG_BOOL(m_Profile, MP_USE_SENDMAIL) )
-            proto = Prot_Sendmail;
-         else
-#endif // OS_UNIX
-            proto = Prot_SMTP;
+         proto = Prot_Default;
          break;
 
@@ -3140,15 +3139,4 @@
          proto = Prot_NNTP;
          break;
-
-      default:
-         proto = Prot_Illegal;
-   }
-
-   if ( proto == Prot_Illegal )
-   {
-      FAIL_MSG( "unknown protocol" );
-
-      // we do have to use something though
-      proto = Prot_Default;
    }
 

Index: wxMenuDefs.cpp
===================================================================
RCS file: /cvsroot/mahogany/M/src/gui/wxMenuDefs.cpp,v
retrieving revision 1.186
retrieving revision 1.187
diff -b -u -2 -r1.186 -r1.187
--- wxMenuDefs.cpp      18 May 2002 17:32:02 -0000      1.186
+++ wxMenuDefs.cpp      11 Jun 2002 20:22:28 -0000      1.187
@@ -319,5 +319,5 @@
 
    // the available accelerators for this menu:
-   // bjqwz
+   // jqwz
 
    { WXMENU_MSG_OPEN,      gettext_noop("&Open"),             gettext_noop("View 
selected message in a separate window")    , wxITEM_NORMAL },
@@ -392,4 +392,5 @@
       },
    { WXMENU_SUBMENU,       "", "", wxITEM_NORMAL },
+   { WXMENU_MSG_BOUNCE,    gettext_noop("&Bounce..."), gettext_noop("Redirect this 
+message to another recipient"), wxITEM_NORMAL },
    { WXMENU_SEPARATOR,     "",                  ""                         , 
wxITEM_NORMAL },
    { WXMENU_MSG_FILTER,    gettext_noop("&Apply filter rules..."), 
gettext_noop("Apply filter rules to selected messages")     , wxITEM_NORMAL },

Index: wxMsgCmdProc.cpp
===================================================================
RCS file: /cvsroot/mahogany/M/src/gui/wxMsgCmdProc.cpp,v
retrieving revision 1.21
retrieving revision 1.22
diff -b -u -2 -r1.21 -r1.22
--- wxMsgCmdProc.cpp    17 May 2002 19:04:43 -0000      1.21
+++ wxMsgCmdProc.cpp    11 Jun 2002 20:22:28 -0000      1.22
@@ -190,4 +190,14 @@
    void AddTicketToDelete(Ticket t);
 
+   /// get the Message with the given UID (caller must DecRef() it)
+   Message *GetMessage(UIdType uid) const
+   {
+      // do it synchronously (FIXME should we?)
+      MailFolder_obj mf = GetMailFolder();
+      CHECK( mf, NULL, "no folder in MsgCmdProcImpl::GetMessage()" );
+
+      return mf->GetMessage(uid);
+   }
+
 private:
    /// our folder (may be NULL)
@@ -777,4 +787,42 @@
          break;
 
+      case WXMENU_MSG_BOUNCE:
+         {
+            // FIXME: bounce all messages, not just one
+            Message *msg = GetMessage(messages[0]);
+
+            if ( !msg )
+               break;
+
+            // TODO: should use a generic address entry control
+            String address;
+            if ( !MInputBox(&address,
+                            _("Please enter the address"),
+                            _("Bounce the message to:"),
+                            GetFrame(),
+                            "BounceAddress") )
+            {
+               // cancelled by user
+               break;
+            }
+
+            SendMessage_obj sendMsg = SendMessage::CreateResent
+                                      (
+                                       m_asmf->GetProfile(),
+                                       msg,
+                                       GetFrame()
+                                      );
+
+            sendMsg->SetAddresses(address);
+            if ( !sendMsg->SendOrQueue() )
+            {
+               ERRORMESSAGE((_("Failed to bounce the message.")));
+            }
+
+            msg->DecRef();
+         }
+         break;
+
+
       case WXMENU_MSG_UNDELETE:
          UndeleteMessages(messages);
@@ -873,10 +921,7 @@
 MsgCmdProcImpl::ShowRawText(UIdType uid)
 {
-   // do it synchronously (FIXME should we?)
-   MailFolder_obj mf = GetMailFolder();
-   CHECK_RET( mf, "no folder in MsgCmdProcImpl::ShowRawText" );
-
    String text;
-   Message *msg = mf->GetMessage(uid);
+
+   Message *msg = GetMessage(uid);
    if ( msg )
    {


_______________________________________________________________

Multimillion Dollar Computer Inventory
Live Webcast Auctions Thru Aug. 2002 - http://www.cowanalexander.com/calendar



_______________________________________________
Mahogany-cvsupdates mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/mahogany-cvsupdates

Reply via email to