summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorHubert Chathi <hubert@uhoreg.ca>2020-09-20 09:31:09 -0400
committerHubert Chathi <hubert@uhoreg.ca>2020-09-20 09:31:09 -0400
commitb5b01680d58e0696202b099fc5bd0757e8359ad5 (patch)
treebd46b2c71c58db0d9b6f7a69deb4736cd60064a0
parentadd function to return client PID and client struct (diff)
return :ok instead of {:ok}
-rw-r--r--lib/mix/tasks/polyjuice/logout.ex2
-rw-r--r--lib/polyjuice/client.ex6
-rw-r--r--lib/polyjuice/client/endpoint/post_logout.ex2
-rw-r--r--lib/polyjuice/client/endpoint/post_rooms_receipt.ex2
-rw-r--r--lib/polyjuice/client/low_level.ex2
-rw-r--r--lib/polyjuice/client/room.ex2
-rw-r--r--test/polyjuice/client/endpoint/post_logout_test.exs2
-rw-r--r--test/polyjuice/client/endpoint/post_rooms_receipt_test.exs2
-rw-r--r--test/polyjuice/client/room_test.exs6
9 files changed, 13 insertions, 13 deletions
diff --git a/lib/mix/tasks/polyjuice/logout.ex b/lib/mix/tasks/polyjuice/logout.ex
index 71f0e4d..fd8263d 100644
--- a/lib/mix/tasks/polyjuice/logout.ex
+++ b/lib/mix/tasks/polyjuice/logout.ex
@@ -71,7 +71,7 @@ defmodule Mix.Tasks.Polyjuice.Logout do
if storage, do: Polyjuice.Client.Storage.close(storage)
case ret do
- {:ok} ->
+ :ok ->
IO.puts("Logout successful.")
_ ->
diff --git a/lib/polyjuice/client.ex b/lib/polyjuice/client.ex
index 618a217..2de32fc 100644
--- a/lib/polyjuice/client.ex
+++ b/lib/polyjuice/client.ex
@@ -626,7 +626,7 @@ defmodule Polyjuice.Client do
@doc """
Log out an existing session.
"""
- @spec log_out(client :: Polyjuice.Client.t()) :: {:ok} | any
+ @spec log_out(client :: Polyjuice.Client.t()) :: :ok | any
def log_out(
%Polyjuice.Client{id: id, pid: pid, opts: %{storage: storage, handler: handler}} = client
) do
@@ -636,7 +636,7 @@ defmodule Polyjuice.Client do
client,
%Polyjuice.Client.Endpoint.PostLogout{}
) do
- {:ok} ->
+ :ok ->
set_logged_out(pid, storage, handler, false)
if storage do
@@ -644,7 +644,7 @@ defmodule Polyjuice.Client do
Polyjuice.Client.Storage.kv_del(storage, "ca.uhoreg.polyjuice", "device_id")
end
- {:ok}
+ :ok
ret ->
ret
diff --git a/lib/polyjuice/client/endpoint/post_logout.ex b/lib/polyjuice/client/endpoint/post_logout.ex
index 95ecafe..4ce6fa7 100644
--- a/lib/polyjuice/client/endpoint/post_logout.ex
+++ b/lib/polyjuice/client/endpoint/post_logout.ex
@@ -39,7 +39,7 @@ defmodule Polyjuice.Client.Endpoint.PostLogout do
defimpl Polyjuice.Client.Endpoint.BodyParser do
def parse(_req, _body) do
- {:ok}
+ :ok
end
end
end
diff --git a/lib/polyjuice/client/endpoint/post_rooms_receipt.ex b/lib/polyjuice/client/endpoint/post_rooms_receipt.ex
index 9ac66d1..48e3d51 100644
--- a/lib/polyjuice/client/endpoint/post_rooms_receipt.ex
+++ b/lib/polyjuice/client/endpoint/post_rooms_receipt.ex
@@ -55,7 +55,7 @@ defmodule Polyjuice.Client.Endpoint.PostRoomsReceipt do
defimpl Polyjuice.Client.Endpoint.BodyParser do
def parse(_req, _body) do
- {:ok}
+ :ok
end
end
end
diff --git a/lib/polyjuice/client/low_level.ex b/lib/polyjuice/client/low_level.ex
index 6e0b656..54acf83 100644
--- a/lib/polyjuice/client/low_level.ex
+++ b/lib/polyjuice/client/low_level.ex
@@ -186,7 +186,7 @@ defmodule Polyjuice.Client.LowLevel do
@doc """
Log out an existing session.
"""
- @spec log_out(client :: Polyjuice.Client.LowLevel.t()) :: {:ok} | any
+ @spec log_out(client :: Polyjuice.Client.LowLevel.t()) :: :ok | any
def log_out(client) do
Polyjuice.Client.API.call(
client,
diff --git a/lib/polyjuice/client/room.ex b/lib/polyjuice/client/room.ex
index db4b71e..af43bb6 100644
--- a/lib/polyjuice/client/room.ex
+++ b/lib/polyjuice/client/room.ex
@@ -149,7 +149,7 @@ defmodule Polyjuice.Client.Room do
room :: String.t(),
event_id :: String.t(),
receipt_type :: String.t()
- ) :: {:ok} | any
+ ) :: :ok | any
def update_read_receipt(client_api, room, event_id, receipt_type \\ "m.read")
when is_binary(room) and is_binary(event_id) and is_binary(receipt_type) do
Polyjuice.Client.API.call(
diff --git a/test/polyjuice/client/endpoint/post_logout_test.exs b/test/polyjuice/client/endpoint/post_logout_test.exs
index 07c8211..7f7835c 100644
--- a/test/polyjuice/client/endpoint/post_logout_test.exs
+++ b/test/polyjuice/client/endpoint/post_logout_test.exs
@@ -36,7 +36,7 @@ defmodule Polyjuice.Client.Endpoint.PostLogoutTest do
200,
[{"Content-Type", "application/json"}],
"{}"
- ) == {:ok}
+ ) == :ok
assert Polyjuice.Client.Endpoint.Proto.transform_http_result(
endpoint,
diff --git a/test/polyjuice/client/endpoint/post_rooms_receipt_test.exs b/test/polyjuice/client/endpoint/post_rooms_receipt_test.exs
index fdb9490..1d126a2 100644
--- a/test/polyjuice/client/endpoint/post_rooms_receipt_test.exs
+++ b/test/polyjuice/client/endpoint/post_rooms_receipt_test.exs
@@ -39,7 +39,7 @@ defmodule Polyjuice.Client.Endpoint.PostRoomsReceiptTest do
200,
[{"Content-Type", "application/json"}],
"{}"
- ) == {:ok}
+ ) == :ok
assert Polyjuice.Client.Endpoint.Proto.transform_http_result(
endpoint,
diff --git a/test/polyjuice/client/room_test.exs b/test/polyjuice/client/room_test.exs
index 6c631e0..b45f607 100644
--- a/test/polyjuice/client/room_test.exs
+++ b/test/polyjuice/client/room_test.exs
@@ -208,11 +208,11 @@ defmodule Polyjuice.Client.RoomTest do
event_id: "$event",
receipt_type: "m.read"
},
- {:ok}
+ :ok
}
} do
- {:ok} = Polyjuice.Client.Room.update_read_receipt(client, "!room", "$event", "m.read")
- {:ok} = Polyjuice.Client.Room.update_read_receipt(client, "!room", "$event")
+ :ok = Polyjuice.Client.Room.update_read_receipt(client, "!room", "$event", "m.read")
+ :ok = Polyjuice.Client.Room.update_read_receipt(client, "!room", "$event")
end
end