diff options
Diffstat (limited to 'lib/polyjuice')
-rw-r--r-- | lib/polyjuice/client.ex | 10 | ||||
-rw-r--r-- | lib/polyjuice/client/sync.ex | 8 |
2 files changed, 9 insertions, 9 deletions
diff --git a/lib/polyjuice/client.ex b/lib/polyjuice/client.ex index f950dc1..c6a9282 100644 --- a/lib/polyjuice/client.ex +++ b/lib/polyjuice/client.ex @@ -27,7 +27,8 @@ defmodule Polyjuice.Client do defstruct [ :base_url, :access_token, - :user_id + :user_id, + :storage ] @doc "The r0 client URL prefix" @@ -62,10 +63,9 @@ defmodule Polyjuice.Client do @spec sync_child_spec( client_api :: Polyjuice.Client.API.t(), listener :: pid() | fun(), - storage :: Polyjuice.Client.Storage.Proto.t(), opts :: list() ) :: map() - def sync_child_spec(client_api, listener, storage, opts \\ []) + def sync_child_spec(client_api, listener, opts \\ []) end defimpl Polyjuice.Client.API do @@ -106,8 +106,8 @@ defmodule Polyjuice.Client do "#{Node.self()}_#{:erlang.system_time(:millisecond)}_#{:erlang.unique_integer()}" end - def sync_child_spec(client, listener, storage, opts \\ []) do - Polyjuice.Client.Sync.child_spec([client, listener, storage | opts]) + def sync_child_spec(client, listener, opts \\ []) do + Polyjuice.Client.Sync.child_spec([client, listener | opts]) end end diff --git a/lib/polyjuice/client/sync.ex b/lib/polyjuice/client/sync.ex index 6d49f2b..b97ea02 100644 --- a/lib/polyjuice/client/sync.ex +++ b/lib/polyjuice/client/sync.ex @@ -22,9 +22,9 @@ defmodule Polyjuice.Client.Sync do Start a sync task. """ @spec start_link([...]) :: {:ok, pid} - def start_link([client, listener, storage | opts]) + def start_link([client, listener | opts]) when is_pid(listener) and is_list(opts) do - Task.start_link(__MODULE__, :sync, [client, listener, storage, opts]) + Task.start_link(__MODULE__, :sync, [client, listener, opts]) end @enforce_keys [:listener, :access_token, :homeserver_url, :uri, :user_id, :storage] @@ -51,10 +51,10 @@ defmodule Polyjuice.Client.Sync do %Polyjuice.Client{ access_token: access_token, base_url: homeserver_url, - user_id: user_id + user_id: user_id, + storage: storage }, listener, - storage, opts ) do # Figure out how to handle the filter (if any): can we pass it in straight |