[prev in list] [next in list] [prev in thread] [next in thread] 

List:       kde-i18n-doc
Subject:    branches/KDE/3.5/kdepim
From:       Allen Winter <winter () kde ! org>
Date:       2007-05-05 1:46:56
Message-ID: 1178329616.790553.18063.nullmailer () svn ! kde ! org
[Download RAW message or body]

SVN commit 661269 by winterz:

Fix sending invitations to Outlook users.
Patch provided and tested by Thorsten and Jan-Pascal. Thanks!
Contains a couple of new strings, but this has been ok'd
by at least 3 translators.

CCMAIL: kde-i18n-doc@kde.org, thorsten.schnebeck@gmx.net, janpascal@vanbest.org


 M  +23 -6     kmail/callback.cpp  
 M  +26 -2     kmail/configuredialog.cpp  
 M  +1 -0      kmail/configuredialog_p.h  
 M  +6 -0      kmail/kmail.kcfg  
 M  +4 -2      kmail/kmkernel.cpp  
 M  +2 -2      korganizer/komailclient.cpp  


--- branches/KDE/3.5/kdepim/kmail/callback.cpp #661268:661269
@@ -33,6 +33,7 @@
 #include "callback.h"
 #include "kmkernel.h"
 #include "kmmessage.h"
+#include "kmmsgpart.h"
 #include <libemailfunctions/email.h>
 #include <libkpimidentities/identity.h>
 #include <libkpimidentities/identitymanager.h>
@@ -62,11 +63,8 @@
 
   KMMessage *msg = new KMMessage;
   msg->initHeader();
-  msg->setHeaderField( "Content-Type",
-                       "text/calendar; method=reply; charset=\"utf-8\"" );
   msg->setSubject( subject );
   msg->setTo( to );
-  msg->setBody( iCal.utf8() );
   msg->setFrom( receiver() );
   /* We want the triggering mail to be moved to the trash once this one
    * has been sent successfully. Set a link header which accomplishes that. */
@@ -79,12 +77,13 @@
     // Try and match the receiver with an identity
     const KPIM::Identity& identity =
       kmkernel->identityManager()->identityForAddress( receiver() );
-    if( identity != KPIM::Identity::null() )
+    if( identity != KPIM::Identity::null() ) {
       // Identity found. Use this
       msg->setFrom( identity.fullEmailAddr() );
       msg->setHeaderField("X-KMail-Identity", QString::number( identity.uoid() ));
-      // Remove BCC from identity on ical invitations \
                (https://intevation.de/roundup/kolab/issue474)
-      msg->setBcc( "" );
+    }
+    // Remove BCC from identity on ical invitations \
(https://intevation.de/roundup/kolab/issue474) +    msg->setBcc( "" );
   }
 
   KMail::Composer * cWin = KMail::makeComposer();
@@ -93,6 +92,24 @@
   cWin->slotWordWrapToggled( false );
   cWin->setSigningAndEncryptionDisabled( true );
 
+  if( GlobalSettings::self()->exchangeCompatibleInvitations() ) {
+    // For Exchange, send ical as attachment, with proper
+    // parameters
+    msg->setCharset( "utf-8" );
+    KMMessagePart *msgPart = new KMMessagePart;
+    msgPart->setName( "cal.ics" );
+    // msgPart->setCteStr( attachCte ); // "base64" ?
+    msgPart->setBodyEncoded( iCal.utf8() );
+    msgPart->setTypeStr( "text" );
+    msgPart->setSubtypeStr( "calendar" );
+    msgPart->setParameter( "method", "reply" );
+    cWin->addAttach( msgPart );
+  } else {
+    msg->setHeaderField( "Content-Type",
+                         "text/calendar; method=reply; charset=\"utf-8\"" );
+    msg->setBody( iCal.utf8() );
+  }
+
   if ( options.readBoolEntry( "AutomaticSending", true ) ) {
     cWin->setAutoDeleteWindow(  true );
     cWin->slotSendNow();
--- branches/KDE/3.5/kdepim/kmail/configuredialog.cpp #661268:661269
@@ -4770,6 +4770,14 @@
            this, SLOT( slotLegacyBodyInvitesToggled( bool ) ) );
   connect( mLegacyBodyInvites, SIGNAL( stateChanged( int ) ),
            this, SLOT( slotEmitChanged( void ) ) );
+
+  mExchangeCompatibleInvitations = new QCheckBox( i18n( "Exchange compatible \
invitation naming" ), gBox ); +  QToolTip::add( mExchangeCompatibleInvitations, i18n( \
"Microsoft Outlook, when used in combination with a Microsoft Exchange server, has a \
problem understanding standards-compliant groupware e-mail. Turn this option on to \
send groupware invitations in a way that Microsoft Exchange understands." ) ); +  \
QWhatsThis::add( mExchangeCompatibleInvitations, i18n( GlobalSettings::self()-> +     \
exchangeCompatibleInvitationsItem()->whatsThis().utf8() ) ); +  connect( \
mExchangeCompatibleInvitations, SIGNAL( stateChanged( int ) ), +           this, \
SLOT( slotEmitChanged( void ) ) ); +
   mAutomaticSending = new QCheckBox( i18n( "Automatic invitation sending" ), gBox );
   QToolTip::add( mAutomaticSending, i18n( "When this is on, the user will not see \
the mail composer window. Invitation mails are sent automatically" ) );  \
QWhatsThis::add( mAutomaticSending, i18n( GlobalSettings::self()-> @@ -4804,15 \
+4812,19 @@  }
 
 void MiscPage::GroupwareTab::doLoadFromGlobalSettings() {
-  // Read the groupware config
   if ( mEnableGwCB ) {
     mEnableGwCB->setChecked( GlobalSettings::self()->groupwareEnabled() );
     gBox->setEnabled( mEnableGwCB->isChecked() );
   }
+
   mLegacyMangleFromTo->setChecked( \
GlobalSettings::self()->legacyMangleFromToHeaders() );  \
mLegacyBodyInvites->blockSignals( true ); +
   mLegacyBodyInvites->setChecked( GlobalSettings::self()->legacyBodyInvites() );
   mLegacyBodyInvites->blockSignals( false );
+
+  mExchangeCompatibleInvitations->setChecked( \
GlobalSettings::self()->exchangeCompatibleInvitations() ); +
   mAutomaticSending->setChecked( GlobalSettings::self()->automaticSending() );
   mAutomaticSending->setEnabled( !mLegacyBodyInvites->isChecked() );
 
@@ -4864,11 +4876,23 @@
 }
 
 void MiscPage::GroupwareTab::save() {
+  KConfigGroup groupware( KMKernel::config(), "Groupware" );
+
   // Write the groupware config
-  if ( mEnableGwCB )
+  if ( mEnableGwCB ) {
+    groupware.writeEntry( "GroupwareEnabled", mEnableGwCB->isChecked() );
+  }
+  groupware.writeEntry( "LegacyMangleFromToHeaders", \
mLegacyMangleFromTo->isChecked() ); +  groupware.writeEntry( "LegacyBodyInvites", \
mLegacyBodyInvites->isChecked() ); +  groupware.writeEntry( \
"ExchangeCompatibleInvitations", mExchangeCompatibleInvitations->isChecked() ); +  \
groupware.writeEntry( "AutomaticSending", mAutomaticSending->isChecked() ); +
+  if ( mEnableGwCB ) {
     GlobalSettings::self()->setGroupwareEnabled( mEnableGwCB->isChecked() );
+  }
   GlobalSettings::self()->setLegacyMangleFromToHeaders( \
mLegacyMangleFromTo->isChecked() );  GlobalSettings::self()->setLegacyBodyInvites( \
mLegacyBodyInvites->isChecked() ); +  \
GlobalSettings::self()->setExchangeCompatibleInvitations( \
mExchangeCompatibleInvitations->isChecked() );  \
GlobalSettings::self()->setAutomaticSending( mAutomaticSending->isChecked() );  
   int format = mStorageFormatCombo->currentItem();
--- branches/KDE/3.5/kdepim/kmail/configuredialog_p.h #661268:661269
@@ -1013,6 +1013,7 @@
 
   QCheckBox* mLegacyMangleFromTo;
   QCheckBox* mLegacyBodyInvites;
+  QCheckBox* mExchangeCompatibleInvitations;
   QCheckBox* mAutomaticSending;
 };
 
--- branches/KDE/3.5/kdepim/kmail/kmail.kcfg #661268:661269
@@ -163,6 +163,12 @@
         <default>false</default>
       </entry>
 
+     <entry name="ExchangeCompatibleInvitations" type="Bool">
+        <label>Exchange compatible invitations naming</label>
+        <whatsthis>Microsoft Outlook, when used in combination with a Microsoft \
Exchange server, has a problem understanding standards-compliant groupware e-mail. \
Turn this option on to send groupware invitations in a way that Microsoft Exchange \
understands.</whatsthis> +        <default>false</default>
+      </entry>
+
       <entry name="AutomaticSending" type="Bool">
         <label>Automatic invitation sending</label>
         <whatsthis>When this is checked, you will not see the mail composer window. \
Instead, all invitation mails are sent automatically. If you want to see the mail \
before sending it, you can uncheck this option. However, be aware that the text in \
the composer window is in iCalendar syntax, and you should not try modifying it by \
                hand.</whatsthis>
--- branches/KDE/3.5/kdepim/kmail/kmkernel.cpp #661268:661269
@@ -523,14 +523,16 @@
       msgPart->setTypeStr( attachType );
       msgPart->setSubtypeStr( attachSubType );
       msgPart->setParameter( attachParamAttr, attachParamValue );
-      msgPart->setContentDisposition( attachContDisp );
+       if( ! GlobalSettings::self()->exchangeCompatibleInvitations() ) {
+        msgPart->setContentDisposition( attachContDisp );
+      }
       if( !attachCharset.isEmpty() ) {
         // kdDebug(5006) << "KMKernel::openComposer set attachCharset to "
         // << attachCharset << endl;
         msgPart->setCharset( attachCharset );
       }
       // Don't show the composer window, if the automatic sending is checked
-      KConfigGroup options(  config(), "Groupware" );
+      KConfigGroup options( config(), "Groupware" );
       iCalAutoSend = options.readBoolEntry( "AutomaticSending", true );
     }
   }
--- branches/KDE/3.5/kdepim/korganizer/komailclient.cpp #661268:661269
@@ -62,7 +62,7 @@
   for(uint i=0; i<attendees.count();++i) {
     const QString email = (*attendees.at(i))->email();
     // In case we (as one of our identities) are the organizer we are sending this
-    // mail. We could also have added ourselves as an attendee, in which case we 
+    // mail. We could also have added ourselves as an attendee, in which case we
     // don't want to send ourselves a notification mail.
     if( organizerEmail !=  email )
       toList << email;
@@ -197,7 +197,7 @@
       if (idx>=0) {
         idx = attachment.find(':',idx)+1;
         meth = attachment.mid(idx,attachment.find('\n',idx)-idx);
-        meth = meth.lower();
+        meth = meth.lower().stripWhiteSpace();
       } else {
         meth = "publish";
       }


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic