Changeset View
Changeset View
Standalone View
Standalone View
messagecomposer/autotests/replystrategytest.cpp
Show First 20 Lines • Show All 255 Lines • ▼ Show 20 Line(s) | 149 | { | |||
---|---|---|---|---|---|
256 | // except for the user's identities. | 256 | // except for the user's identities. | ||
257 | QTest::newRow("ReplyAll, with Cc in original") | 257 | QTest::newRow("ReplyAll, with Cc in original") | ||
258 | << friend1Address << only(defaultAddress) << both(friend2Address, nondefaultAddress) | 258 | << friend1Address << only(defaultAddress) << both(friend2Address, nondefaultAddress) | ||
259 | << nobody << nobody << QString() << nobody | 259 | << nobody << nobody << QString() << nobody | ||
260 | << (int)ReplyAll << defaultAddress << only(friend1Address) << only(friend2Address); | 260 | << (int)ReplyAll << defaultAddress << only(friend1Address) << only(friend2Address); | ||
261 | QTest::newRow("ReplyAll, with multiple To addresses in original") | 261 | QTest::newRow("ReplyAll, with multiple To addresses in original") | ||
262 | << friend1Address << both(friend2Address, nondefaultAddress) << only(defaultAddress) | 262 | << friend1Address << both(friend2Address, nondefaultAddress) << only(defaultAddress) | ||
263 | << nobody << nobody << QString() << nobody | 263 | << nobody << nobody << QString() << nobody | ||
264 | << (int)ReplyAll << nondefaultAddress << only(friend1Address) << only(friend2Address); | 264 | << (int)ReplyAll << nondefaultAddress << both(friend1Address, friend2Address) << nobody; | ||
265 | QTest::newRow("ReplyAll, with Reply-To in original") | 265 | QTest::newRow("ReplyAll, with Reply-To in original") | ||
266 | << friend1Address << only(defaultAddress) << only(friend2Address) | 266 | << friend1Address << only(defaultAddress) << only(friend2Address) | ||
267 | << only(replyAddress) << nobody << QString() << nobody | 267 | << only(replyAddress) << nobody << QString() << nobody | ||
268 | << (int)ReplyAll << defaultAddress << only(replyAddress) << only(friend2Address); | 268 | << (int)ReplyAll << defaultAddress << only(replyAddress) << only(friend2Address); | ||
269 | QTest::newRow("ReplyAll, with Mail-Reply-To in original") | ||||
270 | << friend1Address << only(defaultAddress) << only(friend2Address) | ||||
271 | << only(replyAddress) << nobody << QString() << only(mailReplyAddress) | ||||
272 | << (int)ReplyAll << defaultAddress << only(mailReplyAddress) << only(friend2Address); | ||||
273 | | ||||
274 | // If the original message was _from_ the user _to_ another person (the | ||||
275 | // reverse of the usual direction), reply to all goes to the other person. | ||||
276 | // Therefore Mail-Reply-To and Reply-To are ignored. | ||||
277 | // The reply is assumed to add to the original message. | ||||
278 | QTest::newRow("ReplyAll, from default identity to someone") | ||||
279 | << defaultAddress << only(friend1Address) << only(friend2Address) | ||||
280 | << only(replyAddress) << nobody << QString() << only(mailReplyAddress) | ||||
281 | << (int)ReplyAll << defaultAddress << only(friend1Address) << only(friend2Address); | ||||
282 | | ||||
283 | // If the original message was from one of the user's identities to another | ||||
284 | // identity (i.e., between two of the user's mail accounts), reply to all | ||||
285 | // goes back to the sending identity. | ||||
286 | QTest::newRow("ReplyAll, between identities") | ||||
287 | << defaultAddress << only(nondefaultAddress) << only(friend2Address) | ||||
288 | << nobody << nobody << QString() << nobody | ||||
289 | << (int)ReplyAll << nondefaultAddress << only(defaultAddress) << only(friend2Address); | ||||
269 | 290 | | |||
270 | // If the original passed through a mailing list, ReplyAll replies to the | 291 | // If the original passed through a mailing list, ReplyAll replies to the | ||
271 | // list, preferring Mail-Followup-To over List-Post as the list address. | 292 | // list. | ||
272 | // It CCs the author, using Mail-Reply-To, Reply-To, or From (in that order). | 293 | // It CCs the author, using Mail-Reply-To, Reply-To, or From (in that order). | ||
273 | QTest::newRow("ReplyAll, from list with List-Post") | 294 | QTest::newRow("ReplyAll, from list with List-Post") | ||
274 | << friend1Address << only(nondefaultAddress) << only(friend2Address) | 295 | << friend1Address << only(nondefaultAddress) << only(friend2Address) | ||
275 | << nobody << nobody << listAddress << nobody | 296 | << nobody << nobody << listAddress << nobody | ||
276 | << (int)ReplyAll << nondefaultAddress << only(listAddress) << both(friend1Address, friend2Address); | 297 | << (int)ReplyAll << nondefaultAddress << only(listAddress) << both(friend1Address, friend2Address); | ||
298 | QTest::newRow("ReplyAll, from list with Reply-To") | ||||
299 | << friend1Address << only(defaultAddress) << only(friend2Address) | ||||
300 | << only(replyAddress) << nobody << listAddress << nobody | ||||
301 | << (int)ReplyAll << defaultAddress << only(listAddress) << both(replyAddress, friend2Address); | ||||
302 | QTest::newRow("ReplyAll, from list with Mail-Reply-To") | ||||
303 | << friend1Address << only(defaultAddress) << only(friend2Address) | ||||
304 | << only(replyAddress) << nobody << listAddress << only(mailReplyAddress) | ||||
305 | << (int)ReplyAll << defaultAddress << only(listAddress) << both(mailReplyAddress, friend2Address); | ||||
277 | 306 | | |||
278 | // If Reply-To is the same as List-Post, ReplyAll ignores it and uses | 307 | // If Reply-To is the same as List-Post, ReplyAll ignores it and uses | ||
279 | // From, because the mailing list munged Reply-To. | 308 | // From for the author's address, because the mailing list munged Reply-To. | ||
280 | QTest::newRow("ReplyAll, from list that munges Reply-To") | 309 | QTest::newRow("ReplyAll, from list that munges Reply-To") | ||
281 | << friend1Address << only(defaultAddress) << nobody | 310 | << friend1Address << only(defaultAddress) << nobody | ||
282 | << only(listAddress) << nobody << listAddress << nobody | 311 | << only(listAddress) << nobody << listAddress << nobody | ||
283 | << (int)ReplyAll << defaultAddress << only(listAddress) << only(friend1Address); | 312 | << (int)ReplyAll << defaultAddress << only(listAddress) << only(friend1Address); | ||
284 | 313 | | |||
314 | // If Reply-To contains List-Post, ReplyAll uses the other reply | ||||
315 | // addresses, because the mailing list didn't completely munge Reply-To. | ||||
316 | QTest::newRow("ReplyAll, from list that lightly munges Reply-To") | ||||
317 | << friend1Address << only(defaultAddress) << nobody | ||||
318 | << both(replyAddress, listAddress) << nobody << listAddress << nobody | ||||
319 | << (int)ReplyAll << defaultAddress << only(listAddress) << only(replyAddress); | ||||
320 | | ||||
321 | // If Mail-Followup-To header is present, use it for To and ignore other | ||||
322 | // headers. Cc is empty. | ||||
323 | QTest::newRow("ReplyAll, from list with Reply-To and Mail-Followup-To") | ||||
324 | << friend1Address << only(defaultAddress) << only(friend2Address) | ||||
325 | << only(replyAddress) << only(followupAddress) << listAddress << only(mailReplyAddress) | ||||
326 | << (int)ReplyAll << defaultAddress << only(followupAddress) << nobody; | ||||
327 | | ||||
285 | // Reply to Author | 328 | // Reply to Author | ||
286 | // --------------- | 329 | // --------------- | ||
287 | // ReplyAuthor ignores Cc, and replies to the Mail-Reply-To, Reply-To, or | 330 | // ReplyAuthor ignores Cc, and replies to the Mail-Reply-To, Reply-To, or | ||
288 | // From addresses, in that order of preference, if List-Post is absent. | 331 | // From addresses, in that order of preference, if List-Post is absent. | ||
289 | QTest::newRow("ReplyAuthor, no special headers") | 332 | QTest::newRow("ReplyAuthor, no special headers") | ||
290 | << friend1Address << only(defaultAddress) << only(friend2Address) | 333 | << friend1Address << only(defaultAddress) << only(friend2Address) | ||
291 | << nobody << nobody << QString() << nobody | 334 | << nobody << nobody << QString() << nobody | ||
292 | << (int)ReplyAuthor << defaultAddress << only(friend1Address) << nobody; | 335 | << (int)ReplyAuthor << defaultAddress << only(friend1Address) << nobody; | ||
▲ Show 20 Lines • Show All 85 Lines • Show Last 20 Lines |