From 61e0a12a504e6650961e210d6dda2c4b0c8c4595 Mon Sep 17 00:00:00 2001 From: Christian Basler Date: Tue, 20 Feb 2018 22:48:39 +0100 Subject: [PATCH] Don't show addresses without alias as contacts Those normally aren't of interest, and can now be retrieved via message. --- .../apps/abit/repository/AndroidAddressRepository.kt | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/app/src/main/java/ch/dissem/apps/abit/repository/AndroidAddressRepository.kt b/app/src/main/java/ch/dissem/apps/abit/repository/AndroidAddressRepository.kt index 60623f2..3cadaf3 100644 --- a/app/src/main/java/ch/dissem/apps/abit/repository/AndroidAddressRepository.kt +++ b/app/src/main/java/ch/dissem/apps/abit/repository/AndroidAddressRepository.kt @@ -68,15 +68,15 @@ class AndroidAddressRepository(private val sql: SqlHelper) : AddressRepository { * Returns the contacts in the following order: * * * Subscribed addresses come first - * * Addresses with Aliases (alphabetically) - * * Addresses (alphabetically) + * * Addresses with aliases (alphabetically) + * * Addresses without aliases are omitted * * * @return the ordered list of ids (address strings) */ fun getContactIds(): List = findIds( - "private_key IS NULL OR chan = '1'", - "$COLUMN_SUBSCRIBED DESC, $COLUMN_ALIAS IS NULL, $COLUMN_ALIAS, $COLUMN_ADDRESS" + "($COLUMN_PRIVATE_KEY IS NULL OR $COLUMN_CHAN = '1') AND $COLUMN_ALIAS IS NOT NULL", + "$COLUMN_SUBSCRIBED DESC, $COLUMN_ALIAS, $COLUMN_ADDRESS" ) private fun findIds(where: String, orderBy: String): List {