diff options
author | Alex Auvolat <alex@adnab.me> | 2018-08-31 22:30:20 +0200 |
---|---|---|
committer | Alex Auvolat <alex@adnab.me> | 2018-08-31 22:30:20 +0200 |
commit | e7e255682a81f4212171051bb59d0fedd0e88d3e (patch) | |
tree | e96430f7a636eca7afcaeb8c82e4686ca13e5908 /lib/cli | |
parent | c83ba74012e38c2fd1c46c063c9c094a78bf9680 (diff) | |
download | shard-e7e255682a81f4212171051bb59d0fedd0e88d3e.tar.gz shard-e7e255682a81f4212171051bb59d0fedd0e88d3e.zip |
Chat using Merkle search tree & block store, not yet 100% complete
Diffstat (limited to 'lib/cli')
-rw-r--r-- | lib/cli/cli.ex | 11 |
1 files changed, 3 insertions, 8 deletions
diff --git a/lib/cli/cli.ex b/lib/cli/cli.ex index 8928040..2fbf8c2 100644 --- a/lib/cli/cli.ex +++ b/lib/cli/cli.ex @@ -64,15 +64,10 @@ defmodule SCLI do end defp handle_command(pid, ["hist"]) do - case GenServer.call(pid, {:read_history, nil, 100}) do - {:ok, list, _rest} -> - list - |> Enum.reverse - |> Enum.each(fn {ts, nick, msg} -> - IO.puts "#{ts |> DateTime.from_unix! |> DateTime.to_iso8601} <#{nick}> #{msg}" + GenServer.call(pid, {:read_history, nil, 25}) + |> Enum.each(fn {{ts, nick, msg}, true} -> + IO.puts "#{ts |> DateTime.from_unix! |> DateTime.to_iso8601} <#{nick}> #{msg}" end) - _ -> nil - end pid end |