mirror of
https://github.com/processone/ejabberd.git
synced 2024-12-24 17:29:28 +01:00
Use xml:lang from stanza when it's missing in <command/> element
Thanks to Philipp Hörist for spotting this
This commit is contained in:
parent
9f3ccd604e
commit
2e007f1607
@ -215,10 +215,10 @@ process_adhoc_request(#iq{from = From, to = To,
|
||||
Res = case Type of
|
||||
local ->
|
||||
ejabberd_hooks:run_fold(adhoc_local_commands, Host, empty,
|
||||
[From, To, SubEl]);
|
||||
[From, To, fix_lang(Lang, SubEl)]);
|
||||
sm ->
|
||||
ejabberd_hooks:run_fold(adhoc_sm_commands, Host, empty,
|
||||
[From, To, SubEl])
|
||||
[From, To, fix_lang(Lang, SubEl)])
|
||||
end,
|
||||
case Res of
|
||||
ignore ->
|
||||
@ -266,6 +266,11 @@ ping_command(_Acc, _From, _To,
|
||||
end;
|
||||
ping_command(Acc, _From, _To, _Request) -> Acc.
|
||||
|
||||
fix_lang(Lang, #adhoc_command{lang = <<>>} = Cmd) ->
|
||||
Cmd#adhoc_command{lang = Lang};
|
||||
fix_lang(_, Cmd) ->
|
||||
Cmd.
|
||||
|
||||
depends(_Host, _Opts) ->
|
||||
[].
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user