@@ -41,30 +41,35 @@ export interface ILocalAttribute extends ICoreSynchronizable {
41
41
export type OwnSharedIdentityAttribute = LocalAttribute & {
42
42
content : IdentityAttribute ;
43
43
shareInfo : LocalAttributeShareInfo ;
44
+ parentId : undefined ;
44
45
isDefault : undefined ;
45
46
} ;
46
47
47
48
export type OwnSharedRelationshipAttribute = LocalAttribute & {
48
49
content : RelationshipAttribute ;
49
50
shareInfo : LocalAttributeShareInfo ;
51
+ parentId : undefined ;
50
52
isDefault : undefined ;
51
53
} ;
52
54
53
55
export type PeerSharedIdentityAttribute = LocalAttribute & {
54
56
content : IdentityAttribute ;
55
57
shareInfo : LocalAttributeShareInfo & { sourceAttribute : undefined } ;
58
+ parentId : undefined ;
56
59
isDefault : undefined ;
57
60
} ;
58
61
59
62
export type PeerSharedRelationshipAttribute = LocalAttribute & {
60
63
content : RelationshipAttribute ;
61
64
shareInfo : LocalAttributeShareInfo & { sourceAttribute : undefined } ;
65
+ parentId : undefined ;
62
66
isDefault : undefined ;
63
67
} ;
64
68
65
69
export type ThirdPartyOwnedRelationshipAttribute = LocalAttribute & {
66
70
content : RelationshipAttribute ;
67
71
shareInfo : LocalAttributeShareInfo ;
72
+ parentId : undefined ;
68
73
isDefault : undefined ;
69
74
} ;
70
75
@@ -149,6 +154,7 @@ export class LocalAttribute extends CoreSynchronizable implements ILocalAttribut
149
154
public isOwnSharedAttribute ( ownAddress : CoreAddress , peerAddress ?: CoreAddress ) : this is OwnSharedIdentityAttribute | OwnSharedRelationshipAttribute {
150
155
let isOwnSharedAttribute = this . isShared ( ) && this . isOwnedBy ( ownAddress ) ;
151
156
157
+ isOwnSharedAttribute &&= ! this . parentId ;
152
158
isOwnSharedAttribute &&= ! this . isDefault ;
153
159
154
160
if ( peerAddress ) isOwnSharedAttribute &&= this . shareInfo ! . peer . equals ( peerAddress ) ;
@@ -160,6 +166,7 @@ export class LocalAttribute extends CoreSynchronizable implements ILocalAttribut
160
166
161
167
isPeerSharedAttribute &&= ! this . shareInfo ! . sourceAttribute ;
162
168
169
+ isPeerSharedAttribute &&= ! this . parentId ;
163
170
isPeerSharedAttribute &&= ! this . isDefault ;
164
171
165
172
if ( peerAddress ) isPeerSharedAttribute &&= this . isOwnedBy ( peerAddress ) ;
@@ -169,6 +176,7 @@ export class LocalAttribute extends CoreSynchronizable implements ILocalAttribut
169
176
public isThirdPartyOwnedAttribute ( ownAddress : CoreAddress , thirdPartyAddress ?: CoreAddress ) : this is ThirdPartyOwnedRelationshipAttribute {
170
177
let isThirdPartyOwnedAttribute = this . isShared ( ) && ! this . isOwnedBy ( ownAddress ) && ! this . isOwnedBy ( this . shareInfo . peer ) ;
171
178
179
+ isThirdPartyOwnedAttribute &&= ! this . parentId ;
172
180
isThirdPartyOwnedAttribute &&= ! this . isDefault ;
173
181
174
182
if ( thirdPartyAddress ) isThirdPartyOwnedAttribute &&= this . isOwnedBy ( thirdPartyAddress ) ;
0 commit comments