Fix for inactive auth problem
This commit is contained in:
parent
f630ccb134
commit
e201344ccd
|
@ -66,7 +66,7 @@ public class AccountAuthenticator implements Authenticator<BasicCredentials, Acc
|
|||
return Optional.empty();
|
||||
}
|
||||
|
||||
if (!device.get().isMaster() && !device.get().isActive()) {
|
||||
if (!device.get().isMaster() && device.get().isIdleInactive()) {
|
||||
return Optional.empty();
|
||||
}
|
||||
|
||||
|
|
|
@ -195,7 +195,11 @@ public class Device {
|
|||
boolean hasChannel = fetchesMessages || !Util.isEmpty(getApnId()) || !Util.isEmpty(getGcmId());
|
||||
|
||||
return (id == MASTER_ID && hasChannel && signedPreKey != null) ||
|
||||
(id != MASTER_ID && hasChannel && signedPreKey != null && lastSeen > (System.currentTimeMillis() - TimeUnit.DAYS.toMillis(30)));
|
||||
(id != MASTER_ID && hasChannel && signedPreKey != null && !isIdleInactive());
|
||||
}
|
||||
|
||||
public boolean isIdleInactive() {
|
||||
return id != MASTER_ID && lastSeen < (System.currentTimeMillis() - TimeUnit.DAYS.toMillis(30));
|
||||
}
|
||||
|
||||
public boolean getFetchesMessages() {
|
||||
|
|
Loading…
Reference in New Issue