Skip to content

Commit c5f3eba

Browse files
[SES-3869] Fixed blinded contacts not deleted after accepting blind requests (#1530)
* Fixed blinded contacts not deleted after accepting blind requests * Only update once
1 parent 27a9ea9 commit c5f3eba

File tree

1 file changed

+14
-6
lines changed

1 file changed

+14
-6
lines changed

app/src/main/java/org/session/libsession/messaging/sending_receiving/MessageRequestResponseHandler.kt

Lines changed: 14 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -128,16 +128,24 @@ class MessageRequestResponseHandler @Inject constructor(
128128
moveConversation(fromThreadId = blindedThreadId, toThreadId = threadId)
129129
}
130130

131-
// If we ever have any blinded conversations with this sender, we should make
132-
// sure we have set "approved" to true for them, because when we started the blinded
133-
// conversation, we didn't know their real standard addresses, so we didn't say
134-
// we have approved them, but now that we do, we need to approve them.
135-
if (existingBlindedThreadIDs.isNotEmpty()) {
136-
configFactory.withMutableUserConfigs { configs ->
131+
configFactory.withMutableUserConfigs { configs ->
132+
// If we ever have any blinded conversations with this sender, we should make
133+
// sure we have set "approved" to true for them, because when we started the blinded
134+
// conversation, we didn't know their real standard addresses, so we didn't say
135+
// we have approved them, but now that we do, we need to approve them.
136+
if (existingBlindedThreadIDs.isNotEmpty()) {
137137
configs.contacts.updateContact(messageSender.address) {
138138
approved = true
139139
}
140140
}
141+
142+
// Also remove all blinded contacts
143+
for (address in blindedConversationAddresses) {
144+
configs.contacts.eraseBlinded(
145+
communityServerUrl = address.serverUrl,
146+
blindedId = address.blindedId.address
147+
)
148+
}
141149
}
142150
}
143151

0 commit comments

Comments
 (0)