mirror of
https://github.com/quik-sms/quik.git
synced 2026-11-17 19:38:52 +01:00
Remove unnecessary constructor
This commit is contained in:
@@ -12,9 +12,4 @@ open class Contact() : RealmObject() {
|
||||
|
||||
var inContactsTable: Boolean = false
|
||||
|
||||
constructor(id: Long, address: String) : this() {
|
||||
this.recipientId = id
|
||||
this.address = address
|
||||
}
|
||||
|
||||
}
|
||||
@@ -62,7 +62,10 @@ class ContactRepository @Inject constructor(val context: Context) {
|
||||
private fun getContactFromDb(recipientId: Long): Contact? {
|
||||
context.contentResolver.query(Uri.withAppendedPath(URI, recipientId.toString()), null, null, null, null)?.use { recipientCursor ->
|
||||
if (recipientCursor.moveToFirst()) {
|
||||
val contact = Contact(recipientId, recipientCursor.getString(0))
|
||||
val contact = Contact().apply {
|
||||
this.recipientId = recipientId
|
||||
this.address = recipientCursor.getString(0)
|
||||
}
|
||||
|
||||
val contactUri = Uri.withAppendedPath(ContactsContract.PhoneLookup.CONTENT_FILTER_URI, Uri.encode(contact.address))
|
||||
val projection = arrayOf(BaseColumns._ID, ContactsContract.PhoneLookup.DISPLAY_NAME, ContactsContract.PhoneLookup.LOOKUP_KEY)
|
||||
|
||||
Reference in New Issue
Block a user