From e4a1eb437088255e6da13fa924fec61f7f7da9cd Mon Sep 17 00:00:00 2001 From: Evgeniy Khramtsov Date: Sat, 6 Nov 2010 13:58:52 +0900 Subject: [PATCH] Take care of xml:lang attribute in unauthenticated stanzas as well --- src/ejabberd_c2s.erl | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/src/ejabberd_c2s.erl b/src/ejabberd_c2s.erl index 383823ace..b894a59e8 100644 --- a/src/ejabberd_c2s.erl +++ b/src/ejabberd_c2s.erl @@ -2115,7 +2115,17 @@ resend_subscription_requests(#state{user = UserB, PendingSubscriptions). process_unauthenticated_stanza(StateData, El) when ?IS_IQ(El) -> - case exmpp_iq:get_kind(El) of + NewEl = case exmpp_stream:get_lang(El) of + undefined -> + case StateData#state.lang of + undefined -> El; + Lang -> + exmpp_stanza:set_lang(El, Lang) + end; + _ -> + El + end, + case exmpp_iq:get_kind(NewEl) of request -> IQ_Rec = exmpp_iq:xmlel_to_iq(El), Res = ejabberd_hooks:run_fold(c2s_unauthenticated_iq,