@@ -133,14 +133,19 @@ log_packet(Direction, #message{type = Type, body = Body, id = Id, from = From, t
133
133
" &message=" , http_uri :encode (MessageVal )
134
134
], " "
135
135
),
136
- {ok , _ReqId } = httpc :request (post ,
137
- {Url , [], " application/x-www-form-urlencoded" , PostData },
138
- [],
139
- [ {sync , false },
140
- {receiver , {? MODULE , post_result , []}}
141
- | [] ]),
142
- ? INFO_MSG (" log_packet: Url ~s Date ~s Direction ~s Type ~s Message ~s ID ~s From ~s To ~s " ,
143
- [Url , DateVal , DirectionVal , TypeVal , MessageVal , IdVal , FromVal , ToVal ]);
136
+ if Type1 == chat ->
137
+ {ok , _ReqId } = httpc :request (post ,
138
+ {Url , [], " application/x-www-form-urlencoded" , PostData },
139
+ [],
140
+ [ {sync , false },
141
+ {receiver , {? MODULE , post_result , []}}
142
+ | [] ]),
143
+ ? INFO_MSG (" request: Url ~s Date ~s Direction ~s Type ~s Message ~s ID ~s From ~s To ~s " ,
144
+ [Url , DateVal , DirectionVal , TypeVal , MessageVal , IdVal , FromVal , ToVal ]);
145
+ true ->
146
+ ? INFO_MSG (" log: Date ~s Direction ~s Type ~s Message ~s ID ~s From ~s To ~s " ,
147
+ [DateVal , DirectionVal , TypeVal , MessageVal , IdVal , FromVal , ToVal ])
148
+ end ;
144
149
false ->
145
150
ok
146
151
end .
0 commit comments