aboutsummaryrefslogtreecommitdiff
path: root/shardweb/lib/views
diff options
context:
space:
mode:
Diffstat (limited to 'shardweb/lib/views')
-rw-r--r--shardweb/lib/views/layout_view.ex8
1 files changed, 4 insertions, 4 deletions
diff --git a/shardweb/lib/views/layout_view.ex b/shardweb/lib/views/layout_view.ex
index 990df55..d554804 100644
--- a/shardweb/lib/views/layout_view.ex
+++ b/shardweb/lib/views/layout_view.ex
@@ -26,7 +26,7 @@ defmodule ShardWeb.LayoutView do
end
def chat_shard_last_msg(pid) do
- [{{_, msgbin, _}, true}] = GenServer.call(pid, {:read_history, nil, 1})
+ [{{_, msgbin, _}, true}] = SApp.Chat.read_history(pid, nil, 1)
{_, msg} = SData.term_unbin msgbin
msg
end
@@ -34,14 +34,14 @@ defmodule ShardWeb.LayoutView do
def privchat_with_unread(conn) do
for {id, %SApp.Chat.PrivChat.Manifest{pk_list: pk_list}, pid} <- shard_list(),
conn.assigns.pk in pk_list,
- unread_time = GenServer.call(pid, :has_unread),
+ unread_time = SApp.Chat.has_unread?(pid),
unread_time != nil,
do: {id, %SApp.Chat.PrivChat.Manifest{pk_list: pk_list}, pid}
end
- def chat_with_unread(conn) do
+ def chat_with_unread(_conn) do
for {id, %SApp.Chat.Manifest{channel: c}, pid} <- shard_list(),
- unread_time = GenServer.call(pid, :has_unread),
+ unread_time = SApp.Chat.has_unread?(pid),
unread_time != nil,
do: {id, %SApp.Chat.Manifest{channel: c}, pid}
end