about summary refs log tree commit diff stats
path: root/tests
diff options
context:
space:
mode:
authorMichael Vetter <jubalh@iodoru.org>2020-07-23 15:19:13 +0200
committerMichael Vetter <jubalh@iodoru.org>2020-07-23 15:23:18 +0200
commitc9b154b1a24bd3e96142ae826851538f2ef725d7 (patch)
treeca2a4acc6aa9442e22b039e9dbc84b63494c3f41 /tests
parent8852db03d623f1920814fc8ff2c822a6353dd6e3 (diff)
downloadprofani-tty-c9b154b1a24bd3e96142ae826851538f2ef725d7.tar.gz
database: Only insert if there is no entry with same archive_id
archive_is is <stanza-id> or <result id=""> and should identify one
message stable and uniquely.

See XEP-0359: Unique and Stable Stanza IDs.

We need this for example for this situation:
* we go online with Profanity
* we fetch all messages since yesterday
* we add them to the db
* we go offline
* we go online with Profanity
* we fetch all messages since yesterday
* we only want to add the new ones

So far we don't ask MAM "give me all since last 'id'" but since a
certain date.

In case no archive_id will be set, it will be `(null)` and thus should
be inserted anyways because it won't find a value with (null) in that
row.

Because when adding we use `message->stanzaid ? message->stanzaid : "",`
so it will be empty in such a case.

Regards MAM: https://github.com/profanity-im/profanity/issues/660
Regards Stable IDs: https://github.com/profanity-im/profanity/issues/1207
Diffstat (limited to 'tests')
0 files changed, 0 insertions, 0 deletions