Skip to content

Commit 486ea07

Browse files
committed
Restore SM data ready for resume
The resume functionality assumes id is in previd and that the full JID is in the sm_state as well.
1 parent a2b3b6b commit 486ea07

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

src/conn.c

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1388,8 +1388,9 @@ int xmpp_conn_restore_sm_state(xmpp_conn_t *conn,
13881388
memset(conn->sm_state, 0, sizeof(*conn->sm_state));
13891389
conn->sm_state->ctx = conn->ctx;
13901390

1391+
conn->sm_state->bound_jid = conn->jid;
13911392
conn->sm_state->sm_support = 1;
1392-
conn->sm_state->sm_enabled = 1;
1393+
conn->sm_state->sm_enabled = 0;
13931394
conn->sm_state->can_resume = 1;
13941395
conn->sm_state->resume = 1;
13951396

@@ -1403,7 +1404,7 @@ int xmpp_conn_restore_sm_state(xmpp_conn_t *conn,
14031404
goto err_reload;
14041405

14051406
size_t id_len;
1406-
ret = sm_load_string(&sm, &conn->sm_state->id, &id_len);
1407+
ret = sm_load_string(&sm, &conn->sm_state->previd, &id_len);
14071408
if (ret)
14081409
goto err_reload;
14091410

0 commit comments

Comments
 (0)