Added opt module for mod_push_offline

This commit is contained in:
Mujtaba Roohani 2022-10-10 16:26:11 +05:00
parent af928e35cb
commit 10ffbc08df
2 changed files with 10 additions and 1 deletions

View File

@ -106,7 +106,7 @@ notify(#jid{lserver = LServer} = To, Pkt) ->
UnWrappedPkt = unwrap_message(Pkt), UnWrappedPkt = unwrap_message(Pkt),
DelayedPkt = add_delay_info(UnWrappedPkt, LServer, undefined), DelayedPkt = add_delay_info(UnWrappedPkt, LServer, undefined),
Id = p1_rand:get_string(), Id = p1_rand:get_string(),
PushServer = mod_push_modified_opt:host(LServer), PushServer = mod_push_offline_opt:host(LServer),
WrappedPacket = wrap(DelayedPkt, <<"urn:xmpp:push:nodes:messages">>, Id), WrappedPacket = wrap(DelayedPkt, <<"urn:xmpp:push:nodes:messages">>, Id),
ejabberd_router:route(xmpp:set_from_to(WrappedPacket, To, jid:make(PushServer))). ejabberd_router:route(xmpp:set_from_to(WrappedPacket, To, jid:make(PushServer))).

View File

@ -0,0 +1,9 @@
-module(mod_push_offline_opt).
-export([host/1]).
-spec host(gen_mod:opts() | global | binary()) -> binary().
host(Opts) when is_map(Opts) ->
gen_mod:get_opt(host, Opts);
host(Host) ->
gen_mod:get_module_opt(Host, mod_push_offline, host).