summaryrefslogtreecommitdiff
path: root/lib/polyjuice/client/sync.ex
diff options
context:
space:
mode:
Diffstat (limited to 'lib/polyjuice/client/sync.ex')
-rw-r--r--lib/polyjuice/client/sync.ex11
1 files changed, 7 insertions, 4 deletions
diff --git a/lib/polyjuice/client/sync.ex b/lib/polyjuice/client/sync.ex
index 47f9555..d56099b 100644
--- a/lib/polyjuice/client/sync.ex
+++ b/lib/polyjuice/client/sync.ex
@@ -40,7 +40,8 @@ defmodule Polyjuice.Client.Sync do
query_params: "",
backoff: nil,
set_filter: nil,
- initial_done: false
+ initial_done: false,
+ test: false
]
@sync_path "_matrix/client/r0/sync"
@@ -53,7 +54,8 @@ defmodule Polyjuice.Client.Sync do
access_token: access_token,
base_url: homeserver_url,
user_id: user_id,
- storage: storage
+ storage: storage,
+ test: test
},
listener,
opts
@@ -108,7 +110,8 @@ defmodule Polyjuice.Client.Sync do
query_params: query_params,
storage: storage,
since: Polyjuice.Client.Storage.get_sync_token(storage),
- set_filter: set_filter
+ set_filter: set_filter,
+ test: test
})
end
@@ -162,7 +165,7 @@ defmodule Polyjuice.Client.Sync do
case :hackney.send_request(
state.conn_ref,
- {:post, path, headers, Jason.encode!(state.set_filter)}
+ {if(state.test, do: :put, else: :post), path, headers, Jason.encode!(state.set_filter)}
) do
{:ok, status_code, _resp_headers, client_ref} ->
case status_code do