Use the new emqx_session:unsubscribe/2 API
This commit is contained in:
parent
645c971a07
commit
8418be0a5b
|
@ -262,14 +262,14 @@ process({subscribe, RawTopicTable},
|
||||||
process(?UNSUBSCRIBE_PACKET(PacketId, []), State) ->
|
process(?UNSUBSCRIBE_PACKET(PacketId, []), State) ->
|
||||||
send(?UNSUBACK_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,
|
State = #proto_state{client_id = ClientId,
|
||||||
username = Username,
|
username = Username,
|
||||||
mountpoint = MountPoint,
|
mountpoint = MountPoint,
|
||||||
session = Session}) ->
|
session = Session}) ->
|
||||||
case emqx_hooks:run('client.unsubscribe', [ClientId, Username], parse_topics(RawTopics)) of
|
case emqx_hooks:run('client.unsubscribe', [ClientId, Username], parse_topics(RawTopics)) of
|
||||||
{ok, TopicTable} ->
|
{ok, TopicTable} ->
|
||||||
emqx_session:unsubscribe(Session, mount(replvar(MountPoint, State), TopicTable));
|
emqx_session:unsubscribe(Session, {PacketId, Properties, mount(replvar(MountPoint, State), TopicTable)});
|
||||||
{stop, _} ->
|
{stop, _} ->
|
||||||
ok
|
ok
|
||||||
end,
|
end,
|
||||||
|
@ -280,7 +280,7 @@ process({unsubscribe, RawTopics}, State = #proto_state{client_id = ClientId,
|
||||||
session = Session}) ->
|
session = Session}) ->
|
||||||
case emqx_hooks:run('client.unsubscribe', [ClientId, Username], parse_topics(RawTopics)) of
|
case emqx_hooks:run('client.unsubscribe', [ClientId, Username], parse_topics(RawTopics)) of
|
||||||
{ok, TopicTable} ->
|
{ok, TopicTable} ->
|
||||||
emqx_session:unsubscribe(Session, TopicTable);
|
emqx_session:unsubscribe(Session, {undefined, #{}, TopicTable});
|
||||||
{stop, _} -> ok
|
{stop, _} -> ok
|
||||||
end,
|
end,
|
||||||
{ok, State};
|
{ok, State};
|
||||||
|
|
Loading…
Reference in New Issue