mirror of
https://github.com/processone/ejabberd
synced 2025-10-05 10:39:29 +02:00
parent
64e1cfcbba
commit
6da1bb5b22
5 changed files with 131 additions and 6 deletions
|
@ -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) ->
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue