mirror of
https://github.com/AsamK/signal-cli
synced 2025-08-29 18:40:39 +00:00
Delete empty message cache directories
This commit is contained in:
parent
4d3e67ff83
commit
24ab58cc14
1 changed files with 4 additions and 0 deletions
|
@ -1116,6 +1116,8 @@ class Manager implements Signal {
|
||||||
System.err.println("Failed to delete cached message file “" + fileEntry + "”: " + e.getMessage());
|
System.err.println("Failed to delete cached message file “" + fileEntry + "”: " + e.getMessage());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
// Try to delete directory if empty
|
||||||
|
dir.delete();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1169,6 +1171,8 @@ class Manager implements Signal {
|
||||||
try {
|
try {
|
||||||
cacheFile = getMessageCacheFile(envelope.getSource(), now, envelope.getTimestamp());
|
cacheFile = getMessageCacheFile(envelope.getSource(), now, envelope.getTimestamp());
|
||||||
Files.delete(cacheFile.toPath());
|
Files.delete(cacheFile.toPath());
|
||||||
|
// Try to delete directory if empty
|
||||||
|
new File(getMessageCachePath()).delete();
|
||||||
} catch (IOException e) {
|
} catch (IOException e) {
|
||||||
System.err.println("Failed to delete cached message file “" + cacheFile + "”: " + e.getMessage());
|
System.err.println("Failed to delete cached message file “" + cacheFile + "”: " + e.getMessage());
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue