1
0
Fork 0
mirror of https://github.com/vanitasvitae/Smack.git synced 2024-11-27 14:32:06 +01:00
This commit is contained in:
Paul Schaub 2018-01-05 17:34:04 +01:00
parent c287345ce7
commit 9c7a027b62

View file

@ -384,6 +384,10 @@ public abstract class OmemoService<T_IdKeyPair, T_IdKey, T_PreKey, T_SigPreKey,
if (OmemoConfiguration.getIgnoreStaleDevices()) {
Date lastActivity = getOmemoStoreBackend().getDateOfLastReceivedMessage(userDevice, contactsDevice);
if (lastActivity == null) {
lastActivity = new Date();
getOmemoStoreBackend().setDateOfLastReceivedMessage(userDevice, contactsDevice, lastActivity);
}
if (isStale(userDevice, contactsDevice, lastActivity, OmemoConfiguration.getIgnoreStaleDevicesAfterHours())) {
LOGGER.log(Level.FINE, "Device " + contactsDevice + " seems to be stale (last message received "
@ -1038,6 +1042,10 @@ public abstract class OmemoService<T_IdKeyPair, T_IdKey, T_PreKey, T_SigPreKey,
return false;
}
if (lastReceipt == null) {
return false;
}
long maxAgeMillis = MILLIS_PER_HOUR * maxAgeHours;
Date now = new Date();