From d744d772887b113fe3eda3144ee87a8ac1e64db4 Mon Sep 17 00:00:00 2001 From: Tim Stewart Date: Tue, 21 Oct 2014 12:42:39 -0400 Subject: [PATCH] Remove unnecessary `Host' parameter --- mod_post_log/src/mod_post_log.erl | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/mod_post_log/src/mod_post_log.erl b/mod_post_log/src/mod_post_log.erl index c28def2..3f79ca9 100644 --- a/mod_post_log/src/mod_post_log.erl +++ b/mod_post_log/src/mod_post_log.erl @@ -37,34 +37,34 @@ stop(Host) -> ok. log_user_send(From, To, Packet) -> - ok = log_packet(From, To, Packet, From#jid.lserver). + ok = log_packet(From, To, Packet). -log_packet(From, To, {xmlelement, "message", _Attrs, _Els} = Packet, Host) -> - ok = log_message(From, To, Packet, Host); +log_packet(From, To, {xmlelement, "message", _Attrs, _Els} = Packet) -> + ok = log_message(From, To, Packet); -log_packet(_From, _To, {xmlelement, _Name, _Attrs, _Els}, _Host) -> +log_packet(_From, _To, {xmlelement, _Name, _Attrs, _Els}) -> ok. -log_message(From, To, {xmlelement, _Name, Attrs, _Els} = Packet, Host) -> +log_message(From, To, {xmlelement, _Name, Attrs, _Els} = Packet) -> Type = lists:keyfind("type", 1, Attrs), - log_message_filter(Type, From, To, Packet, Host). + log_message_filter(Type, From, To, Packet). -log_message_filter({"type", Type}, From, To, Packet, Host) +log_message_filter({"type", Type}, From, To, Packet) when Type =:= "chat"; Type =:= "groupchat" -> - log_chat(From, To, Packet, Host); -log_message_filter(_Other, _From, _To, _Packet, _Host) -> + log_chat(From, To, Packet); +log_message_filter(_Other, _From, _To, _Packet) -> ok. -log_chat(From, To, {xmlelement, _Name, _Attrs, Els} = Packet, Host) -> +log_chat(From, To, {xmlelement, _Name, _Attrs, Els} = Packet) -> case get_body(Els) of no_body -> ok; {ok, _Body} -> - log_chat_with_body(From, To, Packet, Host) + log_chat_with_body(From, To, Packet) end. -log_chat_with_body(_From, _To, Packet, _Host) -> +log_chat_with_body(_From, _To, Packet) -> post_xml(xml:element_to_binary(Packet)). post_xml(Xml) ->