@@ -51,80 +51,27 @@ extension Contact {
5151 )
5252 }
5353
54- /// Builds a member-aware contact resolver: freshens the current conversation
55- /// member's avatar image ( the source the message bubble uses) over the lagging
56- /// stored contact, falling back to the stored contact for non-members. Name
57- /// and other identity fields are left as the stored contact's. See
58- /// `liveOverride`. Interim stopgap; see
59- /// docs/plans/2026-06-29-profile-table-implementation.md, section 10.1 .
54+ /// Deprecated no-op. Identity (name and image) is now sourced authoritatively
55+ /// from the `Profile` database; contact data never overrides it. Returns a
56+ /// resolver that yields `nil` for every inbox so callers fall through to the
57+ /// member `Profile`. Retained (ignoring its arguments) so call sites compile
58+ /// until the contact-override plumbing is fully removed - see the cleanup
59+ /// checklist in docs/plans/2026-06-29-profile-table-implementation.md.
6060 static func memberAwareResolver(
6161 members: [ ConversationMember ] ,
6262 contactLookup: @escaping @Sendable ( String ) -> Contact ?
6363 ) -> @Sendable ( String ) -> Contact ? {
64- let memberProfiles : [ String : Profile ] = Dictionary (
65- members. map { ( $0. profile. inboxId, $0. profile) } ,
66- uniquingKeysWith: { current, _ in current }
67- )
68- return { inboxId in
69- let stored = contactLookup ( inboxId)
70- guard let member = memberProfiles [ inboxId] else { return stored }
71- return Contact . liveOverride ( member: member, stored: stored)
72- }
64+ { _ in nil }
7365 }
7466}
7567
7668extension Profile {
77- /// Returns a new `Profile` with `name` and `avatar*` substituted
78- /// from the supplied contact when - and only when - the contact
79- /// actually carries the corresponding data. A name-only contact
80- /// does NOT clobber the per-conversation avatar, and a contact
81- /// with neither field does not clobber a perfectly good per-
82- /// conversation profile. `conversationId`, `isAgent`,
83- /// `imageSourceContentDigest`, and `metadata` are always preserved
84- /// from the original.
85- ///
86- /// The chat layer uses this so a system-message or avatar row
87- /// shows the contact's name and photo when the inbox is a known
88- /// contact whose per-conversation profile has not landed yet,
89- /// without regressing rows where the per-conversation profile is
90- /// already richer than the contact entry.
69+ /// Deprecated no-op. Identity (name and image) is sourced authoritatively
70+ /// from the `Profile` database; contact data never overrides it, so this
71+ /// returns the profile unchanged. Retained so call sites compile until the
72+ /// contact-override plumbing is removed - see the cleanup checklist in
73+ /// docs/plans/2026-06-29-profile-table-implementation.md.
9174 func overlaying( contact: Contact ) -> Profile {
92- let resolvedName : String ?
93- if let contactName = contact. displayName, !contactName. isEmpty {
94- resolvedName = contactName
95- } else {
96- resolvedName = name
97- }
98- // Avatar fields move as a set: a contact without an avatar URL
99- // has no usable encryption material either, so substituting
100- // any one of them in isolation would leave the cache key
101- // pointing at an inaccessible blob.
102- let resolvedAvatar : String ?
103- let resolvedAvatarSalt : Data ?
104- let resolvedAvatarNonce : Data ?
105- let resolvedAvatarKey : Data ?
106- if contact. avatarURL != nil {
107- resolvedAvatar = contact. avatarURL
108- resolvedAvatarSalt = contact. avatarSalt
109- resolvedAvatarNonce = contact. avatarNonce
110- resolvedAvatarKey = contact. avatarKey
111- } else {
112- resolvedAvatar = avatar
113- resolvedAvatarSalt = avatarSalt
114- resolvedAvatarNonce = avatarNonce
115- resolvedAvatarKey = avatarKey
116- }
117- return Profile (
118- inboxId: inboxId,
119- conversationId: conversationId,
120- name: resolvedName,
121- avatar: resolvedAvatar,
122- avatarSalt: resolvedAvatarSalt,
123- avatarNonce: resolvedAvatarNonce,
124- avatarKey: resolvedAvatarKey,
125- isAgent: isAgent,
126- imageSourceContentDigest: imageSourceContentDigest,
127- metadata: metadata
128- )
75+ self
12976 }
13077}
0 commit comments