From 574b572fac144135c4381581351445bf5d0de81c Mon Sep 17 00:00:00 2001 From: Alex Auvolat Date: Fri, 12 Oct 2018 18:16:46 +0200 Subject: Clean up interface to shards --- shardweb/lib/controllers/chat_controller.ex | 2 +- shardweb/lib/controllers/identity_controller.ex | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) (limited to 'shardweb/lib/controllers') diff --git a/shardweb/lib/controllers/chat_controller.ex b/shardweb/lib/controllers/chat_controller.ex index 31b80ba..75f2f18 100644 --- a/shardweb/lib/controllers/chat_controller.ex +++ b/shardweb/lib/controllers/chat_controller.ex @@ -14,7 +14,7 @@ defmodule ShardWeb.ChatController do def privchat(conn, %{"people_list" => people_list}) do known_people = for {_, %SApp.Identity.Manifest{pk: pk}, pid} <- Shard.Manager.list_shards() do - info = GenServer.call(pid, :get_info) + info = SApp.Identity.get_info(pid) {pk, info.nick} end diff --git a/shardweb/lib/controllers/identity_controller.ex b/shardweb/lib/controllers/identity_controller.ex index dd254bb..962a888 100644 --- a/shardweb/lib/controllers/identity_controller.ex +++ b/shardweb/lib/controllers/identity_controller.ex @@ -27,9 +27,9 @@ defmodule ShardWeb.IdentityController do def update(conn, params) do pid = SApp.Identity.find_proc(conn.assigns.pk) - info = GenServer.call(pid, :get_info) + info = SApp.Identity.get_info(pid) info = %{info | nick: params["nick"]} - GenServer.call(pid, {:set_info, info}) + SApp.Identity.set_info(pid, info) redirect conn, to: identity_path(conn, :self) end -- cgit v1.2.3