NS_IMETHODIMP nsMsgAccount::CreateServer() { if (m_incomingServer) return NS_ERROR_ALREADY_INITIALIZED; return createIncomingServer(); }
NS_IMETHODIMP nsMsgAccount::GetIncomingServer(nsIMsgIncomingServer * *aIncomingServer) { NS_ENSURE_ARG_POINTER(aIncomingServer); // create the incoming server lazily if (!m_incomingServer) { // ignore the error (and return null), but it's still bad so assert nsresult rv = createIncomingServer(); NS_ASSERTION(NS_SUCCEEDED(rv), "couldn't lazily create the server\n"); } NS_IF_ADDREF(*aIncomingServer = m_incomingServer); return NS_OK; }
NS_IMETHODIMP nsMsgAccount::GetIncomingServer(nsIMsgIncomingServer **aIncomingServer) { NS_ENSURE_ARG_POINTER(aIncomingServer); // create the incoming server lazily if (!mTriedToGetServer && !m_incomingServer) { mTriedToGetServer = true; // ignore the error (and return null), but it's still bad so warn nsresult rv = createIncomingServer(); NS_WARN_IF_FALSE(NS_SUCCEEDED(rv), "couldn't lazily create the server\n"); } NS_IF_ADDREF(*aIncomingServer = m_incomingServer); return NS_OK; }