add client_connected/3
This commit is contained in:
parent
7193bf4f20
commit
166e085fff
|
@ -52,7 +52,9 @@ client_connected(?CONNACK_ACCEPT, #mqtt_client{client_id = ClientId,
|
||||||
#state{topics = Topics, stored = Stored}) ->
|
#state{topics = Topics, stored = Stored}) ->
|
||||||
Replace = fun(Topic) -> rep(<<"$u">>, Username, rep(<<"$c">>, ClientId, Topic)) end,
|
Replace = fun(Topic) -> rep(<<"$u">>, Username, rep(<<"$c">>, ClientId, Topic)) end,
|
||||||
TopicTable = with_stored(Stored, ClientId, [{Replace(Topic), Qos} || {Topic, Qos} <- Topics]),
|
TopicTable = with_stored(Stored, ClientId, [{Replace(Topic), Qos} || {Topic, Qos} <- Topics]),
|
||||||
emqttd_client:subscribe(ClientPid, TopicTable).
|
emqttd_client:subscribe(ClientPid, TopicTable);
|
||||||
|
|
||||||
|
client_connected(_ConnAck, _Client, _State) -> ok.
|
||||||
|
|
||||||
with_stored(false, _ClientId, TopicTable) ->
|
with_stored(false, _ClientId, TopicTable) ->
|
||||||
TopicTable;
|
TopicTable;
|
||||||
|
|
Loading…
Reference in New Issue