GNOME Bugzilla – Bug 322540
Backend to index Gajim logs
Last modified: 2010-03-18 18:03:11 UTC
Here is a first stab at a backend to index the logs of the Gajim instant messenger.
Created attachment 55263 [details] [review] first attempt
The gaim backend is undergoing some major changes (improvements) in bug# 321087. This patch is probably based on the Gaim backend. Any improvements to Gaim backend might be helpful to the Gajim backend (e.g. there will be no separate gaimcrawler class).
Created attachment 55273 [details] [review] revised patch I have removed the GajimCrawler class and made a few other cleanups.
Looks mostly ok, but what is the log filename format? Does it append to one continuous log per person, or does it start a new log every time a conversation is opened (like gaim), or what?
It's one continuous log per person, stored at ~/.gajim/logs/(jid). A jid is a Jabber user id, it looks like an email address: <user@example.com>. Lines in the log file are in the following format: (timestamp):(sent|recv):(message) Timestamp is seconds since the epoch, to two decimal places. The other user's jid I get from the filename. The user's own jid is not stored in the log file, so I just used Environment.UserName.
A side comment, maybe the user's own jid is stored in gajim's conf file ? IMO, using the login name for gajim account name would be wrong information. Just curious, what if one signs in as two different accounts ? Is it possible to distinguish the log files, if separate log files are created at all ?
The problem with logging continuously to one file per-jid is that that file will get very big over time. Every time someone says something in a conversation, the whole conversation log will be reindexed, which might span a very long time period. This is very expensive. We haven't got the infrastructure in place to handle this effectively just yet. Ideally we need to seek to the point where last indexing completed and just index from there.
Good idea about getting the user's jid from the config file. Other information, such as the user's roster, is only accessible via dbus while Gajim is running. This might all be moot anyway since it seems <http://trac.gajim.org/ticket/647> that in the devlopment version of Gajim's, the logging infrastructure has been rewritten to use sqlite. I'm not sure how to handle this in Beagle, or even if it's possible to do it in a sensible way. The Gajim backend could add its own beagle_last_indexed_log_entry = (jid, timestamp) table to the database...
A link to the discussion in Gajim bugzilla: http://trac.gajim.org/ticket/647
Is there a chance for Gajim filter to be an official part of Beagle?
(In reply to comment #10) > Is there a chance for Gajim filter to be an official part of Beagle? If someone writes one, then yes. As per comment#8, gajim has moved to sqlite bases storage which makes the currently attached patch invalid.
This bug is old. I no longer use either gajim or beagle and want it off my bug list. :)