This commit is contained in:
Feng Lee 2015-05-26 14:50:45 +08:00
parent 07b9cfa722
commit b524cf7806
2 changed files with 4 additions and 3 deletions

View File

@ -257,7 +257,8 @@ inc(_) ->
notify(disconnected, _Reason, undefined) -> ingore;
notify(disconnected, {shutdown, Reason}, ProtoState) ->
emqttd_event:notify({disconnected, emqttd_protocol:clientid(ProtoState), [{reason, Reason}]});
emqttd_event:notify({disconnected, emqttd_protocol:clientid(ProtoState), Reason});
notify(disconnected, Reason, ProtoState) ->
emqttd_event:notify({disconnected, emqttd_protocol:clientid(ProtoState), [{reason, Reason}]}).
emqttd_event:notify({disconnected, emqttd_protocol:clientid(ProtoState), Reason}).

View File

@ -73,7 +73,7 @@ handle_event({connected, ClientId, Params}, State = #state{systop = SysTop}) ->
emqttd_pubsub:publish(event, Msg),
{ok, State};
handle_event({disconnectd, ClientId, Reason}, State = #state{systop = SysTop}) ->
handle_event({disconnected, ClientId, Reason}, State = #state{systop = SysTop}) ->
Topic = <<SysTop/binary, "clients/", ClientId/binary, "/disconnected">>,
Msg = #mqtt_message{topic = Topic, payload = payload(disconnected, Reason)},
emqttd_pubsub:publish(event, Msg),