add "Equals" to the nsIMsgIncomingServer interface. we'll use this soon. r=alecf

git-svn-id: svn://10.0.0.236/trunk@58726 18797224-902f-48f8-a5cc-f745e15eee43
This commit is contained in:
sspitzer%netscape.com
2000-01-26 04:11:14 +00:00
parent 2119470803
commit 5a4cb1be4b
2 changed files with 30 additions and 0 deletions

View File

@@ -140,6 +140,9 @@ interface nsIMsgIncomingServer : nsISupports {
wstring toString();
attribute boolean isSecure;
/* used for comparing nsIMsgIncomingServers */
boolean equals(in nsIMsgIncomingServer server);
};
%{C++

View File

@@ -707,6 +707,33 @@ nsMsgIncomingServer::GetLocalStoreType(char **aResult)
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
NS_IMPL_SERVERPREF_STR(nsMsgIncomingServer, HostName, "hostname");
NS_IMPL_SERVERPREF_INT(nsMsgIncomingServer, Port, "port");