mirror of
https://github.com/Cockatrice/Cockatrice.git
synced 2026-01-17 23:35:50 -08:00
Strip dashes in Yahoo addresses (#6284)
This commit is contained in:
@@ -25,7 +25,7 @@ QPair<QString, QString> EmailParser::parseEmailAddress(const QString &dirtyEmail
|
||||
|
||||
// Trim out dots and pluses from Google/Gmail domains
|
||||
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
|
||||
const auto firstPlusSign = capturedEmailUser.indexOf("+");
|
||||
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
|
||||
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};
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user