Backed out changeset f1ca6ee69568 (bug 1695703) for test failures. rs=backout

This commit is contained in:
Magnus Melin 2021-03-07 12:56:42 +02:00
Родитель 460e6636b3
Коммит ad287cb734
3 изменённых файлов: 17 добавлений и 21 удалений

Просмотреть файл

@ -88,7 +88,7 @@ nsMsgIncomingServer::Observe(nsISupports* aSubject, const char* aTopic,
nsresult rv;
// When the state of the password manager changes we need to clear the
// password from the cache.
// password from the cache in case the user just removed it.
if (strcmp(aTopic, "passwordmgr-storage-changed") == 0) {
// Check that the notification is for this server.
nsCOMPtr<nsILoginInfo> loginInfo = do_QueryInterface(aSubject);
@ -99,16 +99,11 @@ nsMsgIncomingServer::Observe(nsISupports* aSubject, const char* aTopic,
GetHostName(hostname);
nsAutoCString fullName;
GetType(fullName);
if (fullName.EqualsLiteral("pop3")) {
fullName = "mailbox://"_ns + hostname;
} else {
fullName += "://"_ns + hostname;
}
if (fullName.Equals(NS_ConvertUTF16toUTF8(hostnameInfo))) {
rv = ForgetSessionPassword();
NS_ENSURE_SUCCESS(rv, rv);
}
fullName += "://"_ns + hostname;
if (!fullName.Equals(NS_ConvertUTF16toUTF8(hostnameInfo))) return NS_OK;
}
rv = ForgetSessionPassword();
NS_ENSURE_SUCCESS(rv, rv);
} else if (strcmp(aTopic, NS_XPCOM_SHUTDOWN_OBSERVER_ID) == 0) {
// Now remove ourselves from the observer service as well.
nsCOMPtr<nsIObserverService> observerService =

Просмотреть файл

@ -26,14 +26,16 @@ SmtpServer.prototype = {
classID: Components.ID("{3a75f5ea-651e-4696-9813-848c03da8bbd}"),
observe(subject, topic, data) {
// When the state of the password manager changes we need to clear the
// password from the cache.
if (
topic == "passwordmgr-storage-changed" &&
if (topic == "passwordmgr-storage-changed") {
// Check that the notification is for this server.
subject instanceof Ci.nsILoginInfo &&
subject.hostname == "smtp://" + this.hostname
) {
if (
subject instanceof Ci.nsILoginInfo &&
subject.hostname != "smtp://" + this.hostname
) {
return;
}
// When the state of the password manager changes we need to clear the
// password from the cache in case the user just removed it.
this.password = "";
}
},

Просмотреть файл

@ -52,7 +52,7 @@ NS_IMETHODIMP
nsSmtpServer::Observe(nsISupports* aSubject, const char* aTopic,
const char16_t* aData) {
// When the state of the password manager changes we need to clear the
// password from the cache.
// password from the cache in case the user just removed it.
if (strcmp(aTopic, "passwordmgr-storage-changed") == 0) {
// Check that the notification is for this server.
nsCOMPtr<nsILoginInfo> loginInfo = do_QueryInterface(aSubject);
@ -63,10 +63,9 @@ nsSmtpServer::Observe(nsISupports* aSubject, const char* aTopic,
GetHostname(hostname);
nsAutoCString fullName;
fullName = "smtp://"_ns + hostname;
if (fullName.Equals(NS_ConvertUTF16toUTF8(hostnameInfo))) {
m_password.Truncate();
}
if (!fullName.Equals(NS_ConvertUTF16toUTF8(hostnameInfo))) return NS_OK;
}
m_password.Truncate();
} else if (strcmp(aTopic, NS_XPCOM_SHUTDOWN_OBSERVER_ID) == 0) {
// Now remove ourselves from the observer service as well.
nsCOMPtr<nsIObserverService> observerService =