aboutsummaryrefslogtreecommitdiff
path: root/shard/lib/app/identity.ex
diff options
context:
space:
mode:
Diffstat (limited to 'shard/lib/app/identity.ex')
-rw-r--r--shard/lib/app/identity.ex19
1 files changed, 8 insertions, 11 deletions
diff --git a/shard/lib/app/identity.ex b/shard/lib/app/identity.ex
index 6909ad3..d2748a1 100644
--- a/shard/lib/app/identity.ex
+++ b/shard/lib/app/identity.ex
@@ -50,20 +50,17 @@ defmodule SApp.Identity do
def find_proc(pk) do
manifest = %Manifest{pk: pk}
id = SData.term_hash manifest
- Shard.Manager.find_proc id
+ case Shard.Manager.find_proc id do
+ nil ->
+ Shard.Manifest.start manifest
+ pid -> pid
+ end
end
def get_nick(pk) do
- case find_proc pk do
- nil ->
- if Shard.Keys.valid_identity_pk? pk do
- Shard.Manifest.start %Manifest{pk: pk}
- end
- default_nick pk
- pid ->
- info = GenServer.call(pid, :get_info)
- info.nick
- end
+ pid = find_proc pk
+ info = GenServer.call(pid, :get_info)
+ info.nick
end
def handle_call(:manifest, _from, state) do