mirror of
https://github.com/AsamK/signal-cli
synced 2025-08-30 02:50:39 +00:00
Prevent empty username
This commit is contained in:
parent
2ab5b2817e
commit
e13dcdc85a
2 changed files with 7 additions and 1 deletions
|
@ -473,6 +473,9 @@ public class SignalAccount implements Closeable {
|
||||||
registered = storage.registered;
|
registered = storage.registered;
|
||||||
number = storage.number;
|
number = storage.number;
|
||||||
username = storage.username;
|
username = storage.username;
|
||||||
|
if ("".equals(username)) {
|
||||||
|
username = null;
|
||||||
|
}
|
||||||
encryptedDeviceName = storage.encryptedDeviceName;
|
encryptedDeviceName = storage.encryptedDeviceName;
|
||||||
deviceId = storage.deviceId;
|
deviceId = storage.deviceId;
|
||||||
isMultiDevice = storage.isMultiDevice;
|
isMultiDevice = storage.isMultiDevice;
|
||||||
|
@ -549,6 +552,9 @@ public class SignalAccount implements Closeable {
|
||||||
registered = Utils.getNotNullNode(rootNode, "registered").asBoolean();
|
registered = Utils.getNotNullNode(rootNode, "registered").asBoolean();
|
||||||
if (rootNode.hasNonNull("usernameIdentifier")) {
|
if (rootNode.hasNonNull("usernameIdentifier")) {
|
||||||
username = rootNode.get("usernameIdentifier").asText();
|
username = rootNode.get("usernameIdentifier").asText();
|
||||||
|
if ("".equals(username)) {
|
||||||
|
username = null;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
if (rootNode.hasNonNull("uuid")) {
|
if (rootNode.hasNonNull("uuid")) {
|
||||||
try {
|
try {
|
||||||
|
|
|
@ -104,7 +104,7 @@ public class AccountRecordProcessor extends DefaultStorageRecordProcessor<Signal
|
||||||
|| local.hasSeenGroupStoryEducationSheet();
|
|| local.hasSeenGroupStoryEducationSheet();
|
||||||
final var username = remote.getUsername() != null && !remote.getUsername().isEmpty()
|
final var username = remote.getUsername() != null && !remote.getUsername().isEmpty()
|
||||||
? remote.getUsername()
|
? remote.getUsername()
|
||||||
: local.getUsername() != null && !local.getUsername().isEmpty() ? local.getUsername() : null;
|
: local.getUsername();
|
||||||
final var usernameLink = remote.getUsernameLink() != null ? remote.getUsernameLink() : local.getUsernameLink();
|
final var usernameLink = remote.getUsernameLink() != null ? remote.getUsernameLink() : local.getUsernameLink();
|
||||||
|
|
||||||
final var mergedBuilder = new SignalAccountRecord.Builder(remote.getId().getRaw(), unknownFields).setGivenName(
|
final var mergedBuilder = new SignalAccountRecord.Builder(remote.getId().getRaw(), unknownFields).setGivenName(
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue