NS_IMETHODIMP nsIMAPHostSessionList::GetPasswordForHost(const char *serverKey, nsString &result)
{
  PR_EnterMonitor(gCachedHostInfoMonitor);
  nsIMAPHostInfo *host = FindHost(serverKey);
  if (host)
    result.AssignWithConversion(host->fCachedPassword);
  PR_ExitMonitor(gCachedHostInfoMonitor);
  return (host == NULL) ? NS_ERROR_ILLEGAL_VALUE : NS_OK;
}
Beispiel #2
0
void
IDBIndex::GetLocale(nsString& aLocale) const
{
  AssertIsOnOwningThread();
  MOZ_ASSERT(mMetadata);

  if (mMetadata->locale().IsEmpty()) {
    SetDOMStringToNull(aLocale);
  } else {
    aLocale.AssignWithConversion(mMetadata->locale());
  }
}
// Returns NULL if there is no personal namespace on the given host
NS_IMETHODIMP nsIMAPHostSessionList::GetOnlineInboxPathForHost(const char *serverKey, nsString &result)
{
  PR_EnterMonitor(gCachedHostInfoMonitor);
  nsIMAPHostInfo *host = FindHost(serverKey);
  if (host)
  {
    nsIMAPNamespace *ns = NULL;
    ns = host->fNamespaceList->GetDefaultNamespaceOfType(kPersonalNamespace);
    if (ns)
    {
      result.AssignWithConversion(ns->GetPrefix());
      result.AppendLiteral("INBOX");
    }
  }
  else
  {
    result.SetLength(0);
  }
  PR_ExitMonitor(gCachedHostInfoMonitor);
  return (host == NULL) ? NS_ERROR_ILLEGAL_VALUE : NS_OK;
}