@@ -95,7 +95,7 @@ log_packet_offline({_Action, Msg} = Acc) ->
95
95
% % Internal functions.
96
96
% % -------------------------------------------------------------------
97
97
-spec log_packet (direction (), message ()) -> any ().
98
- log_packet (Direction , # message {type = Type } = Msg ) ->
98
+ log_packet (Direction , # message {type = Type , body = Body , id = Id , from = From , to = To } = Msg ) ->
99
99
case should_log (Msg ) of
100
100
true ->
101
101
{Type1 , Direction1 } = case is_carbon (Msg ) of
@@ -107,7 +107,14 @@ log_packet(Direction, #message{type = Type} = Msg) ->
107
107
% Proc = gen_mod:get_module_proc(global, ?MODULE),
108
108
% gen_server:cast(Proc, {message, Direction1, From, To, Type1, Msg});
109
109
Date = format_date (calendar :local_time ()),
110
- ? INFO_MSG (" log_packet: ~s ~s ~s " , [Date , Direction1 , Type1 ]);
110
+ if Direction1 == 'outgoing' ->
111
+ # jid {lserver = LServer } = From ;
112
+ true ->
113
+ # jid {lserver = LServer } = To
114
+ end ,
115
+ Url = gen_mod :get_module_opt (LServer , ? MODULE , url , fun (S ) -> iolist_to_binary (S ) end , false ),
116
+ ? INFO_MSG (" log_packet: Url ~s Date ~s Direction ~s Type ~s Message ~s ID ~s From ~s To ~s " ,
117
+ [Url , Date , Direction1 , Type1 , xmpp :get_text (Body ), binary_to_list (Id ), jid :encode (From ), jid :encode (To )]);
111
118
false ->
112
119
ok
113
120
end .
0 commit comments