aboutsummaryrefslogtreecommitdiff
path: root/shard/lib/cli/cli.ex
diff options
context:
space:
mode:
Diffstat (limited to 'shard/lib/cli/cli.ex')
-rw-r--r--shard/lib/cli/cli.ex10
1 files changed, 5 insertions, 5 deletions
diff --git a/shard/lib/cli/cli.ex b/shard/lib/cli/cli.ex
index 2fbf8c2..c3afe8f 100644
--- a/shard/lib/cli/cli.ex
+++ b/shard/lib/cli/cli.ex
@@ -14,7 +14,7 @@ defmodule SCLI do
prompt = case pid do
nil -> "(no channel) #{nick}: "
_ ->
- {:chat, chan} = GenServer.call(pid, :manifest)
+ %SApp.Chat.Manifest{channel: chan} = GenServer.call(pid, :manifest)
"##{chan} #{nick}: "
end
@@ -56,8 +56,8 @@ defmodule SCLI do
defp handle_command(pid, ["list"]) do
IO.puts "List of known channels:"
- for {_chid, manifest, _chpid} <- :ets.tab2list(:shard_db) do
- {:chat, chan} = manifest
+ for {_chid, manifest, _chpid} <- Shard.Manager.list_shards do
+ %SApp.Chat.Manifest{channel: chan} = manifest
IO.puts "##{chan}"
end
pid
@@ -72,8 +72,8 @@ defmodule SCLI do
end
defp handle_command(_pid, ["join", qchan]) do
- list = for {_chid, manifest, chpid} <- :ets.tab2list(:shard_db),
- {:chat, chan} = manifest,
+ list = for {_chid, manifest, chpid} <- Shard.Manager.list_shards,
+ %SApp.Chat.Manifest{channel: chan} = manifest,
do: {chan, chpid}
case List.keyfind(list, qchan, 0) do
nil ->