Don’t assume users are registered from sends

This commit is contained in:
Max Radermacher 2025-04-21 11:29:51 -05:00 committed by GitHub
parent 8ab351e759
commit b95cc4ba75
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 0 additions and 26 deletions

View File

@ -215,15 +215,6 @@ extension MessageSender {
}
sendResult.success.forEach { recipient in
// If we're sending a story, we generally get a 200, even if the account
// doesn't exist. Therefore, don't use this to mark accounts as registered.
if !message.isStorySend {
let recipientFetcher = DependenciesBridge.shared.recipientFetcher
let recipient = recipientFetcher.fetchOrCreate(serviceId: recipient.serviceId, tx: tx)
let recipientManager = DependenciesBridge.shared.recipientManager
recipientManager.markAsRegisteredAndSave(recipient, shouldUpdateStorageService: true, tx: tx)
}
SSKEnvironment.shared.profileManagerRef.didSendOrReceiveMessage(
serviceId: recipient.serviceId,
localIdentifiers: localIdentifiers,

View File

@ -1589,23 +1589,6 @@ public class MessageSender {
resendResponse.didPerformMessageSend(sentDeviceMessages, to: messageSend.serviceId, tx: transaction)
}
// If we've just delivered a message to a user, we know they have a valid
// Signal account. However, if we're sending a story, the server will
// always tell us the recipient is registered, so we can't use this as an
// affirmate indication for the existence of an account.
//
// This is low trust because we don't actually know for sure the fully
// qualified address is valid.
if !message.isStorySend {
let recipientFetcher = DependenciesBridge.shared.recipientFetcher
let recipient = recipientFetcher.fetchOrCreate(
serviceId: messageSend.serviceId,
tx: transaction
)
let recipientManager = DependenciesBridge.shared.recipientManager
recipientManager.markAsRegisteredAndSave(recipient, shouldUpdateStorageService: true, tx: transaction)
}
SSKEnvironment.shared.profileManagerRef.didSendOrReceiveMessage(
serviceId: messageSend.serviceId,
localIdentifiers: messageSend.localIdentifiers,