Members of the KDE Community are recommended to subscribe to the kde-community mailing list at https://mail.kde.org/mailman/listinfo/kde-community to allow them to participate in important discussions and receive other important announcements

Commit 74302daa authored by Laurent Montel's avatar Laurent Montel 😁

Move in util class

parent ac611569
......@@ -71,6 +71,8 @@
#include "pimcommon/storageservice/storageservicemanager.h"
#include "pimcommon/storageservice/storageserviceprogressmanager.h"
#include "messagecomposer/utils/util.h"
#include "agents/sendlateragent/sendlaterutil.h"
#include "agents/sendlateragent/sendlaterdialog.h"
#include "agents/sendlateragent/sendlaterinfo.h"
......@@ -2329,18 +2331,7 @@ void KMComposeWin::slotFetchJob(KJob*job)
attachmentName = contact.realName() + QLatin1String( ".vcf" );
//Workaround about broken kaddressbook fields.
QByteArray data = item.payloadData();
data.replace("X-messaging/aim-All",("X-AIM"));
data.replace("X-messaging/icq-All",("X-ICQ"));
data.replace("X-messaging/xmpp-All",("X-JABBER"));
data.replace("X-messaging/msn-All",("X-MSN"));
data.replace("X-messaging/yahoo-All",("X-YAHOO"));
data.replace("X-messaging/gadu-All",("X-GADUGADU"));
data.replace("X-messaging/skype-All",("X-SKYPE"));
data.replace("X-messaging/groupwise-All",("X-GROUPWISE"));
data.replace(("X-messaging/sms-All"),("X-SMS"));
data.replace(("X-messaging/meanwhile-All"),("X-MEANWHILE"));
data.replace(("X-messaging/irc-All"),("X-IRC"));
data.replace(("X-messaging/googletalk-All"),("X-GTALK"));
MessageComposer::Util::adaptVcard(data);
addAttachment( attachmentName, KMime::Headers::CEbase64, QString(), data, item.mimeType().toLatin1() );
} else {
addAttachment( attachmentName, KMime::Headers::CEbase64, QString(), item.payloadData(), item.mimeType().toLatin1() );
......
......@@ -362,3 +362,19 @@ void MessageComposer::Util::removeNotNecessaryHeaders(const KMime::Message::Ptr
msg->removeHeader( "X-KMail-EncryptActionEnabled" );
msg->removeHeader( "X-KMail-CryptoMessageFormat" );
}
void MessageComposer::Util::adaptVcard(QByteArray &data)
{
data.replace("X-messaging/aim-All",("X-AIM"));
data.replace("X-messaging/icq-All",("X-ICQ"));
data.replace("X-messaging/xmpp-All",("X-JABBER"));
data.replace("X-messaging/msn-All",("X-MSN"));
data.replace("X-messaging/yahoo-All",("X-YAHOO"));
data.replace("X-messaging/gadu-All",("X-GADUGADU"));
data.replace("X-messaging/skype-All",("X-SKYPE"));
data.replace("X-messaging/groupwise-All",("X-GROUPWISE"));
data.replace(("X-messaging/sms-All"),("X-SMS"));
data.replace(("X-messaging/meanwhile-All"),("X-MEANWHILE"));
data.replace(("X-messaging/irc-All"),("X-IRC"));
data.replace(("X-messaging/googletalk-All"),("X-GTALK"));
}
......@@ -84,6 +84,7 @@ MESSAGECOMPOSER_EXPORT bool sendMailDispatcherIsOnline( QWidget *parent = 0);
MESSAGECOMPOSER_EXPORT QString rot13(const QString &s);
MESSAGECOMPOSER_EXPORT void addTextBox(QTextEdit *edit);
MESSAGECOMPOSER_EXPORT void removeNotNecessaryHeaders(const KMime::Message::Ptr &msg);
MESSAGECOMPOSER_EXPORT void adaptVcard(QByteArray &data);
}
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment