Fix retained message is not sent for Subscribe to existing topic

This commit is contained in:
turtled 2017-10-28 22:07:06 +08:00
parent c87c49ede0
commit 586c3a243a
1 changed files with 1 additions and 1 deletions

View File

@ -394,9 +394,9 @@ handle_cast({subscribe, _From, TopicTable, AckFun},
maps:put(Topic, NewQos, SubMap); maps:put(Topic, NewQos, SubMap);
error -> error ->
emqttd:subscribe(Topic, ClientId, Opts), emqttd:subscribe(Topic, ClientId, Opts),
emqttd_hooks:run('session.subscribed', [ClientId, Username], {Topic, Opts}),
maps:put(Topic, NewQos, SubMap) maps:put(Topic, NewQos, SubMap)
end, end,
emqttd_hooks:run('session.subscribed', [ClientId, Username], {Topic, Opts}),
{[NewQos|QosAcc], SubMap1} {[NewQos|QosAcc], SubMap1}
end, {[], Subscriptions}, TopicTable), end, {[], Subscriptions}, TopicTable),
AckFun(lists:reverse(GrantedQos)), AckFun(lists:reverse(GrantedQos)),