diff options
Diffstat (limited to 'shardweb/lib/views')
-rw-r--r-- | shardweb/lib/views/directory_view.ex | 9 | ||||
-rw-r--r-- | shardweb/lib/views/identity_view.ex | 5 |
2 files changed, 14 insertions, 0 deletions
diff --git a/shardweb/lib/views/directory_view.ex b/shardweb/lib/views/directory_view.ex new file mode 100644 index 0000000..9ebdd3b --- /dev/null +++ b/shardweb/lib/views/directory_view.ex @@ -0,0 +1,9 @@ +defmodule ShardWeb.DirectoryView do + use ShardWeb, :view + + def dir_contents(conn, manifest) do + IO.puts(inspect manifest) + pid = Shard.Manager.find_or_start manifest + SApp.Directory.get_files pid + end +end diff --git a/shardweb/lib/views/identity_view.ex b/shardweb/lib/views/identity_view.ex index 1844ce8..86423b2 100644 --- a/shardweb/lib/views/identity_view.ex +++ b/shardweb/lib/views/identity_view.ex @@ -18,4 +18,9 @@ defmodule ShardWeb.IdentityView do end end) end + + def is_friend(conn, pk) do + fd = SApp.Directory.friends_dir(conn.assigns.pk) + SApp.Directory.find(fd, %SApp.Identity.Manifest{pk: pk}) != nil + end end |