Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
PIM
PIM Messagelib
Commits
f092ebcc
Commit
f092ebcc
authored
Aug 02, 2021
by
Laurent Montel
😁
Browse files
Merge remote-tracking branch 'origin/release/21.08'
parents
06d1c430
23547ea9
Changes
3
Hide whitespace changes
Inline
Side-by-side
messagecomposer/src/composer/composerviewbase.cpp
View file @
f092ebcc
...
...
@@ -79,17 +79,6 @@
using
namespace
MessageComposer
;
static
QStringList
encodeIdn
(
const
QStringList
&
emails
)
{
QStringList
encoded
;
encoded
.
reserve
(
emails
.
count
());
for
(
const
QString
&
email
:
emails
)
{
encoded
<<
KEmailAddress
::
normalizeAddressesAndEncodeIdn
(
email
);
}
return
encoded
;
}
ComposerViewBase
::
ComposerViewBase
(
QObject
*
parent
,
QWidget
*
parentGui
)
:
QObject
(
parent
)
,
m_msg
(
KMime
::
Message
::
Ptr
(
new
KMime
::
Message
))
...
...
@@ -1130,14 +1119,14 @@ void ComposerViewBase::fillQueueJobHeaders(MailTransport::MessageQueueJob *qjob,
// if this header is not empty, it contains the real recipient of the message, either the primary or one of the
// secondary recipients. so we set that to the transport job, while leaving the message itself alone.
if
(
KMime
::
Headers
::
Base
*
realTo
=
message
->
headerByType
(
"X-KMail-EncBccRecipients"
))
{
qjob
->
addressAttribute
().
setTo
(
cleanEmailList
(
encodeIdn
(
realTo
->
asUnicodeString
().
split
(
QLatin1Char
(
'%'
))))
)
;
qjob
->
addressAttribute
().
setTo
(
MessageComposer
::
Util
::
clean
Up
EmailList
AndEncoding
(
realTo
->
asUnicodeString
().
split
(
QLatin1Char
(
'%'
))));
message
->
removeHeader
(
"X-KMail-EncBccRecipients"
);
message
->
assemble
();
qCDebug
(
MESSAGECOMPOSER_LOG
)
<<
"sending with-bcc encr mail to a/n recipient:"
<<
qjob
->
addressAttribute
().
to
();
}
else
{
qjob
->
addressAttribute
().
setTo
(
cleanEmailList
(
encodeIdn
(
infoPart
->
to
()))
)
;
qjob
->
addressAttribute
().
setCc
(
cleanEmailList
(
encodeIdn
(
infoPart
->
cc
()))
)
;
qjob
->
addressAttribute
().
setBcc
(
cleanEmailList
(
encodeIdn
(
infoPart
->
bcc
()))
)
;
qjob
->
addressAttribute
().
setTo
(
MessageComposer
::
Util
::
clean
Up
EmailList
AndEncoding
(
infoPart
->
to
()));
qjob
->
addressAttribute
().
setCc
(
MessageComposer
::
Util
::
clean
Up
EmailList
AndEncoding
(
infoPart
->
cc
()));
qjob
->
addressAttribute
().
setBcc
(
MessageComposer
::
Util
::
clean
Up
EmailList
AndEncoding
(
infoPart
->
bcc
()));
}
}
...
...
@@ -1805,16 +1794,6 @@ void ComposerViewBase::setUrgent(bool urgent)
m_urgent
=
urgent
;
}
QStringList
ComposerViewBase
::
cleanEmailList
(
const
QStringList
&
emails
)
{
QStringList
clean
;
clean
.
reserve
(
emails
.
count
());
for
(
const
QString
&
email
:
emails
)
{
clean
<<
KEmailAddress
::
extractEmailAddress
(
email
);
}
return
clean
;
}
int
ComposerViewBase
::
autoSaveInterval
()
const
{
return
m_autoSaveInterval
;
...
...
messagecomposer/src/utils/util.cpp
View file @
f092ebcc
...
...
@@ -21,6 +21,7 @@
#include "messagecomposer_debug.h"
#include <KCharsets>
#include <KEmailAddress>
#include <KLocalizedString>
#include <KMessageBox>
...
...
@@ -464,3 +465,28 @@ bool MessageComposer::Util::hasMissingAttachments(const QStringList &attachmentK
}
return
true
;
}
static
QStringList
encodeIdn
(
const
QStringList
&
emails
)
{
QStringList
encoded
;
encoded
.
reserve
(
emails
.
count
());
for
(
const
QString
&
email
:
emails
)
{
encoded
<<
KEmailAddress
::
normalizeAddressesAndEncodeIdn
(
email
);
}
return
encoded
;
}
QStringList
MessageComposer
::
Util
::
cleanEmailList
(
const
QStringList
&
emails
)
{
QStringList
clean
;
clean
.
reserve
(
emails
.
count
());
for
(
const
QString
&
email
:
emails
)
{
clean
<<
KEmailAddress
::
extractEmailAddress
(
email
);
}
return
clean
;
}
QStringList
MessageComposer
::
Util
::
cleanUpEmailListAndEncoding
(
const
QStringList
&
emails
)
{
return
cleanEmailList
(
encodeIdn
(
emails
));
}
messagecomposer/src/utils/util.h
View file @
f092ebcc
...
...
@@ -75,6 +75,9 @@ Q_REQUIRED_RESULT MESSAGECOMPOSER_EXPORT bool isStandaloneMessage(const Akonadi:
Q_REQUIRED_RESULT
MESSAGECOMPOSER_EXPORT
KMime
::
Message
::
Ptr
message
(
const
Akonadi
::
Item
&
item
);
Q_REQUIRED_RESULT
MESSAGECOMPOSER_EXPORT
bool
hasMissingAttachments
(
const
QStringList
&
attachmentKeywords
,
QTextDocument
*
doc
,
const
QString
&
subj
);
Q_REQUIRED_RESULT
MESSAGECOMPOSER_EXPORT
QStringList
cleanEmailList
(
const
QStringList
&
emails
);
Q_REQUIRED_RESULT
MESSAGECOMPOSER_EXPORT
QStringList
cleanUpEmailListAndEncoding
(
const
QStringList
&
emails
);
}
}
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment