Don’t send reactive profile keys for groups

This commit is contained in:
Max Radermacher 2026-06-01 12:50:30 -05:00 committed by GitHub
parent 4caec2f2d3
commit c7005df406
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -528,29 +528,10 @@ public class OWSMessageDecrypter {
let needsReactiveProfileKeyMessage: Bool = db.read { transaction in
// This user is whitelisted, they should have our profile key / be sending UD messages
// Send them our profile key in case they somehow lost it.
if
profileManager.isUser(
inProfileWhitelist: SignalServiceAddress(sourceAci),
transaction: transaction,
)
{
return true
}
// If we're in a V2 group with this user, they should also have our profile key /
// be sending UD messages. Send them it in case they somehow lost it.
var needsReactiveProfileKeyMessage = false
TSGroupThread.enumerateGroupThreads(
with: SignalServiceAddress(sourceAci),
return profileManager.isUser(
inProfileWhitelist: SignalServiceAddress(sourceAci),
transaction: transaction,
) { thread, stop in
guard thread.isGroupV2Thread else { return }
guard thread.groupModel.groupMembership.isLocalUserFullMember else { return }
guard !thread.isTerminatedGroup else { return }
stop = true
needsReactiveProfileKeyMessage = true
}
return needsReactiveProfileKeyMessage
)
}
if needsReactiveProfileKeyMessage {