Only cache fully normalized Jids for reverse lookup

This commit is contained in:
fiaxh 2019-12-24 03:14:11 +01:00
parent f58119f25e
commit 33499d076d

View file

@ -502,7 +502,11 @@ public class Database : Qlite.Database {
if (bare_jid != null) { if (bare_jid != null) {
Jid jid_parsed = new Jid(bare_jid); Jid jid_parsed = new Jid(bare_jid);
jid_table_cache[id] = jid_parsed; jid_table_cache[id] = jid_parsed;
jid_table_reverse[jid_parsed] = id;
// Only store fully normalized Jids for reverse lookup
if (jid_parsed.to_string() == bare_jid) {
jid_table_reverse[jid_parsed] = id;
}
return jid_parsed; return jid_parsed;
} }
return null; return null;