From 4f6483c8954d62708975e272ce2d8eac4f49026f Mon Sep 17 00:00:00 2001 From: "alecf%netscape.com" Date: Fri, 17 Sep 1999 06:43:27 +0000 Subject: [PATCH] make the signature an nsIFileSpec for right now --- mailnews/base/public/nsIMsgIdentity.idl | 5 +++- mailnews/base/util/nsMsgIdentity.cpp | 33 ++++++++++++++++++++++++- 2 files changed, 36 insertions(+), 2 deletions(-) diff --git a/mailnews/base/public/nsIMsgIdentity.idl b/mailnews/base/public/nsIMsgIdentity.idl index eb5c8797b1d..094560f0f34 100644 --- a/mailnews/base/public/nsIMsgIdentity.idl +++ b/mailnews/base/public/nsIMsgIdentity.idl @@ -18,6 +18,7 @@ #include "nsISupports.idl" #include "nsIMsgSignature.idl" +#include "nsIFileSpec.idl" #include "nsIMsgVCard.idl" /* @@ -63,7 +64,9 @@ interface nsIMsgIdentity : nsISupports { attribute boolean attachVCard; /* the current signature */ - attribute nsIMsgSignature signature; + attribute nsIFileSpec signature; + /* after PR1, let's make this a real object */ + /* attribute nsIMsgSignature signature; */ /* the current vcard */ attribute nsIMsgVCard vCard; diff --git a/mailnews/base/util/nsMsgIdentity.cpp b/mailnews/base/util/nsMsgIdentity.cpp index e8212a3d2ba..ea0c5836ed4 100644 --- a/mailnews/base/util/nsMsgIdentity.cpp +++ b/mailnews/base/util/nsMsgIdentity.cpp @@ -319,7 +319,38 @@ nsMsgIdentity::ToString(PRUnichar **aResult) /* Identity attribute accessors */ // XXX - these are a COM objects, use NS_ADDREF -NS_IMPL_GETSET(nsMsgIdentity, Signature, nsIMsgSignature*, m_signature); +//NS_IMPL_GETSET(nsMsgIdentity, Signature, nsIMsgSignature*, m_signature); +NS_IMETHODIMP +nsMsgIdentity::GetSignature(nsIFileSpec **sig) { + nsresult rv = getPrefService(); + if (NS_FAILED(rv)) return rv; + + char *prefName = getPrefName(m_identityKey, "sig_file"); + return m_prefs->GetFilePref(prefName, sig); +} + +NS_IMETHODIMP +nsMsgIdentity::SetSignature(nsIFileSpec *sig) +{ + + nsresult rv = getPrefService(); + if (NS_FAILED(rv)) return rv; + + rv = NS_OK; + char *prefName = getPrefName(m_identityKey, "sig_file"); + if (sig) + rv = m_prefs->SetFilePref(NS_CONST_CAST(const char*,prefName), sig, + PR_FALSE); + /* + else + m_prefs->ClearFilePref(prefName); + */ + PR_Free(prefName); + return rv; + + return NS_OK; +} + NS_IMPL_GETSET(nsMsgIdentity, VCard, nsIMsgVCard*, m_vCard); NS_IMPL_GETTER_STR(nsMsgIdentity::GetKey, m_identityKey);