Extend contact attributes
Welcome!
- [X] Yes, I have searched for similar requests on GitHub and found none.
What type of feature?
Database adjustment
What is the motivation for the request?
Extend the 'Contact' type so instead of containing only:
model Contact { id String @id @default(cuid()) remoteJid String @db.VarChar(100) pushName String? @db.VarChar(100) profilePicUrl String? @db.VarChar(500) createdAt DateTime? @default(dbgenerated("CURRENT_TIMESTAMP")) @db.Timestamp updatedAt DateTime? @updatedAt @db.Timestamp Instance Instance @relation(fields: [instanceId], references: [id], onDelete: Cascade) instanceId String
@@unique([remoteJid, instanceId]) @@index([remoteJid]) @@index([instanceId]) }
It will also contain:
model Contact { id String @id @default(cuid()) remoteJid String @db.VarChar(100) pushName String? @db.VarChar(100) profilePicUrl String? @db.VarChar(500) createdAt DateTime? @default(now()) @db.Timestamp updatedAt DateTime? @updatedAt @db.Timestamp Instance Instance @relation(fields: [instanceId], references: [id], onDelete: Cascade) instanceId String isMyContact Boolean @default(false) // New field isGroup Boolean @default(false) // New field isWAContact Boolean @default(false) // New field isMe Boolean @default(false) // New field isBlocked Boolean @default(false) // New field
@@unique([remoteJid, instanceId]) @@index([remoteJid]) @@index([instanceId]) }
The reason being, when the user fetches all contacts, all of the contacts are listed with no distinction between actual user contacts (saved on the device), group contacts, random non-saved contacts ect. This will enable better filteration.
Usage Examples
This will enable the user to filter by their own contacts vs. contacts who are not saved on their phone.
How should the feature be developed?
No response
Additional Notes
No response