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 ->
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) ->
[].