From f5b4131160520a2540445619188c3c8e0f37da37 Mon Sep 17 00:00:00 2001 From: Alex Auvolat Date: Fri, 12 Oct 2018 16:38:11 +0200 Subject: Notifications for chat ; useless user info page --- shardweb/lib/controllers/identity_controller.ex | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) (limited to 'shardweb/lib/controllers') diff --git a/shardweb/lib/controllers/identity_controller.ex b/shardweb/lib/controllers/identity_controller.ex index 3c04fe8..dd254bb 100644 --- a/shardweb/lib/controllers/identity_controller.ex +++ b/shardweb/lib/controllers/identity_controller.ex @@ -10,7 +10,19 @@ defmodule ShardWeb.IdentityController do end def view(conn, %{"pk" => pk}) do - #TODO + {:ok, pk} = Base.decode16(pk) + shard = %SApp.Identity.Manifest{pk: pk} |> SData.term_hash + pid = Shard.Manager.find_proc shard + + if pid == nil do + render conn, ShardWeb.ErrorView, "404.html" + else + render conn, "view.html", + view_pk: pk, + view_nick: SApp.Identity.get_nick(pk), + shard: shard, + pid: pid + end end def update(conn, params) do -- cgit v1.2.3