Update mod_log_chat to work with ejabberd 15.06

This commit is contained in:
Holger Weiss 2015-06-25 21:38:43 +02:00
parent 1b726e3d9c
commit 81d926142d
1 changed files with 10 additions and 8 deletions

View File

@ -13,8 +13,8 @@
-export([start/2,
init/1,
stop/1,
log_packet_send/3,
log_packet_receive/4]).
log_packet_send/4,
log_packet_receive/5]).
-define(LAGER, 1).
@ -75,13 +75,15 @@ stop(Host) ->
gen_mod:get_module_proc(Host, ?PROCNAME) ! stop,
ok.
log_packet_send(From, To, Packet) ->
log_packet(From, To, Packet, From#jid.lserver).
log_packet_send(Packet, _C2SState, From, To) ->
log_packet(From, To, Packet, From#jid.lserver),
Packet.
log_packet_receive(_JID, From, To, _Packet) when From#jid.lserver == To#jid.lserver->
ok; % only log at send time if the message is local to the server
log_packet_receive(_JID, From, To, Packet) ->
log_packet(From, To, Packet, To#jid.lserver).
log_packet_receive(Packet, _C2SState, _JID, From, To) when From#jid.lserver == To#jid.lserver->
Packet; % only log at send time if the message is local to the server
log_packet_receive(Packet, _C2SState, _JID, From, To) ->
log_packet(From, To, Packet, To#jid.lserver),
Packet.
log_packet(From, To, Packet = #xmlel{name = <<"message">>, attrs = Attrs}, Host) ->
case xml:get_attr_s(<<"type">>, Attrs) of