aboutsummaryrefslogtreecommitdiff
path: root/shardweb/lib/channels
diff options
context:
space:
mode:
Diffstat (limited to 'shardweb/lib/channels')
-rw-r--r--shardweb/lib/channels/chat_channel.ex3
1 files changed, 3 insertions, 0 deletions
diff --git a/shardweb/lib/channels/chat_channel.ex b/shardweb/lib/channels/chat_channel.ex
index f898602..a413be1 100644
--- a/shardweb/lib/channels/chat_channel.ex
+++ b/shardweb/lib/channels/chat_channel.ex
@@ -47,6 +47,7 @@ defmodule ShardWeb.ChatChannel do
message: msg,
})
end)
+ GenServer.cast(socket.assigns.pid, :mark_read)
{:noreply, socket}
end
@@ -57,10 +58,12 @@ defmodule ShardWeb.ChatChannel do
push socket, "shout", %{"name" => nick,
"pk16" => Shard.Keys.pk_display(pk),
"message" => msg}
+ GenServer.cast(socket.assigns.pid, :mark_read)
{:noreply, socket}
end
def handle_info({:chat_send, _, _}, socket) do
+ GenServer.cast(socket.assigns.pid, :mark_read)
{:noreply, socket}
end