Skip to content

Commit c3bded7

Browse files
committed
Refine JID type detection logic in FMessageWpp
1 parent 3871b40 commit c3bded7

File tree

1 file changed

+6
-10
lines changed

1 file changed

+6
-10
lines changed

app/src/main/java/com/wmods/wppenhacer/xposed/core/components/FMessageWpp.java

Lines changed: 6 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -394,30 +394,30 @@ public boolean isStatus() {
394394
public boolean isNewsletter() {
395395
String raw = getPhoneRawString();
396396
if (raw == null) return false;
397-
return raw.contains("@newsletter");
397+
return raw.endsWith("@newsletter");
398398
}
399399

400400
public boolean isBroadcast() {
401401
String raw = getPhoneRawString();
402402
if (raw == null) return false;
403-
return raw.contains("@broadcast");
403+
return raw.endsWith("@broadcast");
404404
}
405405

406406
public boolean isGroup() {
407407
if (this.phoneJid == null) return false;
408408
String str = getPhoneRawString();
409409
if (str == null) return false;
410-
return str.contains("-") || str.contains("@g.us") || (!str.contains("@") && str.length() > 16);
410+
return str.endsWith("@g.us");
411411
}
412412

413413

414414
public boolean isContact() {
415415
if (this.userJid != null) {
416416
var raw = getUserRawString();
417-
return raw != null && raw.contains("@lid");
417+
return raw != null && raw.endsWith("@lid");
418418
}
419419
String str = getPhoneRawString();
420-
return str != null && str.contains("@s.whatsapp.net");
420+
return str != null && str.endsWith("@s.whatsapp.net");
421421
}
422422

423423

@@ -426,11 +426,7 @@ public boolean isNull() {
426426
}
427427

428428
private static boolean checkValidLID(String lid) {
429-
if (lid != null && lid.contains("@lid")) {
430-
String id = lid.split("@")[0];
431-
return lid.length() > 14;
432-
}
433-
return false;
429+
return lid != null && lid.endsWith("@lid");
434430
}
435431

436432
@NonNull

0 commit comments

Comments
 (0)