mirror of
https://github.com/Cockatrice/Cockatrice.git
synced 2026-06-15 11:38:49 -07:00
Strip dashes in Yahoo addresses (#6284)
This commit is contained in:
parent
d206a70b8a
commit
8f80996515
1 changed files with 8 additions and 1 deletions
|
|
@ -25,7 +25,7 @@ QPair<QString, QString> EmailParser::parseEmailAddress(const QString &dirtyEmail
|
||||||
|
|
||||||
// Trim out dots and pluses from Google/Gmail domains
|
// Trim out dots and pluses from Google/Gmail domains
|
||||||
if (capturedEmailAddressDomain.toLower() == "gmail.com") {
|
if (capturedEmailAddressDomain.toLower() == "gmail.com") {
|
||||||
// Remove all content after first plus sign (as unnecessary with gmail)
|
// Remove all content after the first plus sign (as unnecessary with gmail)
|
||||||
// https://gmail.googleblog.com/2008/03/2-hidden-ways-to-get-more-from-your.html
|
// https://gmail.googleblog.com/2008/03/2-hidden-ways-to-get-more-from-your.html
|
||||||
const auto firstPlusSign = capturedEmailUser.indexOf("+");
|
const auto firstPlusSign = capturedEmailUser.indexOf("+");
|
||||||
if (firstPlusSign != -1) {
|
if (firstPlusSign != -1) {
|
||||||
|
|
@ -36,6 +36,13 @@ QPair<QString, QString> EmailParser::parseEmailAddress(const QString &dirtyEmail
|
||||||
// https://gmail.googleblog.com/2008/03/2-hidden-ways-to-get-more-from-your.html
|
// https://gmail.googleblog.com/2008/03/2-hidden-ways-to-get-more-from-your.html
|
||||||
capturedEmailUser.replace(".", "");
|
capturedEmailUser.replace(".", "");
|
||||||
}
|
}
|
||||||
|
// Trim out minuses from Yahoo domains
|
||||||
|
else if (capturedEmailAddressDomain.toLower() == "yahoo.com") {
|
||||||
|
const auto firstMinusSign = capturedEmailUser.indexOf("-");
|
||||||
|
if (firstMinusSign != -1) {
|
||||||
|
capturedEmailUser = capturedEmailUser.left(firstMinusSign);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
return {capturedEmailUser, capturedEmailAddressDomain};
|
return {capturedEmailUser, capturedEmailAddressDomain};
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue