re-read jids table from DB when another instance of Gajim added a jid in it. Fixes #3349

This commit is contained in:
Yann Leboulanger 2007-08-20 11:13:53 +00:00
parent 00c7e7712a
commit c524ec78f1
1 changed files with 7 additions and 1 deletions

View File

@ -181,7 +181,13 @@ class Logger:
typ = constants.JID_ROOM_TYPE
else:
typ = constants.JID_NORMAL_TYPE
self.cur.execute('INSERT INTO jids (jid, type) VALUES (?, ?)', (jid, typ))
try:
self.cur.execute('INSERT INTO jids (jid, type) VALUES (?, ?)', (jid,
typ))
except sqlite.IntegrityError, e:
# Jid already in DB, maybe added by another instance. re-read DB
self.get_jids_already_in_db()
return self.get_jid_id(jid, typestr)
try:
self.con.commit()
except sqlite.OperationalError, e: