diff --git a/rebar.config b/rebar.config index f38591955..a80fefe07 100644 --- a/rebar.config +++ b/rebar.config @@ -24,7 +24,7 @@ {fast_tls, ".*", {git, "https://github.com/processone/fast_tls", "afdd07811e0e6eff444c035ffeb2aa9efb4dbe6d"}}, {stringprep, ".*", {git, "https://github.com/processone/stringprep", {tag, "1.0.7"}}}, {fast_xml, ".*", {git, "https://github.com/processone/fast_xml", {tag, "1.1.21"}}}, - {xmpp, ".*", {git, "https://github.com/processone/xmpp", "4aaed37a16fc21be505553aabf9f47a48b8af027"}}, + {xmpp, ".*", {git, "https://github.com/processone/xmpp", "cfb5c11280fdd82f8370d9322bbcb3255b743c76"}}, {stun, ".*", {git, "https://github.com/processone/stun", {tag, "1.0.9"}}}, {esip, ".*", {git, "https://github.com/processone/esip", {tag, "1.0.10"}}}, {fast_yaml, ".*", {git, "https://github.com/processone/fast_yaml", {tag, "1.0.8"}}}, diff --git a/src/translate.erl b/src/translate.erl index 4350fab27..cf59fef5b 100644 --- a/src/translate.erl +++ b/src/translate.erl @@ -43,6 +43,7 @@ start_link() -> gen_server:start_link({local, ?MODULE}, ?MODULE, [], []). init([]) -> + process_flag(trap_exit, true), ets:new(translations, [named_table, public]), Dir = case os:getenv("EJABBERD_MSGS_PATH") of false -> @@ -53,6 +54,7 @@ init([]) -> Path -> Path end, load_dir(iolist_to_binary(Dir)), + xmpp:set_tr_callback({?MODULE, translate}), {ok, #state{}}. handle_call(_Request, _From, State) -> @@ -66,7 +68,7 @@ handle_info(_Info, State) -> {noreply, State}. terminate(_Reason, _State) -> - ok. + xmpp:set_tr_callback(undefined). code_change(_OldVsn, State, _Extra) -> {ok, State}.