Skip to content

Commit

Permalink
Fixed JID parsing #527
Browse files Browse the repository at this point in the history
  • Loading branch information
Auties00 committed Feb 4, 2025
1 parent 008f5a0 commit d66dfa1
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions src/main/java/it/auties/whatsapp/model/jid/Jid.java
Original file line number Diff line number Diff line change
Expand Up @@ -82,10 +82,11 @@ public static String withoutServer(String jid) {
if (jid == null) {
return null;
}
for (var server : JidServer.values()) {
jid = jid.replace("@%s".formatted(server), "");
var index = jid.indexOf("@");
if(index == -1) {
return null;
}
return jid;
return jid.substring(0, index);
}

private static Integer tryParseAgent(String string) {
Expand Down

0 comments on commit d66dfa1

Please sign in to comment.