diff --git a/src/mod_mam.erl b/src/mod_mam.erl index 7912be30d..791bcd16f 100644 --- a/src/mod_mam.erl +++ b/src/mod_mam.erl @@ -259,6 +259,8 @@ remove_room(LServer, Name, Host) -> Mod:remove_room(LServer, LName, LHost), ok. +-spec remove_mam_for_user(binary(), binary()) -> + {ok, binary()} | {error, binary()}. remove_mam_for_user(User, Server) -> LUser = jid:nodeprep(User), LServer = jid:nameprep(Server), @@ -272,6 +274,8 @@ remove_mam_for_user(User, Server) -> {error, <<"Db returned error">>} end. +-spec remove_mam_for_user_with_peer(binary(), binary(), binary()) -> + {ok, binary()} | {error, binary()}. remove_mam_for_user_with_peer(User, Server, Peer) -> LUser = jid:nodeprep(User), LServer = jid:nameprep(Server), diff --git a/src/mod_mam_mnesia.erl b/src/mod_mam_mnesia.erl index 53d390cb7..55154f6bb 100644 --- a/src/mod_mam_mnesia.erl +++ b/src/mod_mam_mnesia.erl @@ -77,8 +77,7 @@ remove_from_archive(LUser, LServer, WithJid) -> US = {LUser, LServer}, Peer = jid:remove_resource(jid:split(WithJid)), F = fun () -> - Msgs = mnesia:match_object(archive_msg, - #archive_msg{us = US, bare_peer = Peer, _ = '_'}), + Msgs = mnesia:match_object(#archive_msg{us = US, bare_peer = Peer, _ = '_'}), lists:foreach(fun mnesia:delete_object/1, Msgs) end, case mnesia:transaction(F) of