aboutsummaryrefslogtreecommitdiffstats
path: root/matrix-api.c
diff options
context:
space:
mode:
authorRichard van der Hoff <richard@matrix.org>2015-10-27 09:56:52 +0000
committerRichard van der Hoff <richard@matrix.org>2015-10-27 09:56:52 +0000
commitc69bd547bbdf96470786d4e23b40641a7526942a (patch)
tree5f7495407c252b91b257da91f709424f6d32d3f5 /matrix-api.c
parente2500a76ee35cb3be863342573495a28f47c5eb8 (diff)
downloadpurple-matrix-c69bd547bbdf96470786d4e23b40641a7526942a.tar.gz
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.
Diffstat (limited to 'matrix-api.c')
-rw-r--r--matrix-api.c9
1 files changed, 6 insertions, 3 deletions
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