Summary: | TplLogStore implementation for logs retrieved from GMail | ||
---|---|---|---|
Product: | Telepathy | Reporter: | Will Thompson <will> |
Component: | logger | Assignee: | Telepathy bugs list <telepathy-bugs> |
Status: | RESOLVED MOVED | QA Contact: | Telepathy bugs list <telepathy-bugs> |
Severity: | normal | ||
Priority: | medium | ||
Version: | git master | ||
Hardware: | Other | ||
OS: | All | ||
See Also: | https://bugs.freedesktop.org/show_bug.cgi?id=23844 | ||
Whiteboard: | |||
i915 platform: | i915 features: | ||
Bug Depends on: | 55394 | ||
Bug Blocks: | |||
Attachments: | you may want to use a patch like this to test this code |
Description
Will Thompson
2012-10-04 17:04:01 UTC
(In reply to comment #0) > The branch is still not quite finished: it doesn't implement > _tpl_log_store_search_new(), or the new walker API. It now does implement search_new (but still not the walker API). I think I'm done with this for a little while. An interesting refactoring might be to split TplLogStoreGtalkMimeReader in two: one part which turns a GMimeMessage into a GInputStream for its text/xml part, and another one which feeds GInputStreams through the TplLogStoreGtalkReader (the WockyXmppReader subclass for <conversation xmlns=google:conversation> blobs). This might make it easier to test code in isolation, rather than having to bundle everything up in mbox files, and would make the code better prepared to accept messages via some other path or email library. Given a GInputStream for a conversation, there could be a _pop() method which does: while ((stanza = wocky_xmpp_reader_pop_stanza()) == NULL) { read some input; if there's no more input, break; else, feed it to the reader; } which would reduce unnecessary parsing of entire conversations (for instance, right now figuring out MUC JIDs involves parsing the entire <conversation>, then just looking at the first <message> within it). I haven't profiled this stuff on actual full-size logs so I don't know if it's necessary. I imagine it's really slow, but… I've implemented TplLogIter. It's basically a generalization of get_filtered_events() so I refactored things and now get_filtered_events() just uses create_iter(). I think this refactoring may make sense for all stores, not just this one? Anyway, as this branch stands, merging it would be harmless (modulo the hard dependency on wocky dependency) but useless (because it doesn't know where any of your logs are, it never returns anything). I cooked up a little patch to hard code the path to my own logs, and it works okay—although it's incredibly slow (you can watch the debug output to see it constantly re-scanning the mbox). Created attachment 68580 [details] [review] you may want to use a patch like this to test this code If you want to build this code, you'll need to check out and build Wocky from http://cgit.freedesktop.org/wocky (to $WOCKY_SRCDIR, say) and then run: PKG_CONFIG_PATH=$WOCKY_SRCDIR/wocky/ ./autogen.sh so that the logger branch picks up your uninstalled copy of Wocky. (Or you could install it, I guess.) -- GitLab Migration Automatic Message -- This bug has been migrated to freedesktop.org's GitLab instance and has been closed from further activity. You can subscribe and participate further through the new bug through this link to our GitLab instance: https://gitlab.freedesktop.org/telepathy/telepathy-logger/issues/32. |
Use of freedesktop.org services, including Bugzilla, is subject to our Code of Conduct. How we collect and use information is described in our Privacy Policy.