From 8418be0a5be1a386ccd7aab5df1559c2b0376d88 Mon Sep 17 00:00:00 2001 From: Feng Lee Date: Tue, 7 Aug 2018 11:00:04 +0800 Subject: [PATCH] Use the new emqx_session:unsubscribe/2 API --- src/emqx_protocol.erl | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/emqx_protocol.erl b/src/emqx_protocol.erl index 30b2c0294..85fe35e52 100644 --- a/src/emqx_protocol.erl +++ b/src/emqx_protocol.erl @@ -262,14 +262,14 @@ process({subscribe, RawTopicTable}, process(?UNSUBSCRIBE_PACKET(PacketId, []), State) -> send(?UNSUBACK_PACKET(PacketId), State); -process(?UNSUBSCRIBE_PACKET(PacketId, _Properties, RawTopics), +process(?UNSUBSCRIBE_PACKET(PacketId, Properties, RawTopics), State = #proto_state{client_id = ClientId, username = Username, mountpoint = MountPoint, session = Session}) -> case emqx_hooks:run('client.unsubscribe', [ClientId, Username], parse_topics(RawTopics)) of {ok, TopicTable} -> - emqx_session:unsubscribe(Session, mount(replvar(MountPoint, State), TopicTable)); + emqx_session:unsubscribe(Session, {PacketId, Properties, mount(replvar(MountPoint, State), TopicTable)}); {stop, _} -> ok end, @@ -280,7 +280,7 @@ process({unsubscribe, RawTopics}, State = #proto_state{client_id = ClientId, session = Session}) -> case emqx_hooks:run('client.unsubscribe', [ClientId, Username], parse_topics(RawTopics)) of {ok, TopicTable} -> - emqx_session:unsubscribe(Session, TopicTable); + emqx_session:unsubscribe(Session, {undefined, #{}, TopicTable}); {stop, _} -> ok end, {ok, State};