Comment 21 for bug 85579

Revision history for this message
In , Sspitzer (sspitzer) wrote :

comments:

1) I don't think onlineName is appropriate for local folders. local folders
aren't online. (it makes sense for imap folders, which are actually online).
I see that dbfolderInfo uses "onlineName", so we can't change that. but
perhaps in localmailfolder.cpp, we can come up with a different name.

2)

+ if (NS_SUCCEEDED(rv) && (const char *) onlineName && nsCRT::strlen((const
char *) onlineName))

do use .get() instead of casting.

3)

to be safe, in WriteToFolderCacheElem() and ReadFromFolderCacheElem() you might
want NS_ENSURE_ARG_POINTER(element);

unless the caller checks for null before calling.

4)

+ nsXPIDLCString onlineFullUtf7Name;
+ rv1 = cacheElement->GetStringProperty("onlineName", getter_Copies
(onlineFullUtf7Name));
+ if (NS_SUCCEEDED(rv1) && onlineFullUtf7Name.get() && nsCRT::strlen
(onlineFullUtf7Name.get()))
+ currentFolderNameStr.AssignWithConversion(onlineFullUtf7Name.get());

this code (looks copied from the imap implementation) is misleading. onlineName
is not really a UTF7 string.

some of the string converting that is going on (from CString to String and
back) has me worried for the non ASCII case.

you've made the "onlineName" attribute a string property, like it is for imap.
that works for imap, since the online name is in modified UTF7, which is 7 bit
clean and we convert it later before coming up with the PRUnichar * version of
the name. (note, for dbfolderInfo, it is a PRUnichar * property)

in nsLocalMailFolder.cpp, when the user creates a folder, folderName is a
PRUnichar *, and we convert that to a CString. if I tried to create a non
ASCII local folder name, would would happen?

we might have to take the PRUnichar *, and turn it into escaped UTF8 (which is
7bit clean), store that as the "onlineName" property, and then pulling it out
of the folder cache, turn it back into a PRUnichar *.