From 03d43132bc9c550e20aee189301d293934c6fcfa Mon Sep 17 00:00:00 2001 From: Steffen Jaeckel Date: Tue, 9 Apr 2024 16:45:09 +0200 Subject: [PATCH] Fix SM in case the user drops the first stanza We have to reset the `r_sent` flag in case we drop the `` stanza, otherwise the SM `h` request mechanism stops working. Signed-off-by: Steffen Jaeckel --- src/conn.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/conn.c b/src/conn.c index 217e8db..5abc23a 100644 --- a/src/conn.c +++ b/src/conn.c @@ -1481,8 +1481,11 @@ char *xmpp_conn_send_queue_drop_element(xmpp_conn_t *conn, /* In case there exists a SM stanza that is linked to the * one we're currently dropping, also delete that one. */ - if (t->next && t->next->userdata == t) + if (t->next && t->next->userdata == t) { strophe_free(conn->ctx, _drop_send_queue_element(conn, t->next)); + /* reset the flag, so we restart to send `` stanzas */ + conn->sm_state->r_sent = 0; + } /* Finally drop the element */ return _drop_send_queue_element(conn, t); }