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

Commit e2e852c2 authored by Patrick's avatar Patrick Committed by Ricki Hirner
Browse files

Exclude unsupported calendar collections

Excludes calendar collections that have both VEVENT and VTODO not supported from being displayed in the collections overview.
parent b84ef186
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")
Compare b22853c1 to 047e48f9
Original line number Diff line number Diff line
Subproject commit b22853c12d0d5906d0a1b22e213ccf6fa7f17103
Subproject commit 047e48f9b5dddbc726d36b3677c01d223b6ad2dd
Compare 5a3409ab to e4c50b34
Original line number Diff line number Diff line
Subproject commit 5a3409abbfe2ec61388198935b3465c5fd2471a8
Subproject commit e4c50b34855ab13a4e789dccf394b8ba7b80c2e6
Compare aab52013 to 10d04713
Original line number Diff line number Diff line
Subproject commit aab5201325daa199b1298329aee6cbbb3c2f9e6b
Subproject commit 10d04713b4ae041b725233c5e7cdfc707c108df2