|
@ -394,7 +394,8 @@ export function contactForDid( |
|
|
* @param activeDid |
|
|
* @param activeDid |
|
|
* @param contact |
|
|
* @param contact |
|
|
* @param allMyDids |
|
|
* @param allMyDids |
|
|
* @return { known: boolean, displayName: string } where known is true if the display name is some easily-recogizable name, false if it's a generic name like "Someone Anonymous" |
|
|
* @return { known: boolean, displayName: string, profileImageUrl?: string } |
|
|
|
|
|
* where 'known' is true if the display name is some easily-recogizable name, false if it's a generic name like "Someone Unnamed" |
|
|
*/ |
|
|
*/ |
|
|
export function didInfoForContact( |
|
|
export function didInfoForContact( |
|
|
did: string | undefined, |
|
|
did: string | undefined, |
|
@ -402,15 +403,16 @@ export function didInfoForContact( |
|
|
contact?: Contact, |
|
|
contact?: Contact, |
|
|
allMyDids: string[] = [], |
|
|
allMyDids: string[] = [], |
|
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
|
): { known: boolean; displayName: string } { |
|
|
): { known: boolean; displayName: string; profileImageUrl?: string } { |
|
|
if (!did) return { displayName: "Someone Anonymous", known: false }; |
|
|
if (!did) return { displayName: "Someone Unnamed/Unknown", known: false }; |
|
|
if (contact) { |
|
|
if (did === activeDid) { |
|
|
|
|
|
return { displayName: "You", known: true }; |
|
|
|
|
|
} else if (contact) { |
|
|
return { |
|
|
return { |
|
|
displayName: contact.name || "Contact With No Name", |
|
|
displayName: contact.name || "Contact With No Name", |
|
|
known: !!contact.name, |
|
|
known: !!contact.name, |
|
|
|
|
|
profileImageUrl: contact.profileImageUrl, |
|
|
}; |
|
|
}; |
|
|
} else if (did === activeDid) { |
|
|
|
|
|
return { displayName: "You", known: true }; |
|
|
|
|
|
} else { |
|
|
} else { |
|
|
const myId = R.find(R.equals(did), allMyDids); |
|
|
const myId = R.find(R.equals(did), allMyDids); |
|
|
return myId |
|
|
return myId |
|
|