Skip to content

Commit

Permalink
Fix Duplicate stanza-id errors flood for MAM
Browse files Browse the repository at this point in the history
Before profanity checked (server-generated) stanza-id for duplication,
but MAM check was missing,
it caused significant false positive error flood.

Fix #1925
  • Loading branch information
H3rnand3zzz committed Nov 11, 2023
1 parent bba8278 commit 44d72e3
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/database.c
Original file line number Diff line number Diff line change
Expand Up @@ -528,7 +528,8 @@ _add_to_db(ProfMessage* message, char* type, const Jid* const from_jid, const Ji

// stanza-id (XEP-0359) doesn't have to be present in the message.
// But if it's duplicated, it's a serious server-side problem, so we better track it.
if (message->stanzaid) {
// Unless it's MAM, in that case it's expected behaviour.
if (message->stanzaid && !message->is_mam) {
auto_sqlite char* duplicate_check_query = sqlite3_mprintf("SELECT 1 FROM `ChatLogs` WHERE (`archive_id` = %Q)",
message->stanzaid);

Expand Down

0 comments on commit 44d72e3

Please sign in to comment.