Do a CDS refresh when a new chat is created.

This commit is contained in:
Greyson Parrelli
2024-03-01 13:40:26 -05:00
committed by Alex Hart
parent 40b4b316b3
commit 58b11f3c47
5 changed files with 130 additions and 59 deletions

View File

@@ -41,6 +41,7 @@ public final class MiscellaneousValues extends SignalStoreValues {
private static final String LAST_SERVER_TIME_OFFSET_UPDATE = "misc.last_server_time_offset_update";
private static final String NEEDS_USERNAME_RESTORE = "misc.needs_username_restore";
private static final String LAST_FORCED_PREKEY_REFRESH = "misc.last_forced_prekey_refresh";
private static final String LAST_CDS_FOREGROUND_SYNC = "misc.last_cds_foreground_sync";
MiscellaneousValues(@NonNull KeyValueStore store) {
super(store);
@@ -359,4 +360,18 @@ public final class MiscellaneousValues extends SignalStoreValues {
public long getLastForcedPreKeyRefresh() {
return getLong(LAST_FORCED_PREKEY_REFRESH, 0);
}
/**
* How long it's been since the last foreground CDS sync, which we do in response to new threads being created.
*/
public long getLastCdsForegroundSyncTime() {
return getLong(LAST_CDS_FOREGROUND_SYNC, 0);
}
/**
* Set the last time we did a foreground CDS sync.
*/
public void setLastCdsForegroundSyncTime(long time) {
putLong(LAST_CDS_FOREGROUND_SYNC, time);
}
}