mirror of
https://github.com/AsamK/signal-cli
synced 2025-08-29 18:40: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;
|
||||
number = storage.number;
|
||||
username = storage.username;
|
||||
if ("".equals(username)) {
|
||||
username = null;
|
||||
}
|
||||
encryptedDeviceName = storage.encryptedDeviceName;
|
||||
deviceId = storage.deviceId;
|
||||
isMultiDevice = storage.isMultiDevice;
|
||||
|
@ -549,6 +552,9 @@ public class SignalAccount implements Closeable {
|
|||
registered = Utils.getNotNullNode(rootNode, "registered").asBoolean();
|
||||
if (rootNode.hasNonNull("usernameIdentifier")) {
|
||||
username = rootNode.get("usernameIdentifier").asText();
|
||||
if ("".equals(username)) {
|
||||
username = null;
|
||||
}
|
||||
}
|
||||
if (rootNode.hasNonNull("uuid")) {
|
||||
try {
|
||||
|
|
|
@ -104,7 +104,7 @@ public class AccountRecordProcessor extends DefaultStorageRecordProcessor<Signal
|
|||
|| local.hasSeenGroupStoryEducationSheet();
|
||||
final var username = remote.getUsername() != null && !remote.getUsername().isEmpty()
|
||||
? 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 mergedBuilder = new SignalAccountRecord.Builder(remote.getId().getRaw(), unknownFields).setGivenName(
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue