From 8a51948c914bf8bd6f665fd45a962ee0ee1310fa Mon Sep 17 00:00:00 2001 From: "ducarroz%netscape.com" Date: Fri, 12 Mar 1999 01:09:48 +0000 Subject: [PATCH] Add pref for user real name, organization and user email address git-svn-id: svn://10.0.0.236/trunk@23814 18797224-902f-48f8-a5cc-f745e15eee43 --- mozilla/mailnews/base/public/nsIMsgIdentity.h | 3 ++ mozilla/mailnews/base/src/nsMsgIdentity.cpp | 39 +++++++++++++++++++ mozilla/mailnews/base/src/nsMsgIdentity.h | 6 +++ 3 files changed, 48 insertions(+) diff --git a/mozilla/mailnews/base/public/nsIMsgIdentity.h b/mozilla/mailnews/base/public/nsIMsgIdentity.h index 3a09c1e4326..8fb5a0a98e0 100644 --- a/mozilla/mailnews/base/public/nsIMsgIdentity.h +++ b/mozilla/mailnews/base/public/nsIMsgIdentity.h @@ -49,6 +49,9 @@ public: // user name, pwd, mail server to use, etc.... ////////////////////////////////////////////////////////////////////////////////// NS_IMETHOD GetRootFolderPath(const char ** aRootFolderPath) = 0; + NS_IMETHOD GetOrganization(const char ** aOrganization) = 0; + NS_IMETHOD GetUserFullName(const char ** aUserFullName) = 0; // User real name + NS_IMETHOD GetUserEmail(const char ** aUserEmail) = 0; NS_IMETHOD GetUserName(const char ** aUserName) = 0; // right now it is pop & smtp user name NS_IMETHOD GetPopPassword(const char ** aUserPassword) = 0; NS_IMETHOD GetPopServer(const char ** aHostName) = 0; diff --git a/mozilla/mailnews/base/src/nsMsgIdentity.cpp b/mozilla/mailnews/base/src/nsMsgIdentity.cpp index 2b510cb447d..a9cd845d848 100644 --- a/mozilla/mailnews/base/src/nsMsgIdentity.cpp +++ b/mozilla/mailnews/base/src/nsMsgIdentity.cpp @@ -29,6 +29,9 @@ NS_IMPL_ISUPPORTS(nsMsgIdentity, nsIMsgIdentity::GetIID()); nsMsgIdentity::nsMsgIdentity() { NS_INIT_REFCNT(); + m_organization = nsnull; + m_userFullName = nsnull; + m_userEmail = nsnull; m_userName = nsnull; m_userPassword = nsnull; m_smtpHost = nsnull; @@ -39,6 +42,9 @@ nsMsgIdentity::nsMsgIdentity() nsMsgIdentity::~nsMsgIdentity() { + PR_FREEIF(m_organization); + PR_FREEIF(m_userFullName); + PR_FREEIF(m_userEmail); PR_FREEIF(m_userName); PR_FREEIF(m_userPassword); PR_FREEIF(m_smtpHost); @@ -62,6 +68,18 @@ void nsMsgIdentity::InitializeIdentity() if (NS_SUCCEEDED(rv) && prefLength > 0) m_rootPath = PL_strdup(prefValue); + rv = prefs->GetCharPref("mailnews.organization", prefValue, &prefLength); + if (NS_SUCCEEDED(rv) && prefLength > 0) + m_organization = PL_strdup(prefValue); + + rv = prefs->GetCharPref("mailnews.user_full_name", prefValue, &prefLength); + if (NS_SUCCEEDED(rv) && prefLength > 0) + m_userFullName = PL_strdup(prefValue); + + rv = prefs->GetCharPref("mailnews.user_email", prefValue, &prefLength); + if (NS_SUCCEEDED(rv) && prefLength > 0) + m_userEmail = PL_strdup(prefValue); + rv = prefs->GetCharPref("mailnews.pop_server", prefValue, &prefLength); if (NS_SUCCEEDED(rv) && prefLength > 0) m_popHost = PL_strdup(prefValue); @@ -85,6 +103,27 @@ void nsMsgIdentity::InitializeIdentity() } } +nsresult nsMsgIdentity::GetOrganization(const char ** aOrganization) +{ + if (aOrganization) + *aOrganization = m_organization; + return NS_OK; +} + +nsresult nsMsgIdentity::GetUserFullName(const char ** aUserFullName) +{ + if (aUserFullName) + *aUserFullName = m_userFullName; + return NS_OK; +} + +nsresult nsMsgIdentity::GetUserEmail(const char ** aUserEmail) +{ + if (aUserEmail) + *aUserEmail = m_userEmail; + return NS_OK; +} + nsresult nsMsgIdentity::GetPopPassword(const char ** aUserPassword) { if (aUserPassword) diff --git a/mozilla/mailnews/base/src/nsMsgIdentity.h b/mozilla/mailnews/base/src/nsMsgIdentity.h index d77aae3b682..db79dab2068 100644 --- a/mozilla/mailnews/base/src/nsMsgIdentity.h +++ b/mozilla/mailnews/base/src/nsMsgIdentity.h @@ -41,12 +41,18 @@ public: // user name, pwd, mail server to use, etc.... ////////////////////////////////////////////////////////////////////////////////// NS_IMETHOD GetRootFolderPath(const char ** aRootFolderPath); + NS_IMETHOD GetOrganization(const char ** aOrganization); + NS_IMETHOD GetUserFullName(const char ** aUserFullName); // User real name + NS_IMETHOD GetUserEmail(const char ** aUserEmail); NS_IMETHOD GetUserName(const char ** aUserName); // right now it is pop & smtp user name NS_IMETHOD GetPopPassword(const char ** aUserPassword); NS_IMETHOD GetPopServer(const char ** aHostName); NS_IMETHOD GetSmtpServer(const char ** aHostName); protected: + char *m_organization; + char *m_userFullName; + char *m_userEmail; char *m_userName; char *m_userPassword; char *m_smtpHost;