diff options
Diffstat (limited to 'lib/polyjuice/client')
-rw-r--r-- | lib/polyjuice/client/endpoint.ex | 2 | ||||
-rw-r--r-- | lib/polyjuice/client/endpoint/get_rooms_messages.ex | 2 | ||||
-rw-r--r-- | lib/polyjuice/client/endpoint/get_sync.ex | 2 | ||||
-rw-r--r-- | lib/polyjuice/client/endpoint/post_join.ex | 2 | ||||
-rw-r--r-- | lib/polyjuice/client/endpoint/post_login.ex | 2 | ||||
-rw-r--r-- | lib/polyjuice/client/endpoint/post_user_filter.ex | 2 | ||||
-rw-r--r-- | lib/polyjuice/client/endpoint/put_rooms_send.ex | 2 | ||||
-rw-r--r-- | lib/polyjuice/client/endpoint/put_rooms_state.ex | 2 | ||||
-rw-r--r-- | lib/polyjuice/client/sync.ex | 6 |
9 files changed, 11 insertions, 11 deletions
diff --git a/lib/polyjuice/client/endpoint.ex b/lib/polyjuice/client/endpoint.ex index a328ea9..b75ee6c 100644 --- a/lib/polyjuice/client/endpoint.ex +++ b/lib/polyjuice/client/endpoint.ex @@ -88,7 +88,7 @@ defmodule Polyjuice.Client.Endpoint do def parse_response(%{} = endpoint_args, status_code, headers, body) when is_integer(status_code) and is_list(headers) and is_binary(body) do # FIXME: check if content type is "application/json" - with {:ok, json} <- Poison.decode(body) do + with {:ok, json} <- Jason.decode(body) do case status_code do 200 -> Polyjuice.Client.Endpoint.BodyParser.parse(endpoint_args, json) diff --git a/lib/polyjuice/client/endpoint/get_rooms_messages.ex b/lib/polyjuice/client/endpoint/get_rooms_messages.ex index 3a5d2df..542fa62 100644 --- a/lib/polyjuice/client/endpoint/get_rooms_messages.ex +++ b/lib/polyjuice/client/endpoint/get_rooms_messages.ex @@ -56,7 +56,7 @@ defmodule Polyjuice.Client.Endpoint.GetRoomsMessages do ], if(req.to, do: [{"to", req.to}], else: []), if(req.limit, do: [{"limit", req.limit}], else: []), - if(req.filter, do: [{"filter", Poison.encode!(req.filter)}], else: []) + if(req.filter, do: [{"filter", Jason.encode!(req.filter)}], else: []) ] |> Enum.concat() |> URI.encode_query() diff --git a/lib/polyjuice/client/endpoint/get_sync.ex b/lib/polyjuice/client/endpoint/get_sync.ex index 511fb21..42477a6 100644 --- a/lib/polyjuice/client/endpoint/get_sync.ex +++ b/lib/polyjuice/client/endpoint/get_sync.ex @@ -54,7 +54,7 @@ defmodule Polyjuice.Client.Endpoint.GetSync do if(since, do: [{"since", since}], else: []), if(full_state, do: [{"full_state", "true"}], else: []), case filter do - %{} -> [{"filter", Poison.encode!(filter)}] + %{} -> [{"filter", Jason.encode!(filter)}] nil -> [] _ -> [{"filter", filter}] end, diff --git a/lib/polyjuice/client/endpoint/post_join.ex b/lib/polyjuice/client/endpoint/post_join.ex index 6689f59..00d3669 100644 --- a/lib/polyjuice/client/endpoint/post_join.ex +++ b/lib/polyjuice/client/endpoint/post_join.ex @@ -44,7 +44,7 @@ defmodule Polyjuice.Client.Endpoint.PostJoin do e = &URI.encode_www_form/1 body = - Poison.encode!( + Jason.encode!( if third_party_signed do %{"third_party_signed" => third_party_signed} else diff --git a/lib/polyjuice/client/endpoint/post_login.ex b/lib/polyjuice/client/endpoint/post_login.ex index 23fa5c3..ce093f0 100644 --- a/lib/polyjuice/client/endpoint/post_login.ex +++ b/lib/polyjuice/client/endpoint/post_login.ex @@ -65,7 +65,7 @@ defmodule Polyjuice.Client.Endpoint.PostLogin do ] |> Enum.concat() |> Map.new() - |> Poison.encode!() + |> Jason.encode!() %Polyjuice.Client.Endpoint.HttpSpec{ method: :post, diff --git a/lib/polyjuice/client/endpoint/post_user_filter.ex b/lib/polyjuice/client/endpoint/post_user_filter.ex index cf57437..ceab001 100644 --- a/lib/polyjuice/client/endpoint/post_user_filter.ex +++ b/lib/polyjuice/client/endpoint/post_user_filter.ex @@ -39,7 +39,7 @@ defmodule Polyjuice.Client.Endpoint.PostUserFilter do base_url ) do e = &URI.encode_www_form/1 - body = Poison.encode!(filter) + body = Jason.encode!(filter) %Polyjuice.Client.Endpoint.HttpSpec{ method: :post, diff --git a/lib/polyjuice/client/endpoint/put_rooms_send.ex b/lib/polyjuice/client/endpoint/put_rooms_send.ex index 549bc2b..855f346 100644 --- a/lib/polyjuice/client/endpoint/put_rooms_send.ex +++ b/lib/polyjuice/client/endpoint/put_rooms_send.ex @@ -45,7 +45,7 @@ defmodule Polyjuice.Client.Endpoint.PutRoomsSend do base_url ) do e = &URI.encode_www_form/1 - body = Poison.encode!(message) + body = Jason.encode!(message) %Polyjuice.Client.Endpoint.HttpSpec{ method: :put, diff --git a/lib/polyjuice/client/endpoint/put_rooms_state.ex b/lib/polyjuice/client/endpoint/put_rooms_state.ex index 51e9d64..74407bf 100644 --- a/lib/polyjuice/client/endpoint/put_rooms_state.ex +++ b/lib/polyjuice/client/endpoint/put_rooms_state.ex @@ -45,7 +45,7 @@ defmodule Polyjuice.Client.Endpoint.PutRoomsState do base_url ) do e = &URI.encode_www_form/1 - body = Poison.encode!(content) + body = Jason.encode!(content) %Polyjuice.Client.Endpoint.HttpSpec{ method: :put, diff --git a/lib/polyjuice/client/sync.ex b/lib/polyjuice/client/sync.ex index 3f82b7d..67b83fd 100644 --- a/lib/polyjuice/client/sync.ex +++ b/lib/polyjuice/client/sync.ex @@ -159,14 +159,14 @@ defmodule Polyjuice.Client.Sync do case :hackney.send_request( state.conn_ref, - {:post, path, headers, Poison.encode!(state.set_filter)} + {:post, path, headers, Jason.encode!(state.set_filter)} ) do {:ok, status_code, _resp_headers, client_ref} -> case status_code do 200 -> {:ok, body} = :hackney.body(client_ref) - with {:ok, %{} = json_body} <- Poison.decode(body), + with {:ok, %{} = json_body} <- Jason.decode(body), filter_id = Map.get(json_body, "filter_id") do Logger.debug("got filter id #{filter_id}") @@ -233,7 +233,7 @@ defmodule Polyjuice.Client.Sync do 200 -> {:ok, body} = :hackney.body(client_ref) - with {:ok, json_body} <- Poison.decode(body), + with {:ok, json_body} <- Jason.decode(body), %{"next_batch" => next_batch} <- json_body do if state.backoff, do: Logger.info("Sync resumed") process_body(json_body, state) |