mirror of
https://github.com/signalapp/Signal-Android.git
synced 2026-05-08 09:18:39 +01:00
Save last-known server time offset.
This commit is contained in:
committed by
Clark Chen
parent
8372c699f7
commit
ebaa445bee
+11
@@ -0,0 +1,11 @@
|
||||
/*
|
||||
* Copyright 2023 Signal Messenger, LLC
|
||||
* SPDX-License-Identifier: AGPL-3.0-only
|
||||
*/
|
||||
|
||||
package org.whispersystems.signalservice.api
|
||||
|
||||
data class RemoteConfigResult(
|
||||
val config: Map<String, Any>,
|
||||
val serverEpochTimeSeconds: Long
|
||||
)
|
||||
+2
-2
@@ -626,7 +626,7 @@ public class SignalServiceAccountManager {
|
||||
}
|
||||
}
|
||||
|
||||
public Map<String, Object> getRemoteConfig() throws IOException {
|
||||
public RemoteConfigResult getRemoteConfig() throws IOException {
|
||||
RemoteConfigResponse response = this.pushServiceSocket.getRemoteConfig();
|
||||
Map<String, Object> out = new HashMap<>();
|
||||
|
||||
@@ -634,7 +634,7 @@ public class SignalServiceAccountManager {
|
||||
out.put(config.getName(), config.getValue() != null ? config.getValue() : config.isEnabled());
|
||||
}
|
||||
|
||||
return out;
|
||||
return new RemoteConfigResult(out, response.getServerEpochTime());
|
||||
}
|
||||
|
||||
public String getAccountDataReport() throws IOException {
|
||||
|
||||
+7
@@ -8,10 +8,17 @@ public class RemoteConfigResponse {
|
||||
@JsonProperty
|
||||
private List<Config> config;
|
||||
|
||||
@JsonProperty
|
||||
private long serverEpochTime;
|
||||
|
||||
public List<Config> getConfig() {
|
||||
return config;
|
||||
}
|
||||
|
||||
public long getServerEpochTime() {
|
||||
return serverEpochTime;
|
||||
}
|
||||
|
||||
public static class Config {
|
||||
@JsonProperty
|
||||
private String name;
|
||||
|
||||
Reference in New Issue
Block a user