allow blocking another person's content from this user (with iViewContent contact field)

This commit is contained in:
2025-06-20 15:53:31 -06:00
parent 838723c26b
commit 94994a7251
9 changed files with 215 additions and 91 deletions

View File

@@ -1,15 +1,16 @@
export interface ContactMethod {
export type ContactMethod = {
label: string;
type: string; // eg. "EMAIL", "SMS", "WHATSAPP", maybe someday "GOOGLE-CONTACT-API"
value: string;
}
};
export interface Contact {
export type Contact = {
//
// When adding a property, consider whether it should be added when exporting & sharing contacts.
// When adding a property, consider whether it should be added when exporting & sharing contacts, eg. DataExportSection
did: string;
contactMethods?: Array<ContactMethod>;
iViewContent?: boolean;
name?: string;
nextPubKeyHashB64?: string; // base64-encoded SHA256 hash of next public key
notes?: string;
@@ -17,9 +18,15 @@ export interface Contact {
publicKeyBase64?: string;
seesMe?: boolean; // cached value of the server setting
registered?: boolean; // cached value of the server setting
}
};
export type ContactWithJsonStrings = Contact & {
/**
* This is for those cases (eg. with a DB) where every field is a primitive (and not an object).
*
* This is so that we can reuse most of the type and don't have to maintain another copy.
* Another approach uses typescript conditionals: https://chatgpt.com/share/6855cdc3-ab5c-8007-8525-726612016eb2
*/
export type ContactWithJsonStrings = Omit<Contact, "contactMethods"> & {
contactMethods?: string;
};