mirror of
https://github.com/AsamK/signal-cli
synced 2025-08-29 10:30:38 +00:00
Delete cached failed messages after 30 days
This commit is contained in:
parent
8bc6c0abcb
commit
634437d22d
1 changed files with 5 additions and 0 deletions
|
@ -851,6 +851,11 @@ public class Manager implements Closeable {
|
||||||
try {
|
try {
|
||||||
content = dependencies.getCipher().decrypt(envelope);
|
content = dependencies.getCipher().decrypt(envelope);
|
||||||
} catch (ProtocolUntrustedIdentityException e) {
|
} catch (ProtocolUntrustedIdentityException e) {
|
||||||
|
if (System.currentTimeMillis() - envelope.getServerDeliveredTimestamp() > 1000L * 60 * 60 * 24 * 30) {
|
||||||
|
// Envelope is more than a month old, cleaning up.
|
||||||
|
cachedMessage.delete();
|
||||||
|
return null;
|
||||||
|
}
|
||||||
if (!envelope.hasSource()) {
|
if (!envelope.hasSource()) {
|
||||||
final var identifier = e.getSender();
|
final var identifier = e.getSender();
|
||||||
final var recipientId = resolveRecipient(identifier);
|
final var recipientId = resolveRecipient(identifier);
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue