core (memory/sqla), plugin XEP-0359: always add origin-id, and store:

`origin-id` is now always added to messages, and it is stored to database in the new
column instead of `extra` when present.
This commit is contained in:
Goffi 2022-06-17 14:15:23 +02:00
commit bb3e7ffa9b

View file

@ -564,6 +564,8 @@ class Storage:
or limit != 1):
raise ValueError("Unexpected values for last_stanza_id filter")
stmt = stmt.where(History.stanza_id.is_not(None))
if 'origin_id' in filters:
stmt = stmt.where(History.origin_id == filters["origin_id"])
if limit is not None:
stmt = stmt.limit(limit)
@ -596,6 +598,7 @@ class Storage:
async with session.begin():
session.add(History(
uid=data["uid"],
origin_id=data["extra"].get("origin_id"),
stanza_id=data["extra"].get("stanza_id"),
update_uid=data["extra"].get("update_uid"),
profile_id=self.profiles[profile],