Fix issue with loading legacy profile store

Fixes #981
This commit is contained in:
AsamK 2022-07-15 20:13:36 +02:00
parent 1c7d1861d6
commit 9da2a00403
3 changed files with 9 additions and 6 deletions

View file

@ -60,7 +60,7 @@ public class LegacyProfileStore {
} }
} }
var lastUpdateTimestamp = entry.get("lastUpdateTimestamp").asLong(); var lastUpdateTimestamp = entry.get("lastUpdateTimestamp").asLong();
var profile = jsonProcessor.treeToValue(entry.get("profile"), SignalProfile.class); var profile = jsonProcessor.treeToValue(entry.get("profile"), LegacySignalProfile.class);
profileEntries.add(new LegacySignalProfileEntry(address, profileEntries.add(new LegacySignalProfileEntry(address,
profileKey, profileKey,
lastUpdateTimestamp, lastUpdateTimestamp,

View file

@ -3,7 +3,7 @@ package org.asamk.signal.manager.storage.profiles;
import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonIgnore;
import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonProperty;
public class SignalProfile { public class LegacySignalProfile {
@JsonProperty @JsonProperty
@JsonIgnore @JsonIgnore
@ -27,7 +27,7 @@ public class SignalProfile {
@JsonProperty @JsonProperty
private final Capabilities capabilities; private final Capabilities capabilities;
public SignalProfile( public LegacySignalProfile(
@JsonProperty("name") final String name, @JsonProperty("name") final String name,
@JsonProperty("about") final String about, @JsonProperty("about") final String about,
@JsonProperty("aboutEmoji") final String aboutEmoji, @JsonProperty("aboutEmoji") final String aboutEmoji,
@ -88,6 +88,9 @@ public class SignalProfile {
@JsonIgnore @JsonIgnore
public boolean uuid; public boolean uuid;
@JsonIgnore
public boolean gv2;
@JsonProperty @JsonProperty
public boolean storage; public boolean storage;

View file

@ -12,7 +12,7 @@ public class LegacySignalProfileEntry {
private final long lastUpdateTimestamp; private final long lastUpdateTimestamp;
private final SignalProfile profile; private final LegacySignalProfile profile;
private final ProfileKeyCredential profileKeyCredential; private final ProfileKeyCredential profileKeyCredential;
@ -20,7 +20,7 @@ public class LegacySignalProfileEntry {
final RecipientAddress address, final RecipientAddress address,
final ProfileKey profileKey, final ProfileKey profileKey,
final long lastUpdateTimestamp, final long lastUpdateTimestamp,
final SignalProfile profile, final LegacySignalProfile profile,
final ProfileKeyCredential profileKeyCredential final ProfileKeyCredential profileKeyCredential
) { ) {
this.address = address; this.address = address;
@ -42,7 +42,7 @@ public class LegacySignalProfileEntry {
return lastUpdateTimestamp; return lastUpdateTimestamp;
} }
public SignalProfile getProfile() { public LegacySignalProfile getProfile() {
return profile; return profile;
} }