Gajim doesn't store information in history about which user's account received/sent a message
Gajim does not save in logs any information about the account that sent or received a message.
Every row in
logs table in the history database contains only information about recipient's or sender's JID, but information about the account that was used to send or receive this message is effectively lost.
Since JIDs in
jids table are unique and can belong to multiple accounts the only information that can be retrieved using
roster_entry table is "to which accounts does this particular JID belong right now?".
Store id of the account (account_jid_id) for every row in