From 53769f8e57df8cfe3df118fa052ca9a128bc9599 Mon Sep 17 00:00:00 2001 From: Hubert Chathi Date: Mon, 15 Jun 2020 23:19:24 -0400 Subject: fix calls to send --- lib/polyjuice/client/sync.ex | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) (limited to 'lib') diff --git a/lib/polyjuice/client/sync.ex b/lib/polyjuice/client/sync.ex index 77e66b6..3f82b7d 100644 --- a/lib/polyjuice/client/sync.ex +++ b/lib/polyjuice/client/sync.ex @@ -122,7 +122,7 @@ defmodule Polyjuice.Client.Sync do ) do {:ok, conn_ref} -> Logger.info("Connected to sync") - state.send({:connected}) + state.send.({:connected}) if state.set_filter do set_filter(%{state | conn_ref: conn_ref, backoff: nil}) @@ -203,7 +203,7 @@ defmodule Polyjuice.Client.Sync do backoff = calc_backoff(state.backoff) Logger.error("Set filter error: closed; retrying in #{backoff} seconds.") connect(%{state | backoff: backoff, conn_ref: nil}) - state.send({:disconnected}) + state.send.({:disconnected}) # FIXME: what other error codes do we need to handle? {:error, err} -> @@ -240,7 +240,7 @@ defmodule Polyjuice.Client.Sync do Polyjuice.Client.Storage.set_sync_token(state.storage, next_batch) if not state.initial_done do - state.send({:initial_sync_completed}) + state.send.({:initial_sync_completed}) end do_sync(%{state | since: next_batch, backoff: nil, initial_done: true}) @@ -267,7 +267,7 @@ defmodule Polyjuice.Client.Sync do backoff = calc_backoff(state.backoff) Logger.error("Sync error: closed; retrying in #{backoff} seconds.") connect(%{state | backoff: backoff, conn_ref: nil}) - state.send({:disconnected}) + state.send.({:disconnected}) # FIXME: what other error codes do we need to handle? {:error, err} -> @@ -293,7 +293,7 @@ defmodule Polyjuice.Client.Sync do |> Map.get("leave", []) |> Enum.each(fn {k, v} -> process_room(k, v, state) - state.send({:left, k}) + state.send.({:left, k}) end) end @@ -302,7 +302,7 @@ defmodule Polyjuice.Client.Sync do if Map.get(timeline, "limited", false) do with {:ok, prev_batch} <- Map.get(timeline, "prev_batch") do - state.send({:limited, roomname, prev_batch}) + state.send.({:limited, roomname, prev_batch}) end end @@ -323,7 +323,7 @@ defmodule Polyjuice.Client.Sync do roomname, state ) do - state.send({:state, roomname, event}) + state.send.({:state, roomname, event}) state end @@ -333,7 +333,7 @@ defmodule Polyjuice.Client.Sync do roomname, state ) do - state.send({:message, roomname, event}) + state.send.({:message, roomname, event}) state end @@ -370,7 +370,7 @@ defmodule Polyjuice.Client.Sync do |> Map.get("sender") if inviter do - state.send({:invite, roomname, inviter, invite_state}) + state.send.({:invite, roomname, inviter, invite_state}) end state -- cgit v1.2.3