aboutsummaryrefslogtreecommitdiff
path: root/shard/lib/app/chat.ex
diff options
context:
space:
mode:
Diffstat (limited to 'shard/lib/app/chat.ex')
-rw-r--r--shard/lib/app/chat.ex14
1 files changed, 7 insertions, 7 deletions
diff --git a/shard/lib/app/chat.ex b/shard/lib/app/chat.ex
index f874e86..35ecdbf 100644
--- a/shard/lib/app/chat.ex
+++ b/shard/lib/app/chat.ex
@@ -74,8 +74,14 @@ defmodule SApp.Chat do
case Shard.Manager.register(id, manifest, self()) do
:ok ->
+ netgroup = case manifest do
+ %Manifest{channel: _channel} ->
+ %SNet.PubShardGroup{id: id}
+ %PrivChat.Manifest{pk_list: pk_list} ->
+ %SNet.PrivGroup{pk_list: pk_list}
+ end
Shard.Manager.dispatch_to(id, nil, self())
- {:ok, page_store} = SApp.PageStore.start_link(id, :page_store)
+ {:ok, page_store} = SApp.PageStore.start_link(id, :page_store, netgroup)
root = Shard.Manager.load_state id
root = cond do
root == nil -> nil
@@ -87,12 +93,6 @@ defmodule SApp.Chat do
mst = %MST{store: %SApp.PageStore{pid: page_store},
cmp: &msg_cmp/2,
root: root}
- netgroup = case manifest do
- %Manifest{channel: _channel} ->
- %SNet.PubShardGroup{id: id}
- %PrivChat.Manifest{pk_list: pk_list} ->
- %SNet.PrivGroup{pk_list: pk_list}
- end
SNet.Group.init_lookup(netgroup, self())
{:ok,
%{id: id,