1
0
Fork 0
mirror of https://github.com/processone/ejabberd synced 2025-10-05 10:39:29 +02:00

Add support for "xep-0424 Message Moderation"

This fixes issue #3730
This commit is contained in:
Paweł Chmielowski 2023-03-30 14:37:13 +02:00
parent 64e1cfcbba
commit 6da1bb5b22
5 changed files with 131 additions and 6 deletions

View file

@ -64,12 +64,18 @@ remove_from_archive(LUser, LServer, none) ->
{error, Reason} -> {error, Reason};
_ -> ok
end;
remove_from_archive(LUser, LServer, WithJid) ->
remove_from_archive(LUser, LServer, #jid{} = WithJid) ->
Peer = jid:encode(jid:remove_resource(WithJid)),
case ejabberd_sql:sql_query(LServer,
?SQL("delete from archive where username=%(LUser)s and %(LServer)H and bare_peer=%(Peer)s")) of
{error, Reason} -> {error, Reason};
_ -> ok
end;
remove_from_archive(LUser, LServer, StanzaId) ->
case ejabberd_sql:sql_query(LServer,
?SQL("delete from archive where username=%(LUser)s and %(LServer)H and timestamp=%(StanzaId)d")) of
{error, Reason} -> {error, Reason};
_ -> ok
end.
count_messages_to_delete(ServerHost, TimeStamp, Type) ->