X-Git-Url: https://git.nmode.ca/signal-cli/blobdiff_plain/e36a54e7ccb7e103027c71c6128854f06537d787..2cd6b2b99baf31c24e5e37a367c95c29192fd1ca:/src/main/java/org/asamk/signal/storage/SignalAccount.java diff --git a/src/main/java/org/asamk/signal/storage/SignalAccount.java b/src/main/java/org/asamk/signal/storage/SignalAccount.java index 6af9d460..1ba78f6b 100644 --- a/src/main/java/org/asamk/signal/storage/SignalAccount.java +++ b/src/main/java/org/asamk/signal/storage/SignalAccount.java @@ -9,6 +9,7 @@ import com.fasterxml.jackson.databind.JsonNode; import com.fasterxml.jackson.databind.ObjectMapper; import com.fasterxml.jackson.databind.SerializationFeature; import com.fasterxml.jackson.databind.node.ObjectNode; + import org.asamk.signal.storage.contacts.JsonContactsStore; import org.asamk.signal.storage.groups.JsonGroupStore; import org.asamk.signal.storage.protocol.JsonSignalProtocolStore; @@ -20,7 +21,7 @@ import org.whispersystems.libsignal.state.PreKeyRecord; import org.whispersystems.libsignal.state.SignedPreKeyRecord; import org.whispersystems.libsignal.util.Medium; import org.whispersystems.signalservice.api.push.SignalServiceAddress; -import org.whispersystems.signalservice.internal.util.Base64; +import org.whispersystems.util.Base64; import java.io.File; import java.io.IOException; @@ -139,7 +140,9 @@ public class SignalAccount { if (node != null) { deviceId = node.asInt(); } - if (rootNode.has("isMultiDevice")) isMultiDevice = Util.getNotNullNode(rootNode, "isMultiDevice").asBoolean(); + if (rootNode.has("isMultiDevice")) { + isMultiDevice = Util.getNotNullNode(rootNode, "isMultiDevice").asBoolean(); + } username = Util.getNotNullNode(rootNode, "username").asText(); password = Util.getNotNullNode(rootNode, "password").asText(); JsonNode pinNode = rootNode.get("registrationLockPin"); @@ -268,6 +271,10 @@ public class SignalAccount { return username; } + public SignalServiceAddress getSelfAddress() { + return new SignalServiceAddress(null, username); + } + public int getDeviceId() { return deviceId; }