Fix hook args bug

This commit is contained in:
turtled 2018-08-29 20:29:03 +08:00
parent cd7f79ec04
commit 1629215b18
2 changed files with 3 additions and 3 deletions

View File

@ -435,7 +435,7 @@ deliver({connack, ReasonCode, SP}, PState) ->
send(?CONNACK_PACKET(ReasonCode, SP), PState);
deliver({publish, PacketId, Msg}, PState = #pstate{is_bridge = IsBridge, mountpoint = MountPoint}) ->
_ = emqx_hooks:run('message.delivered', credentials(PState), Msg),
_ = emqx_hooks:run('message.delivered', [credentials(PState)], Msg),
Msg1 = emqx_mountpoint:unmount(MountPoint, clean_retain(IsBridge, Msg)),
send(emqx_packet:from_message(PacketId, Msg1), PState);

View File

@ -761,7 +761,7 @@ await(PacketId, Msg, State = #state{inflight = Inflight,
acked(puback, PacketId, State = #state{client_id = ClientId, inflight = Inflight}) ->
case emqx_inflight:lookup(PacketId, Inflight) of
{value, {publish, Msg, _Ts}} ->
{value, {publish, {_, Msg}, _Ts}} ->
emqx_hooks:run('message.acked', [#{client_id =>ClientId}], Msg),
State#state{inflight = emqx_inflight:delete(PacketId, Inflight)};
none ->
@ -771,7 +771,7 @@ acked(puback, PacketId, State = #state{client_id = ClientId, inflight = Infligh
acked(pubrec, PacketId, State = #state{client_id = ClientId, inflight = Inflight}) ->
case emqx_inflight:lookup(PacketId, Inflight) of
{value, {publish, Msg, _Ts}} ->
{value, {publish, {_, Msg}, _Ts}} ->
emqx_hooks:run('message.acked', [ClientId], Msg),
State#state{inflight = emqx_inflight:update(PacketId, {pubrel, PacketId, os:timestamp()}, Inflight)};
{value, {pubrel, PacketId, _Ts}} ->