Backport patch by Philippe Rigault, which makes it possible to accept

invitations if one is not in the invitations To: list, now that the
string freeze is lifted somewhat.

CCMAIL: 106594@bugs.kde.org

svn path=/branches/KDE/3.5/kdepim/; revision=509083
wilder-work
Till Adam 20 years ago
parent 9165348890
commit 9ceed2d90d
  1. 61
      callback.cpp

@ -112,33 +112,46 @@ QString Callback::receiver() const
mReceiverSet = true;
QStringList addrs = KPIM::splitEmailAddrList( mMsg->to() );
if( addrs.count() < 2 )
// Only one receiver, so that has to be us
mReceiver = mMsg->to();
else {
int found = 0;
for( QStringList::Iterator it = addrs.begin(); it != addrs.end(); ++it ) {
if( kmkernel->identityManager()->identityForAddress( *it ) !=
KPIM::Identity::null() ) {
// Ok, this could be us
++found;
mReceiver = *it;
}
int found = 0;
for( QStringList::Iterator it = addrs.begin(); it != addrs.end(); ++it ) {
if( kmkernel->identityManager()->identityForAddress( *it ) !=
KPIM::Identity::null() ) {
// Ok, this could be us
++found;
mReceiver = *it;
}
if( found != 1 ) {
bool ok;
mReceiver =
KInputDialog::getItem( i18n( "Select Address" ),
i18n( "<qt>None of your identities match the "
"receiver of this message,<br>please "
"choose which of the following addresses "
"is yours:" ),
addrs, 0, FALSE, &ok, kmkernel->mainWin() );
if( !ok )
mReceiver = QString::null;
}
QStringList ccaddrs = KPIM::splitEmailAddrList( mMsg->cc() );
for( QStringList::Iterator it = ccaddrs.begin(); it != ccaddrs.end(); ++it ) {
if( kmkernel->identityManager()->identityForAddress( *it ) !=
KPIM::Identity::null() ) {
// Ok, this could be us
++found;
mReceiver = *it;
}
}
if( found != 1 ) {
bool ok;
QString selectMessage;
if (found == 0) {
selectMessage = i18n("<qt>None of your identities match the "
"receiver of this message,<br>please "
"choose which of the following addresses "
"is yours, if any:");
} else {
selectMessage = i18n("<qt>Several of your identities match the "
"receiver of this message,<br>please "
"choose which of the following addresses "
"is yours:");
}
mReceiver =
KInputDialog::getItem( i18n( "Select Address" ),
selectMessage,
addrs, 0, FALSE, &ok, kmkernel->mainWin() );
if( !ok )
mReceiver = QString::null;
}
return mReceiver;
}

Loading…
Cancel
Save