From c69bd547bbdf96470786d4e23b40641a7526942a Mon Sep 17 00:00:00 2001 From: Richard van der Hoff Date: Tue, 27 Oct 2015 09:56:52 +0000 Subject: Request a full_state sync the first time we connect to an account. This requires the new full_state support from https://github.com/matrix-org/synapse/pull/332. It's much cleaner than trying to request the state the first time we hear about a room. --- matrix-api.c | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) (limited to 'matrix-api.c') diff --git a/matrix-api.c b/matrix-api.c index 590c22c..944bbfe 100644 --- a/matrix-api.c +++ b/matrix-api.c @@ -464,7 +464,7 @@ MatrixApiRequestData *matrix_api_password_login(MatrixConnectionData *conn, MatrixApiRequestData *matrix_api_sync(MatrixConnectionData *conn, - const gchar *since, int timeout, + const gchar *since, int timeout, gboolean full_state, MatrixApiCallback callback, MatrixApiErrorCallback error_callback, MatrixApiBadResponseCallback bad_response_callback, @@ -482,8 +482,11 @@ MatrixApiRequestData *matrix_api_sync(MatrixConnectionData *conn, if(since != NULL) g_string_append_printf(url, "&since=%s", purple_url_encode(since)); - purple_debug_info("matrixprpl", "syncing %s since %s\n", - conn->pc->account->username, since); + if(full_state) + g_string_append(url, "&full_state=true"); + + purple_debug_info("matrixprpl", "syncing %s since %s (full_state=%i)\n", + conn->pc->account->username, since, full_state); /* XXX: stream the response, so that we don't need to allocate so much * memory? But it's JSON -- cgit