From 512255d98b0d999af820edeab7afb237447bbc38 Mon Sep 17 00:00:00 2001 From: Holger Weiss Date: Tue, 8 Mar 2016 00:38:34 +0100 Subject: [PATCH] Update mod_log_chat to work with ejabberd 16.02 --- mod_log_chat/src/mod_log_chat.erl | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/mod_log_chat/src/mod_log_chat.erl b/mod_log_chat/src/mod_log_chat.erl index 57ab8b3..3c18c31 100644 --- a/mod_log_chat/src/mod_log_chat.erl +++ b/mod_log_chat/src/mod_log_chat.erl @@ -89,12 +89,12 @@ log_packet_receive(Packet, _C2SState, _JID, From, To) -> Packet. log_packet(From, To, Packet = #xmlel{name = <<"message">>, attrs = Attrs}, Host) -> - case xml:get_attr_s(<<"type">>, Attrs) of + case fxml:get_attr_s(<<"type">>, Attrs) of <<"groupchat">> -> %% mod_muc_log already does it - ?DEBUG("dropping groupchat: ~s", [xml:element_to_binary(Packet)]), + ?DEBUG("dropping groupchat: ~s", [fxml:element_to_binary(Packet)]), ok; <<"error">> -> %% we don't log errors - ?DEBUG("dropping error: ~s", [xml:element_to_binary(Packet)]), + ?DEBUG("dropping error: ~s", [fxml:element_to_binary(Packet)]), ok; _ -> write_packet(From, To, Packet, Host) @@ -109,13 +109,13 @@ write_packet(From, To, Packet, Host) -> Result end, Format = Config#config.format, - {Subject, Body} = {case xml:get_subtag(Packet, <<"subject">>) of + {Subject, Body} = {case fxml:get_subtag(Packet, <<"subject">>) of false -> ""; SubjEl -> - escape(Format, xml:get_tag_cdata(SubjEl)) + escape(Format, fxml:get_tag_cdata(SubjEl)) end, - escape(Format, xml:get_path_s(Packet, [{elem, <<"body">>}, cdata]))}, + escape(Format, fxml:get_path_s(Packet, [{elem, <<"body">>}, cdata]))}, case Subject == [] andalso Body == [] of true -> %% don't log empty messages ?DEBUG("not logging empty message from ~s",[jlib:jid_to_string(From)]),