- differentiate between sent sms and delivered sms by updating the SmsStatusSentReceiver which updates the type to Telephony.Sms.MESSAGE_TYPE_SENT or Telephony.Sms.MESSAGE_TYPE_FAILED depending on the outcome. - rename ThreadSuccess to ThreadSent and add a boolean field for the delivery status - SmsStatusSentReceiver updates the status of the message to Telephony.Sms.STATUS_COMPLETE. - accommodate for the need to keep track of the status by adding Int field status to the Message class, - add appropriate database migrations (3 to 4) for the new status field. - add status to the query for sms in extension function Context.getMessages and Context.getMMS - add extension function Context.updateMessageStatus to update the status of a message in the database
37 lines
1.3 KiB
Kotlin
37 lines
1.3 KiB
Kotlin
package com.simplemobiletools.smsmessenger.helpers
|
|
|
|
import com.simplemobiletools.smsmessenger.models.Events
|
|
import org.greenrobot.eventbus.EventBus
|
|
|
|
const val THREAD_ID = "thread_id"
|
|
const val THREAD_TITLE = "thread_title"
|
|
const val THREAD_TEXT = "thread_text"
|
|
const val THREAD_NUMBER = "thread_number"
|
|
const val THREAD_ATTACHMENT_URI = "thread_attachment_uri"
|
|
const val THREAD_ATTACHMENT_URIS = "thread_attachment_uris"
|
|
const val SEARCHED_MESSAGE_ID = "searched_message_id"
|
|
const val USE_SIM_ID_PREFIX = "use_sim_id_"
|
|
const val NOTIFICATION_CHANNEL = "simple_sms_messenger"
|
|
const val SHOW_CHARACTER_COUNTER = "show_character_counter"
|
|
const val LOCK_SCREEN_VISIBILITY = "lock_screen_visibility"
|
|
|
|
private const val PATH = "com.simplemobiletools.smsmessenger.action."
|
|
const val MARK_AS_READ = PATH + "mark_as_read"
|
|
const val REPLY = PATH + "reply"
|
|
|
|
// view types for the thread list view
|
|
const val THREAD_DATE_TIME = 1
|
|
const val THREAD_RECEIVED_MESSAGE = 2
|
|
const val THREAD_SENT_MESSAGE = 3
|
|
const val THREAD_SENT_MESSAGE_ERROR = 4
|
|
const val THREAD_SENT_MESSAGE_SENT = 5
|
|
const val THREAD_SENT_MESSAGE_SENDING = 6
|
|
|
|
// lock screen visibility constants
|
|
const val LOCK_SCREEN_SENDER_MESSAGE = 1
|
|
const val LOCK_SCREEN_SENDER = 2
|
|
const val LOCK_SCREEN_NOTHING = 3
|
|
|
|
fun refreshMessages() {
|
|
EventBus.getDefault().post(Events.RefreshMessages())
|
|
}
|