forked from upstream-mirrors/quik
Allow manual sending of scheduled messages
This commit is contained in:
@@ -22,9 +22,9 @@ import android.app.Activity
|
||||
import android.app.Application
|
||||
import android.app.Service
|
||||
import android.content.BroadcastReceiver
|
||||
import androidx.core.provider.FontRequest
|
||||
import androidx.emoji.text.EmojiCompat
|
||||
import androidx.emoji.text.FontRequestEmojiCompatConfig
|
||||
import androidx.core.provider.FontRequest
|
||||
import com.akaita.java.rxjava2debug.RxJava2Debug
|
||||
import com.bugsnag.android.Bugsnag
|
||||
import com.bugsnag.android.Configuration
|
||||
@@ -69,7 +69,7 @@ class QKApplication : Application(), HasActivityInjector, HasBroadcastReceiverIn
|
||||
projectPackages = packages
|
||||
})
|
||||
|
||||
RxJava2Debug.enableRxJava2AssemblyTracking(packages)
|
||||
RxJava2Debug.enableRxJava2AssemblyTracking()
|
||||
|
||||
Realm.init(this)
|
||||
Realm.setDefaultConfiguration(RealmConfiguration.Builder()
|
||||
|
||||
+5
-1
@@ -7,6 +7,7 @@ import com.moez.QKSMS.R
|
||||
import com.moez.QKSMS.common.base.QkRealmAdapter
|
||||
import com.moez.QKSMS.common.base.QkViewHolder
|
||||
import com.moez.QKSMS.common.util.DateFormatter
|
||||
import com.moez.QKSMS.interactor.SendScheduledMessage
|
||||
import com.moez.QKSMS.model.Contact
|
||||
import com.moez.QKSMS.model.PhoneNumber
|
||||
import com.moez.QKSMS.model.Recipient
|
||||
@@ -18,7 +19,8 @@ import javax.inject.Inject
|
||||
|
||||
class ScheduledMessageAdapter @Inject constructor(
|
||||
private val contactRepo: ContactRepository,
|
||||
private val dateFormatter: DateFormatter
|
||||
private val dateFormatter: DateFormatter,
|
||||
private val sendScheduledMessage: SendScheduledMessage
|
||||
) : QkRealmAdapter<ScheduledMessage>() {
|
||||
|
||||
private val contacts by lazy { contactRepo.getContacts() }
|
||||
@@ -32,6 +34,8 @@ class ScheduledMessageAdapter @Inject constructor(
|
||||
val message = getItem(position)!!
|
||||
val view = holder.itemView
|
||||
|
||||
view.setOnClickListener { sendScheduledMessage.execute(message.id) }
|
||||
|
||||
message.recipients.forEach { address ->
|
||||
if (!contactMap.containsKey(address)) {
|
||||
contactMap[address] = contacts
|
||||
|
||||
Reference in New Issue
Block a user