Merge pull request #2423 from xaep/master
Make sure auth key selection dialog lists only keys with auth subkey available.
This commit is contained in:
commit
82025ea8bc
|
@ -164,6 +164,11 @@ public class KeyRepository extends AbstractDao {
|
|||
return mapAllRows(query, SubKey.UNIFIED_KEY_INFO_MAPPER);
|
||||
}
|
||||
|
||||
public List<UnifiedKeyInfo> getAllUnifiedKeyInfoWithAuthKeySecret() {
|
||||
SqlDelightQuery query = SubKey.FACTORY.selectAllUnifiedKeyInfoWithAuthKeySecret();
|
||||
return mapAllRows(query, SubKey.UNIFIED_KEY_INFO_MAPPER);
|
||||
}
|
||||
|
||||
public List<UserId> getUserIds(long... masterKeyIds) {
|
||||
SqlDelightQuery query = UserPacket.FACTORY.selectUserIdsByMasterKeyId(masterKeyIds);
|
||||
return mapAllRows(query, UserPacket.USER_ID_MAPPER);
|
||||
|
|
|
@ -104,7 +104,7 @@ public class RemoteSelectAuthenticationKeyActivity extends FragmentActivity {
|
|||
if (keyInfoLiveData == null) {
|
||||
keyInfoLiveData = new GenericLiveData<>(context, () -> {
|
||||
KeyRepository keyRepository = KeyRepository.create(context);
|
||||
return keyRepository.getAllUnifiedKeyInfoWithSecret();
|
||||
return keyRepository.getAllUnifiedKeyInfoWithAuthKeySecret();
|
||||
});
|
||||
}
|
||||
return keyInfoLiveData;
|
||||
|
|
|
@ -92,6 +92,11 @@ SELECT * FROM unifiedKeyView
|
|||
WHERE has_any_secret_int = 1
|
||||
ORDER BY creation DESC;
|
||||
|
||||
selectAllUnifiedKeyInfoWithAuthKeySecret:
|
||||
SELECT * FROM unifiedKeyView
|
||||
WHERE has_any_secret_int = 1 AND has_auth_key_int IS NOT NULL
|
||||
ORDER BY creation DESC;
|
||||
|
||||
selectMasterKeyIdBySubkey:
|
||||
SELECT master_key_id
|
||||
FROM keys
|
||||
|
|
Loading…
Reference in a new issue