Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 2aa2f2cc authored by Moez Bhatti's avatar Moez Bhatti
Browse files

Store stripped message

#1149
parent e37be08a
Loading
Loading
Loading
Loading
+8 −2
Original line number Diff line number Diff line
@@ -302,10 +302,16 @@ class MessageRepositoryImpl @Inject constructor(
            else -> prefs.signature.get()
        }

        // We only care about stripping SMS
        val strippedBody = when (prefs.unicode.get()) {
            true -> StripAccents.stripAccents(signedBody)
            false -> signedBody
        }

        if (addresses.size == 1 && attachments.isEmpty()) { // SMS
            if (delay > 0) { // With delay
                val sendTime = System.currentTimeMillis() + delay
                val message = insertSentSms(subId, threadId, addresses.first(), signedBody, sendTime)
                val message = insertSentSms(subId, threadId, addresses.first(), strippedBody, sendTime)

                val intent = getIntentForDelayedSms(message.id)

@@ -316,7 +322,7 @@ class MessageRepositoryImpl @Inject constructor(
                    alarmManager.setExact(AlarmManager.RTC_WAKEUP, sendTime, intent)
                }
            } else { // No delay
                val message = insertSentSms(subId, threadId, addresses.first(), signedBody, System.currentTimeMillis())
                val message = insertSentSms(subId, threadId, addresses.first(), strippedBody, System.currentTimeMillis())
                sendSms(message)
            }
        } else { // MMS