Skip to content

Commit

Permalink
sepinf-inc#2294: handle full id when merging account info
Browse files Browse the repository at this point in the history
  • Loading branch information
aberenguel committed Oct 10, 2024
1 parent 61e5dcd commit 5cf5775
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 11 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -30,10 +30,6 @@ public WAAccount(String id) {
super(id);
}

public void setId(String id) {
this.id = id;
}

public String getTitle() {
return "WhatsApp Account: " + getName();
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,9 @@ public class WAContact {

protected static final String waSuffix = "@s.whatsapp.net";

protected String id;
private String id;

private final String suffix;
private String suffix;

private String status;

Expand All @@ -27,6 +27,14 @@ public class WAContact {
private boolean deleted = false;

public WAContact(String id) {
updateId(id);
}

public String getId() {
return id;
}

public void updateId(String id) {
if (id != null) {
String[] idSplit = id.split("@", 2);
this.id = idSplit[0].trim();
Expand All @@ -36,10 +44,6 @@ public WAContact(String id) {
}
}

public String getId() {
return id;
}

public String getStatus() {
return status;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -879,7 +879,7 @@ private WAAccount getUserAccount(IItemSearcher searcher, String dbPath, boolean
WAAccount a = isAndroid ? WAAccount.getFromAndroidXml(is) : WAAccount.getFromIOSPlist(is);
if (a != null) {
if (account.isUnknown() && !a.getId().isEmpty()) {
account.setId(a.getId());
account.updateId(a.getFullId());
account.setUnknown(false);
}
if (account.getWaName() == null && a.getWaName() != null) {
Expand Down

0 comments on commit 5cf5775

Please sign in to comment.