Use Recipient instead of Chip

This commit is contained in:
Moez Bhatti
2020-01-12 02:02:39 -05:00
parent 7d9cd35c7c
commit abd198db81
11 changed files with 55 additions and 71 deletions
@@ -37,11 +37,10 @@ class CursorToRecipientImpl @Inject constructor(
const val COLUMN_ADDRESS = 1
}
override fun map(from: Cursor) = Recipient().apply {
id = from.getLong(COLUMN_ID)
address = from.getString(COLUMN_ADDRESS)
lastUpdate = System.currentTimeMillis()
}
override fun map(from: Cursor) = Recipient(
id = from.getLong(COLUMN_ID),
address = from.getString(COLUMN_ADDRESS),
lastUpdate = System.currentTimeMillis())
override fun getRecipientCursor(): Cursor? {
return when (permissionManager.hasReadSms()) {
@@ -220,6 +220,12 @@ class ConversationRepositoryImpl @Inject constructor(
.observeOn(Schedulers.io())
}
override fun getRecipients(): RealmResults<Recipient> {
val realm = Realm.getDefaultInstance()
return realm.where(Recipient::class.java)
.findAll()
}
override fun getUnmanagedRecipients(): Observable<List<Recipient>> {
val realm = Realm.getDefaultInstance()
return realm.where(Recipient::class.java)