From 586c3a243a2dd820445892aafb64fa2d3bb9c7fe Mon Sep 17 00:00:00 2001 From: turtled Date: Sat, 28 Oct 2017 22:07:06 +0800 Subject: [PATCH] Fix retained message is not sent for Subscribe to existing topic --- src/emqttd_session.erl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/emqttd_session.erl b/src/emqttd_session.erl index e8e694530..fa4ba2141 100644 --- a/src/emqttd_session.erl +++ b/src/emqttd_session.erl @@ -394,9 +394,9 @@ handle_cast({subscribe, _From, TopicTable, AckFun}, maps:put(Topic, NewQos, SubMap); error -> emqttd:subscribe(Topic, ClientId, Opts), - emqttd_hooks:run('session.subscribed', [ClientId, Username], {Topic, Opts}), maps:put(Topic, NewQos, SubMap) end, + emqttd_hooks:run('session.subscribed', [ClientId, Username], {Topic, Opts}), {[NewQos|QosAcc], SubMap1} end, {[], Subscriptions}, TopicTable), AckFun(lists:reverse(GrantedQos)),