mirror of
https://github.com/signalapp/Signal-Server.git
synced 2026-12-01 06:46:47 +00:00
Correct timestamp resolution to intended integer value
This commit is contained in:
1 parent
fb39b2edaf
commit
81bb4910db
2 files changed
+5
-3
No files matched your search
+3
-2
@@ -10,6 +10,7 @@ import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
import com.fasterxml.jackson.annotation.JsonFormat.Shape;
|
||||
import com.fasterxml.jackson.annotation.JsonProperty;
|
||||
import java.time.Duration;
|
||||
import java.time.temporal.ChronoUnit;
|
||||
import java.util.List;
|
||||
import java.util.Objects;
|
||||
|
||||
@@ -27,7 +28,7 @@ public class PurchasableBadge extends Badge {
|
||||
@JsonProperty("svgs") final List<BadgeSvg> svgs,
|
||||
@JsonProperty("duration") final Duration duration) {
|
||||
super(id, category, name, description, sprites6, svg, svgs);
|
||||
this.duration = duration;
|
||||
this.duration = duration != null ? duration.truncatedTo(ChronoUnit.SECONDS) : null;
|
||||
}
|
||||
|
||||
public PurchasableBadge(final Badge badge, final Duration duration) {
|
||||
@@ -39,7 +40,7 @@ public class PurchasableBadge extends Badge {
|
||||
badge.getSprites6(),
|
||||
badge.getSvg(),
|
||||
badge.getSvgs());
|
||||
this.duration = duration;
|
||||
this.duration = duration != null ? duration.truncatedTo(ChronoUnit.SECONDS) : null;
|
||||
}
|
||||
|
||||
@JsonFormat(shape = Shape.NUMBER_INT)
|
||||
|
||||
+2
-1
@@ -9,6 +9,7 @@ import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
import com.fasterxml.jackson.annotation.JsonProperty;
|
||||
|
||||
import java.time.Instant;
|
||||
import java.time.temporal.ChronoUnit;
|
||||
import java.util.List;
|
||||
|
||||
public class UserRemoteConfigList {
|
||||
@@ -24,7 +25,7 @@ public class UserRemoteConfigList {
|
||||
|
||||
public UserRemoteConfigList(List<UserRemoteConfig> config, Instant serverEpochTime) {
|
||||
this.config = config;
|
||||
this.serverEpochTime = serverEpochTime;
|
||||
this.serverEpochTime = serverEpochTime != null ? serverEpochTime.truncatedTo(ChronoUnit.SECONDS) : null;
|
||||
}
|
||||
|
||||
public List<UserRemoteConfig> getConfig() {
|
||||
|
||||
Reference in new issue
Block a user