Changeset View
Changeset View
Standalone View
Standalone View
messagecomposer/src/helper/messagefactoryng.cpp
Show First 20 Lines • Show All 149 Lines • ▼ Show 20 Line(s) | 147 | { | |||
---|---|---|---|---|---|
150 | } else if (!replyToList.isEmpty()) { | 150 | } else if (!replyToList.isEmpty()) { | ||
151 | toList = replyToList; | 151 | toList = replyToList; | ||
152 | // use the ReplyAll template only when it's a reply to a mailing list | 152 | // use the ReplyAll template only when it's a reply to a mailing list | ||
153 | if (m_mailingListAddresses.isEmpty()) { | 153 | if (m_mailingListAddresses.isEmpty()) { | ||
154 | replyAll = false; | 154 | replyAll = false; | ||
155 | } | 155 | } | ||
156 | } else if (!m_mailingListAddresses.isEmpty()) { | 156 | } else if (!m_mailingListAddresses.isEmpty()) { | ||
157 | toList = (KMime::Types::Mailbox::List() << m_mailingListAddresses.at(0)); | 157 | toList = (KMime::Types::Mailbox::List() << m_mailingListAddresses.at(0)); | ||
158 | } else { | 158 | } else { | ||
159 | // doesn't seem to be a mailing list, reply to From: address | 159 | // Doesn't seem to be a mailing list. | ||
knauss: rename the current `toList` into `fromList` and create the variable `toList=m_origMsg->to()… | |||||
160 | toList = m_origMsg->from()->mailboxes(); | 160 | auto originalFromList = m_origMsg->from()->mailboxes(); | ||
161 | 161 | auto originalToList = m_origMsg->to()->mailboxes(); | |||
162 | if (m_identityManager->thatIsMe(KMime::Types::Mailbox::listToUnicodeString(toList))) { | 162 | | ||
163 | // sender seems to be one of our own identities, so we assume that this | 163 | if (m_identityManager->thatIsMe(KMime::Types::Mailbox::listToUnicodeString(originalFromList)) | ||
164 | // is a reply to a "sent" mail where the users wants to add additional | 164 | && !m_identityManager->thatIsMe(KMime::Types::Mailbox::listToUnicodeString(originalToList)) | ||
165 | // information for the recipient. | 165 | ) { | ||
166 | toList = m_origMsg->to()->mailboxes(); | 166 | // Sender seems to be one of our own identities and recipient is not, | ||
167 | // so we assume that this is a reply to a "sent" mail where the user | ||||
168 | // wants to add additional information for the recipient. | ||||
169 | toList = originalToList; | ||||
170 | } else { | ||||
171 | // "Normal" case: reply to sender. | ||||
172 | toList = originalFromList; | ||||
167 | } | 173 | } | ||
168 | 174 | | |||
169 | replyAll = false; | 175 | replyAll = false; | ||
170 | } | 176 | } | ||
171 | // strip all my addresses from the list of recipients | 177 | // strip all my addresses from the list of recipients | ||
172 | const KMime::Types::Mailbox::List recipients = toList; | 178 | const KMime::Types::Mailbox::List recipients = toList; | ||
173 | 179 | | |||
174 | toList = stripMyAddressesFromAddressList(recipients, m_identityManager); | 180 | toList = stripMyAddressesFromAddressList(recipients, m_identityManager); | ||
▲ Show 20 Lines • Show All 894 Lines • Show Last 20 Lines |
rename the current toList into fromList and create the variable toList=m_origMsg->to()->mailboxes()