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
parent 7f3a5066c6
commit 1f16e4783c

View File

@ -2139,7 +2139,17 @@ get_statustag(Presence) ->
end.
process_unauthenticated_stanza(StateData, El) ->
case jlib:iq_query_info(El) of
NewEl = case xml:get_tag_attr_s("xml:lang", El) of
"" ->
case StateData#state.lang of
"" -> El;
Lang ->
xml:replace_tag_attr("xml:lang", Lang, El)
end;
_ ->
El
end,
case jlib:iq_query_info(NewEl) of
#iq{} = IQ ->
Res = ejabberd_hooks:run_fold(c2s_unauthenticated_iq,
StateData#state.server,