diff --git a/common/scripts/version.txt b/common/scripts/version.txt index 11e837dd69..293d8d75c6 100644 --- a/common/scripts/version.txt +++ b/common/scripts/version.txt @@ -1 +1 @@ -"0.7.136" +"0.7.145" diff --git a/models/calendar/src/index.ts b/models/calendar/src/index.ts index 4ac6a2cfed..904209223f 100644 --- a/models/calendar/src/index.ts +++ b/models/calendar/src/index.ts @@ -140,6 +140,8 @@ export class TEvent extends TAttachedDoc implements Event { timeZone?: string user!: PersonId + + blockTime!: boolean } @Model(calendar.class.ReccuringEvent, calendar.class.Event) diff --git a/models/calendar/src/migration.ts b/models/calendar/src/migration.ts index f68381eb6c..53cec14179 100644 --- a/models/calendar/src/migration.ts +++ b/models/calendar/src/migration.ts @@ -295,6 +295,11 @@ async function fillUser (client: MigrationClient): Promise { } } +async function fillBlockTime (client: MigrationClient): Promise { + await client.update(DOMAIN_EVENT, { blockTime: { $exists: false }, allDay: true }, { blockTime: false }) + await client.update(DOMAIN_EVENT, { blockTime: { $exists: false } }, { blockTime: true }) +} + async function migrateTimezone (client: MigrationClient): Promise { await client.update( DOMAIN_CALENDAR, @@ -354,6 +359,11 @@ export const calendarOperation: MigrateOperation = { state: 'fill-user-v2', mode: 'upgrade', func: fillUser + }, + { + state: 'fill-block-time', + mode: 'upgrade', + func: fillBlockTime } ]) }, diff --git a/plugins/calendar-resources/src/components/CalendarView.svelte b/plugins/calendar-resources/src/components/CalendarView.svelte index aac6106caf..a3b8df5ef9 100644 --- a/plugins/calendar-resources/src/components/CalendarView.svelte +++ b/plugins/calendar-resources/src/components/CalendarView.svelte @@ -262,6 +262,7 @@ collection: 'events', calendar: `${acc.uuid}_calendar` as Ref, modifiedBy: myPrimaryId, + blockTime: true, participants: [me], modifiedOn: Date.now(), date: e.detail.date.getTime(), diff --git a/plugins/calendar-resources/src/components/CreateEvent.svelte b/plugins/calendar-resources/src/components/CreateEvent.svelte index 4fec9931cc..6921c253d1 100644 --- a/plugins/calendar-resources/src/components/CreateEvent.svelte +++ b/plugins/calendar-resources/src/components/CreateEvent.svelte @@ -136,6 +136,7 @@ visibility, title, location, + blockTime: !allDay, allDay, access: 'owner', originalStartTime: allDay ? saveUTC(date) : date, @@ -163,6 +164,7 @@ reminders, title, location, + blockTime: !allDay, allDay, timeZone, access: 'owner', diff --git a/plugins/calendar-resources/src/components/CreateReminder.svelte b/plugins/calendar-resources/src/components/CreateReminder.svelte index c7c946d9da..97b1fa01ce 100644 --- a/plugins/calendar-resources/src/components/CreateReminder.svelte +++ b/plugins/calendar-resources/src/components/CreateReminder.svelte @@ -54,6 +54,7 @@ participants, title: _title, allDay: false, + blockTime: false, reminders: [0], access: 'owner', user: getCurrentAccount().primarySocialId diff --git a/plugins/calendar-resources/src/index.ts b/plugins/calendar-resources/src/index.ts index 7a464eabfa..0615b616fa 100644 --- a/plugins/calendar-resources/src/index.ts +++ b/plugins/calendar-resources/src/index.ts @@ -108,7 +108,8 @@ async function deleteRecHandler (res: any, object: ReccuringInstance): Promise 0) { res.externalParticipants = participants[1] @@ -463,6 +464,9 @@ export class IncomingSyncManager { ? 'public' : (event.extendedProperties?.private?.visibility as Visibility) ?? 'private' } + if (event.transparency != null) { + res.blockTime = event.transparency !== 'transparent' + } return res }