Allow converting to OAuth

This commit is contained in:
M66B
2021-12-24 08:18:25 +01:00
parent 4bf9e9cc85
commit 09c2fcb1c4
5 changed files with 22 additions and 16 deletions

View File

@@ -150,8 +150,8 @@ public interface DaoAccount {
@Query("SELECT * FROM account" +
" WHERE user = :user" +
" AND auth_type = :auth_type")
List<EntityAccount> getAccounts(String user, int auth_type);
" AND auth_type IN (:auth_type)")
List<EntityAccount> getAccounts(String user, int[] auth_type);
@Query("SELECT * FROM account WHERE `primary`")
EntityAccount getPrimaryAccount();
@@ -204,8 +204,11 @@ public interface DaoAccount {
@Query("UPDATE account SET name = :name WHERE id = :id AND NOT (name IS :name)")
int setAccountName(long id, String name);
@Query("UPDATE account SET password = :password WHERE id = :id AND NOT (password IS :password)")
int setAccountPassword(long id, String password);
@Query("UPDATE account" +
" SET password = :password, auth_type = :auth_type" +
" WHERE id = :id" +
" AND NOT (password IS :password AND auth_type = :auth_type)")
int setAccountPassword(long id, String password, int auth_type);
@Query("UPDATE account SET last_connected = :last_connected WHERE id = :id AND NOT (last_connected IS :last_connected)")
int setAccountConnected(long id, Long last_connected);