Thanks for the guidance, Patrick.
On Sunday 20 January 2013 13:36:39 Patrick Ohly wrote:
I think both activesyncd and libeasclient should continue to just
accept
the folder ID, because it is unambiguous. The folder name is not.
Ah. I had assumed that the Folder ID was transient and could change (for
example, as a result of other folders being created/removed).
However, reading the description of FolderSync carefully (e.g.
http://msdn.microsoft.com/en-us/library/gg650851%28v=exchg.80%29.aspx) does
suggest that the Folder ID does not change. For example, that page says:
"The ServerId element is used to identify folders that have been updated..."
So ServerId identifies the object, rather than being an attribute of the
object which is being reported.
That said, what should the user experience for SyncEvolution be if they set up
a sync with a Folder called (say) "Friends", which they later renamed on the
server as "School Friends" and created a new folder called "Friends"?
Probably not worth worrying about -- just allowing them to specify a folder by
name instead of Id would be an improvement!
The place to implement some more user-friendly behavior is in the
SyncEvolution backend. Have a look at EvolutionSyncSource::findSource()
and how that backend implements getDatabases(). Note that findSource()
could (should?) be improved to detect ambiguities, for example a name
matching two different sources, and then throwing an error. Currently it
just picks the first one it finds.
I will look at it.
In the ActiveSync backend getDatabases() is just a stub. It should
use
the "get_folders" method. I don't remember why we didn't do that -
perhaps because the setup code in Evolution was doing the entire
configuration.
I will look at that as well.