Commit 62f84205 authored by narinder Rana's avatar narinder Rana
Browse files

Merge branch '141-stripAccent-body' into 'main'

update for stripped body

See merge request !55
parents f5ad1369 6ef918be
Pipeline #175591 passed with stage
in 15 minutes and 32 seconds
......@@ -311,19 +311,10 @@ class MessageRepositoryImpl @Inject constructor(
?.let(SmsManagerFactory::createSmsManager)
?: SmsManager.getDefault()
// We only care about stripping SMS
val strippedBody = when (prefs.unicode.get()) {
true -> StripAccents.stripAccents(signedBody)
false -> signedBody
}
val parts = smsManager.divideMessage(strippedBody).orEmpty()
val forceMms = prefs.longAsMms.get() && parts.size > 1
if (addresses.size == 1 && attachments.isEmpty() && !forceMms) { // SMS
if (addresses.size == 1 && attachments.isEmpty()) { // SMS
if (delay > 0) { // With delay
val sendTime = System.currentTimeMillis() + delay
val message = insertSentSms(subId, threadId, addresses.first(), strippedBody, sendTime)
val message = insertSentSms(subId, threadId, addresses.first(), signedBody, sendTime)
val intent = getIntentForDelayedSms(message.id)
......@@ -334,10 +325,11 @@ class MessageRepositoryImpl @Inject constructor(
alarmManager.setExact(AlarmManager.RTC_WAKEUP, sendTime, intent)
}
} else { // No delay
val message = insertSentSms(subId, threadId, addresses.first(), strippedBody, now())
val message = insertSentSms(subId, threadId, addresses.first(), signedBody, System.currentTimeMillis())
sendSms(message)
}
} else { // MMS
}
else { // MMS
val parts = arrayListOf<MMSPart>()
val maxWidth = smsManager.carrierConfigValues.getInt(SmsManager.MMS_CONFIG_MAX_IMAGE_WIDTH)
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment