From 40ef6d51b2830f215c8a14b412dc25b51494476f Mon Sep 17 00:00:00 2001 From: Ave Date: Fri, 5 Feb 2021 19:15:28 +0100 Subject: matrix-connection: Only change state and progress if we're not already connected (#111) --- matrix-connection.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/matrix-connection.c b/matrix-connection.c index 1b071db..9d1bac6 100644 --- a/matrix-connection.c +++ b/matrix-connection.c @@ -122,8 +122,11 @@ static void _sync_complete(MatrixConnectionData *ma, gpointer user_data, return; } - purple_connection_update_progress(pc, _("Connected"), 2, 3); - purple_connection_set_state(pc, PURPLE_CONNECTED); + // Only update progress and set state if we're not already connected + if (purple_connection_get_state(pc) != PURPLE_CONNECTED) { + purple_connection_update_progress(pc, _("Connected"), 2, 3); + purple_connection_set_state(pc, PURPLE_CONNECTED); + } matrix_sync_parse(pc, body, &next_batch); -- cgit