diff options
-rw-r--r-- | shard/lib/app/chat.ex | 6 | ||||
-rw-r--r-- | shard/lib/app/directory.ex | 6 | ||||
-rw-r--r-- | shard/lib/app/identity.ex | 4 | ||||
-rw-r--r-- | shardweb/lib/views/directory_view.ex | 2 |
4 files changed, 13 insertions, 5 deletions
diff --git a/shard/lib/app/chat.ex b/shard/lib/app/chat.ex index 4c7fc00..2a3872b 100644 --- a/shard/lib/app/chat.ex +++ b/shard/lib/app/chat.ex @@ -67,6 +67,10 @@ defmodule SApp.Chat do # MAIN LOGIC # ========== + defmodule State do + defstruct [:id, :netgroup, :manifest, :page_store, :mst, :subs, :read] + end + @doc """ Start a process that connects to a given channel """ @@ -104,7 +108,7 @@ defmodule SApp.Chat do root: root} SNet.Group.init_lookup(netgroup, self()) {:ok, - %{id: id, + %State{id: id, netgroup: netgroup, manifest: manifest, page_store: page_store, diff --git a/shard/lib/app/directory.ex b/shard/lib/app/directory.ex index 55413c4..a15de21 100644 --- a/shard/lib/app/directory.ex +++ b/shard/lib/app/directory.ex @@ -22,6 +22,10 @@ defmodule SApp.Directory do end end + defmodule State do + defstruct [:owner, :public, :name, :manifest, :id, :netgroup, :files, :revfiles] + end + def start_link(manifest) do GenServer.start_link(__MODULE__, manifest) end @@ -44,7 +48,7 @@ defmodule SApp.Directory do revfiles = for {n, m} <- SData.SignRev.get(files), into: %{}, do: {m, n} - {:ok, %{ + {:ok, %State{ owner: owner, public: public, name: name, manifest: manifest, id: id, netgroup: netgroup, files: files, revfiles: revfiles}} diff --git a/shard/lib/app/identity.ex b/shard/lib/app/identity.ex index 65e7031..468906f 100644 --- a/shard/lib/app/identity.ex +++ b/shard/lib/app/identity.ex @@ -31,7 +31,7 @@ defmodule SApp.Identity do end defmodule State do - defstruct [:info, :rev, :signed] + defstruct [:pk, :id, :state, :netgroup] end def start_link(manifest) do @@ -55,7 +55,7 @@ defmodule SApp.Identity do if Shard.Keys.have_sk? pk do GenServer.cast(self(), :update_peer_info) end - {:ok, %{pk: pk, id: id, state: state, netgroup: netgroup}} + {:ok, %State{pk: pk, id: id, state: state, netgroup: netgroup}} end def handle_call(:manifest, _from, state) do diff --git a/shardweb/lib/views/directory_view.ex b/shardweb/lib/views/directory_view.ex index 9ebdd3b..acbd950 100644 --- a/shardweb/lib/views/directory_view.ex +++ b/shardweb/lib/views/directory_view.ex @@ -1,7 +1,7 @@ defmodule ShardWeb.DirectoryView do use ShardWeb, :view - def dir_contents(conn, manifest) do + def dir_contents(_conn, manifest) do IO.puts(inspect manifest) pid = Shard.Manager.find_or_start manifest SApp.Directory.get_files pid |