On Fri, 2009-06-19 at 12:22 +0200, Filipe Nepomuceno wrote:
> Hey all,
> 
> I'm currently making a plugin for evolution as a final year project
> that gets all the messages and contacts from evolution and then displays
> them as a mind-map.
> 
> The (major) problem I'm having is getting a list of ALL the e-mails in
> ALL the folders. From the plugins and documentation that I've read I can
> get a list of a single folder provided it is in the plugins context i.e.
> you right click on the folder and launch the plugin.
> 
> Is what I'm trying to do possible and if so could someone please point
> me in the right direction?
> 
> Regards,
> Filipe

        Hi,
you can do that in your event by couple of steps:
a) obtain list of all configured accounts with mail_config_get_accounts
b) for all enabled accounts ask for the CamelStore with mail_get_store
c) for each CamelStore ask for a folder info with call of
   mail_get_folderinfo , where you'll receive a folder hierarchy
   for all the folders in the given store
d) then for each folder info ask for a CamelFolder with
   mail_get_folder
e) and finally for messages in a returned folder.

Just take care of not calling camel functions in a main thread. Those
mail_* functions from the above take care of it itself, as they are
async, but I guess the e) will be pure camel call(s) for you.

You can do the same also by only-camel-calls in one thread, except
of a), just mimic working parts of those mentioned functions above.
        Hope that helps,
        Milan

_______________________________________________
Evolution-hackers mailing list
Evolution-hackers@gnome.org
http://mail.gnome.org/mailman/listinfo/evolution-hackers

Reply via email to