Skip to content

Commit 37d50d8

Browse files
committed
Fix: Show JID instead of generic app name in Deleted Messages list
1 parent d8d1152 commit 37d50d8

1 file changed

Lines changed: 14 additions & 2 deletions

File tree

app/src/main/java/com/wmods/wppenhacer/adapter/DeletedMessagesAdapter.java

Lines changed: 14 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -62,10 +62,22 @@ public void onBindViewHolder(@NonNull ViewHolder holder, int position) {
6262
// Priority 1: Use Persisted Contact Name (from DB)
6363
String contactName = message.getContactName();
6464

65-
// Priority 2: Runtime Lookup (if not in DB or changed)
66-
if (contactName == null && displayJid != null) {
65+
// Check if DB value is invalid (Generic App Name)
66+
if (contactName != null
67+
&& (contactName.equalsIgnoreCase("WhatsApp") || contactName.equalsIgnoreCase("WhatsApp Business"))) {
68+
contactName = null;
69+
}
70+
71+
// Priority 2: Runtime Lookup (if not in DB or was invalid)
72+
if ((contactName == null || contactName.isEmpty()) && displayJid != null) {
6773
contactName = com.wmods.wppenhacer.utils.ContactHelper.getContactName(context, displayJid);
6874
}
75+
76+
// Final Check: If Runtime Lookup also returned Generic App Name
77+
if (contactName != null
78+
&& (contactName.equalsIgnoreCase("WhatsApp") || contactName.equalsIgnoreCase("WhatsApp Business"))) {
79+
contactName = null;
80+
}
6981
String displayText;
7082
if (contactName != null) {
7183
displayText = contactName;

0 commit comments

Comments
 (0)