Split ACI contact when it is unregistered
This commit is contained in:
parent
a5a6b74f98
commit
63d6b14516
11 changed files with 317 additions and 81 deletions
|
@ -795,8 +795,8 @@ export class ConversationModel extends window.Backbone
|
|||
shouldSave?: boolean;
|
||||
} = {}): void {
|
||||
log.info(
|
||||
`Conversation ${this.idForLogging()} is now unregistered, ` +
|
||||
`timestamp=${timestamp}`
|
||||
`setUnregistered(${this.idForLogging()}): conversation is now ` +
|
||||
`unregistered, timestamp=${timestamp}`
|
||||
);
|
||||
|
||||
const oldFirstUnregisteredAt = this.get('firstUnregisteredAt');
|
||||
|
@ -821,6 +821,26 @@ export class ConversationModel extends window.Backbone
|
|||
window.Signal.Data.updateConversation(this.attributes);
|
||||
}
|
||||
|
||||
const e164 = this.get('e164');
|
||||
const pni = this.get('pni');
|
||||
const aci = this.get('uuid');
|
||||
if (e164 && pni && aci && pni !== aci) {
|
||||
this.updateE164(undefined);
|
||||
this.updatePni(undefined);
|
||||
|
||||
const { conversation: split } =
|
||||
window.ConversationController.maybeMergeContacts({
|
||||
pni,
|
||||
e164,
|
||||
reason: `ConversationModel.setUnregistered(${aci})`,
|
||||
});
|
||||
|
||||
log.info(
|
||||
`setUnregistered(${this.idForLogging()}): splitting pni ${pni} and ` +
|
||||
`e164 ${e164} into a separate conversation ${split.idForLogging()}`
|
||||
);
|
||||
}
|
||||
|
||||
if (
|
||||
!fromStorageService &&
|
||||
oldFirstUnregisteredAt !== this.get('firstUnregisteredAt')
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue