25
1
mirror of https://github.com/processone/ejabberd.git synced 2024-11-22 16:20:52 +01:00

Take care of xml:lang attribute in unauthenticated stanzas as well

This commit is contained in:
Evgeniy Khramtsov 2010-11-06 13:58:52 +09:00 committed by Badlop
parent e3afec9465
commit e4a1eb4370

View File

@ -2115,7 +2115,17 @@ resend_subscription_requests(#state{user = UserB,
PendingSubscriptions). PendingSubscriptions).
process_unauthenticated_stanza(StateData, El) when ?IS_IQ(El) -> 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 -> request ->
IQ_Rec = exmpp_iq:xmlel_to_iq(El), IQ_Rec = exmpp_iq:xmlel_to_iq(El),
Res = ejabberd_hooks:run_fold(c2s_unauthenticated_iq, Res = ejabberd_hooks:run_fold(c2s_unauthenticated_iq,