Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 4e870123 authored by Ricki Hirner's avatar Ricki Hirner
Browse files

Merge branch 'dev-3.x_DontShowUnspportedCollections-ose' into dev-3.x-ose

parents 46ee17f0 e2e852c2
Loading
Loading
Loading
Loading
+7 −1
Original line number Diff line number Diff line
@@ -19,7 +19,13 @@ interface CollectionDao: SyncableDao<Collection> {
    @Query("SELECT * FROM collection WHERE serviceId=:serviceId AND type=:type")
    fun getByServiceAndType(serviceId: Long, type: String): List<Collection>

    @Query("SELECT * FROM collection WHERE serviceId=:serviceId AND type=:type ORDER BY displayName, url")
    /**
     * Returns collections which
     *   - support VEVENT and/or VTODO (= supported calendar collections), or
     *   - have supportsVEVENT = supportsVTODO = null (= address books)
     */
    @Query("SELECT * FROM collection WHERE serviceId=:serviceId AND type=:type " +
            "AND (supportsVTODO OR supportsVEVENT OR (supportsVEVENT IS NULL AND supportsVTODO IS NULL))")
    fun pageByServiceAndType(serviceId: Long, type: String): DataSource.Factory<Int, Collection>

    @Query("SELECT * FROM collection WHERE serviceId=:serviceId AND sync ORDER BY displayName, url")