Update mod_mam_mnesia to work with ejabberd 15.06

This commit is contained in:
Holger Weiss 2015-06-25 21:17:17 +02:00
parent e5d24089d2
commit 9c17da232f
1 changed files with 16 additions and 16 deletions

View File

@ -51,8 +51,8 @@
%% ejabberd_hooks callbacks. %% ejabberd_hooks callbacks.
-export([disco_features/5, -export([disco_features/5,
receive_stanza/4, receive_stanza/5,
send_stanza/3, send_stanza/4,
remove_user/2]). remove_user/2]).
%% gen_iq_handler callback. %% gen_iq_handler callback.
@ -274,10 +274,10 @@ disco_features({result, OtherFeatures},
{result, OtherFeatures ++ [?NS_MAM]}; {result, OtherFeatures ++ [?NS_MAM]};
disco_features(Acc, _From, _To, _Node, _Lang) -> Acc. disco_features(Acc, _From, _To, _Node, _Lang) -> Acc.
-spec receive_stanza(jid(), jid(), jid(), xmlel()) -> ok. -spec receive_stanza(xmlel(), term(), jid(), jid(), jid()) -> xmlel().
receive_stanza(#jid{luser = U, lserver = S} = JID, From, To, receive_stanza(#xmlel{name = <<"message">>} = Stanza, _C2SState,
#xmlel{name = <<"message">>} = Stanza) -> #jid{luser = U, lserver = S} = JID, From, To) ->
case is_desired(incoming, JID, To, Stanza) of case is_desired(incoming, JID, To, Stanza) of
true -> true ->
Proc = gen_mod:get_module_proc(S, ?PROCNAME), Proc = gen_mod:get_module_proc(S, ?PROCNAME),
@ -288,15 +288,15 @@ receive_stanza(#jid{luser = U, lserver = S} = JID, From, To,
?GEN_SERVER:cast(Proc, {store, {U, S}, Msg}); ?GEN_SERVER:cast(Proc, {store, {U, S}, Msg});
false -> false ->
?DEBUG("Won't archive undesired incoming stanza for ~s", ?DEBUG("Won't archive undesired incoming stanza for ~s",
[jlib:jid_to_string(To)]), [jlib:jid_to_string(To)])
ok end,
end; Stanza;
receive_stanza(_JID, _From, _To, _Stanza) -> ok. receive_stanza(Stanza, _C2SState, _JID, _From, _To) -> Stanza.
-spec send_stanza(jid(), jid(), xmlel()) -> ok. -spec send_stanza(xmlel(), term(), jid(), jid()) -> xmlel().
send_stanza(#jid{luser = U, lserver = S} = From, To, send_stanza(#xmlel{name = <<"message">>} = Stanza, _C2SState,
#xmlel{name = <<"message">>} = Stanza) -> #jid{luser = U, lserver = S} = From, To) ->
case is_desired(outgoing, From, To, Stanza) of case is_desired(outgoing, From, To, Stanza) of
true -> true ->
Proc = gen_mod:get_module_proc(S, ?PROCNAME), Proc = gen_mod:get_module_proc(S, ?PROCNAME),
@ -307,10 +307,10 @@ send_stanza(#jid{luser = U, lserver = S} = From, To,
?GEN_SERVER:cast(Proc, {store, {U, S}, Msg}); ?GEN_SERVER:cast(Proc, {store, {U, S}, Msg});
false -> false ->
?DEBUG("Won't archive undesired outgoing stanza from ~s", ?DEBUG("Won't archive undesired outgoing stanza from ~s",
[jlib:jid_to_string(From)]), [jlib:jid_to_string(From)])
ok end,
end; Stanza;
send_stanza(_From, _To, _Stanza) -> ok. send_stanza(Stanza, _C2SState, _From, _To) -> Stanza.
%%-------------------------------------------------------------------- %%--------------------------------------------------------------------
%% Check whether stanza should be stored. %% Check whether stanza should be stored.