diff --git a/keyserver/src/responders/entry-responders.js b/keyserver/src/responders/entry-responders.js --- a/keyserver/src/responders/entry-responders.js +++ b/keyserver/src/responders/entry-responders.js @@ -71,6 +71,10 @@ type: tString(calendarThreadFilterTypes.THREAD_LIST), threadIDs: t.list(t.String), }), + tShape({ + type: tString(calendarThreadFilterTypes.COMMUNITY), + threadIDs: t.list(t.String), + }), ]), ), }); diff --git a/lib/types/filter-types.js b/lib/types/filter-types.js --- a/lib/types/filter-types.js +++ b/lib/types/filter-types.js @@ -5,16 +5,24 @@ export const calendarThreadFilterTypes = Object.freeze({ THREAD_LIST: 'threads', NOT_DELETED: 'not_deleted', + COMMUNITY: 'community', }); export type CalendarThreadFilterType = $Values< typeof calendarThreadFilterTypes, >; +export type CalendarCommunityFilter = { + +type: 'community', + +threadIDs: $ReadOnlyArray, +}; export type CalendarThreadFilter = { +type: 'threads', +threadIDs: $ReadOnlyArray, }; -export type CalendarFilter = { +type: 'not_deleted' } | CalendarThreadFilter; +export type CalendarFilter = + | { +type: 'not_deleted' } + | CalendarThreadFilter + | CalendarCommunityFilter; export const defaultCalendarFilters: $ReadOnlyArray = [ { type: calendarThreadFilterTypes.NOT_DELETED }, @@ -23,6 +31,8 @@ export const updateCalendarThreadFilter = 'UPDATE_CALENDAR_THREAD_FILTER'; export const clearCalendarThreadFilter = 'CLEAR_CALENDAR_THREAD_FILTER'; export const setCalendarDeletedFilter = 'SET_CALENDAR_DELETED_FILTER'; +export const updateCalendarCommunityFilter = 'UPDATE_CALENDAR_COMMUNITY_FILTER'; +export const clearCalendarCommunityFilter = 'CLEAR_CALENDAR_COMMUNITY_FILTER'; export type SetCalendarDeletedFilterPayload = { +includeDeleted: boolean, diff --git a/lib/types/redux-types.js b/lib/types/redux-types.js --- a/lib/types/redux-types.js +++ b/lib/types/redux-types.js @@ -30,6 +30,7 @@ CalendarFilter, CalendarThreadFilter, SetCalendarDeletedFilterPayload, + CalendarCommunityFilter, } from './filter-types'; import type { LifecycleState } from './lifecycle-state-types'; import type { LoadingStatus, LoadingInfo } from './loading-types'; @@ -678,6 +679,14 @@ +type: 'SET_CALENDAR_DELETED_FILTER', +payload: SetCalendarDeletedFilterPayload, } + | { + +type: 'UPDATE_CALENDAR_COMMUNITY_FILTER', + +payload: CalendarCommunityFilter, + } + | { + +type: 'CLEAR_CALENDAR_COMMUNITY_FILTER', + +payload: void, + } | { +type: 'UPDATE_SUBSCRIPTION_STARTED', +payload?: void,