Fix duplicated messages

The insert into SMS database was called twice, which caused duplicated messages to be created. This ended up breaking all sorts of functionality.
This commit is contained in:
Inhishonor
2025-12-14 17:00:27 -08:00
parent b4bce2c1a9
commit 8e355fee58
@@ -738,12 +738,6 @@ open class MessageRepositoryImpl @Inject constructor(
var managedMessage: Message? = null
realm.executeTransaction { managedMessage = realm.copyToRealmOrUpdate(message) }
context.contentResolver.insert(Sms.Inbox.CONTENT_URI, values)
?.lastPathSegment?.toLong()?.let { id ->
// Update contentId after the message has been inserted to the content provider
realm.executeTransaction { managedMessage?.contentId = id }
}
managedMessage?.let { savedMessage ->
val parsedReaction = reactions.parseEmojiReaction(body)
if (parsedReaction != null) {