TplLogStore implementation for logs retrieved from GMail
@wjt
Submitted by Will Thompson Assigned to Telepathy bugs list
Description
I've been working on a TplLogStore implementation which reads mbox files containing logs retrieved from Google (cf. https://bugzilla.gnome.org/show_bug.cgi?id=594062).
The branch is still not quite finished: it doesn't implement _tpl_log_store_search_new(), or the new walker API. Also, it's read-only, and wildly inefficient (it re-parses your mail store whenever you call a method on it, basically). But in case anyone is interested, it's sitting at http://cgit.collabora.com/git/user/wjt/telepathy-logger/log/?h=gtalk. The branch looks massive, I accept, but it's under 1500 lines of code, with 700 lines of tests.
I am explicitly not solving the problem of how to get the logs from the server onto your local machine. The implementation has a method, _tpl_log_store_gtalk_add_account_mbox(), to map a TpAccount to the path to an mbox file containing the chat logs. The test suite points it at a little mbox file I compiled from my own Google Mail chat logs. The real logger does not, so as it stands it is totally non-functional.
I see a few possible approaches to that problem:
• Add code to guess where the user keeps their IMAP cache, supporting a few popular email clients. Doesn't work for people who only use the GMail web interface for mail, but use Empathy for IM. Also, doesn't scale. • Require people to configure Evolution for their Google account (via GOA?) and rely on eds syncing their mail in the background. • Put an IMAP client into the logger, reusing the OAuth 2 token.
Not entirely orthogonally, relying on the entire log being on the disk introduces lag. It might be better to keep a cache on disk, but also ask the server for more logs when something asks the logger for them. (This would probably need new application-facing API; unless it folds into the newfangled log walker.)
Version: git master