Remove deprecated ContactDetails fields

This commit is contained in:
Fedor Indutny 2023-11-07 21:26:31 +01:00 committed by GitHub
parent a03e064977
commit e8fdd7116b
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 5 additions and 22 deletions

View file

@ -689,10 +689,10 @@ message ContactDetails {
optional string aci = 9;
optional string name = 2;
optional Avatar avatar = 3;
optional string color = 4;
optional Verified verified = 5;
optional bytes profileKey = 6;
optional bool blocked = 7;
// reserved 4; // formerly color
// reserved 5; // formerly verified
// reserved 6; // formerly profileKey
// reserved 7; // formerly blocked
optional uint32 expireTimer = 8;
optional uint32 inboxPosition = 10;
}

View file

@ -197,24 +197,8 @@ function prepareContact(
? DurationInSeconds.fromSeconds(proto.expireTimer)
: undefined;
const verified =
proto.verified && proto.verified.destinationAci
? {
...proto.verified,
destinationAci: normalizeAci(
proto.verified.destinationAci,
'ContactBuffer.verified.destinationAci'
),
}
: proto.verified;
// We reject incoming contacts with invalid aci information
if (
(proto.aci && !isAciString(proto.aci)) ||
(proto.verified?.destinationAci &&
!isAciString(proto.verified.destinationAci))
) {
if (proto.aci && !isAciString(proto.aci)) {
log.warn('ParseContactsTransform: Dropping contact with invalid aci');
return undefined;
@ -224,7 +208,6 @@ function prepareContact(
...proto,
expireTimer,
aci,
verified,
avatar,
number: dropNull(proto.number),
};