systemGivenName/systemFamilyName in ContactPill
This commit is contained in:
parent
5957c111cf
commit
ffac571dd8
8 changed files with 24 additions and 3 deletions
|
@ -87,6 +87,8 @@ message ContactRecord {
|
|||
optional uint64 mutedUntilTimestamp = 13;
|
||||
optional bool hideStory = 14;
|
||||
optional uint64 unregisteredAtTimestamp = 16;
|
||||
optional string systemGivenName = 17;
|
||||
optional string systemFamilyName = 18;
|
||||
}
|
||||
|
||||
message GroupV1Record {
|
||||
|
|
|
@ -819,7 +819,7 @@ export const EditDistributionList = ({
|
|||
acceptedMessageRequest={contact.acceptedMessageRequest}
|
||||
avatarPath={contact.avatarPath}
|
||||
color={contact.color}
|
||||
firstName={contact.firstName}
|
||||
firstName={contact.systemGivenName ?? contact.firstName}
|
||||
i18n={i18n}
|
||||
id={contact.id}
|
||||
isMe={contact.isMe}
|
||||
|
|
|
@ -307,7 +307,7 @@ export const ChooseGroupMembersModal: FunctionComponent<PropsType> = ({
|
|||
acceptedMessageRequest={contact.acceptedMessageRequest}
|
||||
avatarPath={contact.avatarPath}
|
||||
color={contact.color}
|
||||
firstName={contact.firstName}
|
||||
firstName={contact.systemGivenName ?? contact.firstName}
|
||||
i18n={i18n}
|
||||
isMe={contact.isMe}
|
||||
id={contact.id}
|
||||
|
|
|
@ -219,7 +219,7 @@ export class LeftPaneChooseGroupMembersHelper extends LeftPaneHelper<LeftPaneCho
|
|||
acceptedMessageRequest={contact.acceptedMessageRequest}
|
||||
avatarPath={contact.avatarPath}
|
||||
color={contact.color}
|
||||
firstName={contact.firstName}
|
||||
firstName={contact.systemGivenName ?? contact.firstName}
|
||||
i18n={i18n}
|
||||
id={contact.id}
|
||||
isMe={contact.isMe}
|
||||
|
|
2
ts/model-types.d.ts
vendored
2
ts/model-types.d.ts
vendored
|
@ -314,6 +314,8 @@ export type ConversationAttributesType = {
|
|||
isArchived?: boolean;
|
||||
lastMessage?: string | null;
|
||||
name?: string;
|
||||
systemGivenName?: string;
|
||||
systemFamilyName?: string;
|
||||
needsStorageServiceSync?: boolean;
|
||||
needsVerification?: boolean;
|
||||
profileSharing?: boolean;
|
||||
|
|
|
@ -1904,6 +1904,8 @@ export class ConversationModel extends window.Backbone
|
|||
muteExpiresAt: this.get('muteExpiresAt'),
|
||||
dontNotifyForMentionsIfMuted: this.get('dontNotifyForMentionsIfMuted'),
|
||||
name: this.get('name'),
|
||||
systemGivenName: this.get('systemGivenName'),
|
||||
systemFamilyName: this.get('systemFamilyName'),
|
||||
phoneNumber: this.getNumber(),
|
||||
profileName: this.getProfileName(),
|
||||
profileSharing: this.get('profileSharing'),
|
||||
|
@ -4971,6 +4973,7 @@ export class ConversationModel extends window.Backbone
|
|||
const username = this.get('username');
|
||||
|
||||
return (
|
||||
(isShort ? this.get('systemGivenName') : undefined) ||
|
||||
this.get('name') ||
|
||||
(isShort ? this.get('profileName') : undefined) ||
|
||||
this.getProfileName() ||
|
||||
|
|
|
@ -165,6 +165,14 @@ export async function toContactRecord(
|
|||
if (profileFamilyName) {
|
||||
contactRecord.familyName = profileFamilyName;
|
||||
}
|
||||
const systemGivenName = conversation.get('systemGivenName');
|
||||
if (systemGivenName) {
|
||||
contactRecord.systemGivenName = systemGivenName;
|
||||
}
|
||||
const systemFamilyName = conversation.get('systemFamilyName');
|
||||
if (systemFamilyName) {
|
||||
contactRecord.systemFamilyName = systemFamilyName;
|
||||
}
|
||||
contactRecord.blocked = conversation.isBlocked();
|
||||
contactRecord.whitelisted = Boolean(conversation.get('profileSharing'));
|
||||
contactRecord.archived = Boolean(conversation.get('isArchived'));
|
||||
|
@ -934,6 +942,10 @@ export async function mergeContactRecord(
|
|||
details.push('updated profile name');
|
||||
}
|
||||
}
|
||||
conversation.set({
|
||||
systemGivenName: dropNull(contactRecord.systemGivenName),
|
||||
systemFamilyName: dropNull(contactRecord.systemFamilyName),
|
||||
});
|
||||
|
||||
if (contactRecord.identityKey) {
|
||||
const verified = await conversation.safeGetVerified();
|
||||
|
|
|
@ -114,6 +114,8 @@ export type ConversationType = {
|
|||
pni?: UUIDStringType;
|
||||
e164?: string;
|
||||
name?: string;
|
||||
systemGivenName?: string;
|
||||
systemFamilyName?: string;
|
||||
familyName?: string;
|
||||
firstName?: string;
|
||||
profileName?: string;
|
||||
|
|
Loading…
Reference in a new issue