Navigation Menu

Skip to content

Commit

Permalink
Added invalid utf8 check for incoming msgs
Browse files Browse the repository at this point in the history
Conflicts:
	src/xmpp_callbacks.ml
  • Loading branch information
user@ocamldev authored and hannesm committed Dec 21, 2014
1 parent 501d10a commit 5cf47e6
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/xmpp_callbacks.ml
Expand Up @@ -39,8 +39,12 @@ let message_callback (t : user_data session_data) stanza =
let user = t.user_data.find_or_create jid in
let session = t.user_data.find_or_create_session user resource in
let msg dir enc txt =
let txt = try match Zed_utf8.validate txt
with _ -> txt
with Invalid (err_msg,escaped_msg) -> err_msg ^ ": " ^ escaped_message
in
let user = match t.user_data.find jid with Some x -> x | None -> assert false in
t.user_data.message user dir enc txt
t.user_data.message user dir enc true txt ;
in
match stanza.content.body with
| None -> return_unit
Expand Down

0 comments on commit 5cf47e6

Please sign in to comment.