зеркало из https://github.com/mozilla/pjs.git
add "Equals" to the nsIMsgIncomingServer interface. we'll use this soon. r=alecf
This commit is contained in:
Родитель
8eb3d14017
Коммит
9b49989be2
|
@ -140,6 +140,9 @@ interface nsIMsgIncomingServer : nsISupports {
|
||||||
wstring toString();
|
wstring toString();
|
||||||
|
|
||||||
attribute boolean isSecure;
|
attribute boolean isSecure;
|
||||||
|
|
||||||
|
/* used for comparing nsIMsgIncomingServers */
|
||||||
|
boolean equals(in nsIMsgIncomingServer server);
|
||||||
};
|
};
|
||||||
|
|
||||||
%{C++
|
%{C++
|
||||||
|
|
|
@ -707,6 +707,33 @@ nsMsgIncomingServer::GetLocalStoreType(char **aResult)
|
||||||
return NS_ERROR_UNEXPECTED;
|
return NS_ERROR_UNEXPECTED;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
NS_IMETHODIMP
|
||||||
|
nsMsgIncomingServer::Equals(nsIMsgIncomingServer *server, PRBool *_retval)
|
||||||
|
{
|
||||||
|
nsresult rv;
|
||||||
|
|
||||||
|
NS_ENSURE_ARG_POINTER(server);
|
||||||
|
NS_ENSURE_ARG_POINTER(_retval);
|
||||||
|
|
||||||
|
nsXPIDLCString key1;
|
||||||
|
nsXPIDLCString key2;
|
||||||
|
|
||||||
|
rv = GetKey(getter_Copies(key1));
|
||||||
|
if (NS_FAILED(rv)) return rv;
|
||||||
|
|
||||||
|
rv = server->GetKey(getter_Copies(key2));
|
||||||
|
if (NS_FAILED(rv)) return rv;
|
||||||
|
|
||||||
|
// compare the server keys
|
||||||
|
if (PL_strcmp((const char *)key1,(const char *)key2)) {
|
||||||
|
*_retval = PR_FALSE;
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
*_retval = PR_TRUE;
|
||||||
|
}
|
||||||
|
return rv;
|
||||||
|
}
|
||||||
|
|
||||||
// use the convenience macros to implement the accessors
|
// use the convenience macros to implement the accessors
|
||||||
NS_IMPL_SERVERPREF_STR(nsMsgIncomingServer, HostName, "hostname");
|
NS_IMPL_SERVERPREF_STR(nsMsgIncomingServer, HostName, "hostname");
|
||||||
NS_IMPL_SERVERPREF_INT(nsMsgIncomingServer, Port, "port");
|
NS_IMPL_SERVERPREF_INT(nsMsgIncomingServer, Port, "port");
|
||||||
|
|
Загрузка…
Ссылка в новой задаче