Add a Jitsi video conference to events on Core calendars
The event editor offers "Add Video Conference" on the calendars of a Federated Computer Core. It makes a room with an unguessable name, like BraveOttersSing-k3f9x2m7, on the Core's Jitsi at jitsi.<CORE_DOMAIN>, and shows its link with Copy and Remove buttons. The link goes at the end of the event's notes, which reach everyone invited whatever their mail app, and in an RFC 7986 CONFERENCE property. Saving puts the link back in the notes if it was taken out, and "All events" copies the conference to the whole series. Existing conferences are found in CONFERENCE, or as Jitsi links in the notes or location, so the editor doesn't offer a second one and the popover shows a Join button. The popover now keeps showing a place in the location alongside a meeting. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
@@ -29,6 +29,7 @@
|
||||
#include "gcal-event-editor-section.h"
|
||||
#include "gcal-event.h"
|
||||
#include "gcal-federated-core.h"
|
||||
#include "gcal-jitsi.h"
|
||||
#include "gcal-notes-section.h"
|
||||
#include "gcal-reminders-section.h"
|
||||
#include "gcal-schedule-section.h"
|
||||
@@ -171,6 +172,29 @@ update_invite_state (GcalEventEditorDialog *self)
|
||||
gtk_widget_set_visible (GTK_WIDGET (self->attendees_section), organizer != NULL || can_invite);
|
||||
}
|
||||
|
||||
/*
|
||||
* Events on the calendars of a Federated Computer Core can have a video
|
||||
* conference on the Core's Jitsi server.
|
||||
*/
|
||||
static void
|
||||
update_conference_state (GcalEventEditorDialog *self)
|
||||
{
|
||||
g_autofree gchar *server = NULL;
|
||||
GcalCalendar *calendar;
|
||||
|
||||
if (!self->edited_event)
|
||||
return;
|
||||
|
||||
calendar = gcal_calendar_combo_row_get_calendar (self->calendar_combo_row);
|
||||
if (!calendar)
|
||||
calendar = gcal_event_get_calendar (self->edited_event);
|
||||
|
||||
if (self->writable && calendar)
|
||||
server = gcal_federated_core_get_jitsi_server (calendar);
|
||||
|
||||
gcal_summary_section_set_conference_server (GCAL_SUMMARY_SECTION (self->summary_section), server);
|
||||
}
|
||||
|
||||
static void
|
||||
set_event (GcalEventEditorDialog *self,
|
||||
GcalEvent *event,
|
||||
@@ -209,6 +233,7 @@ set_event (GcalEventEditorDialog *self,
|
||||
|
||||
set_writable (self, !gcal_calendar_is_read_only (calendar));
|
||||
update_invite_state (self);
|
||||
update_conference_state (self);
|
||||
|
||||
gtk_widget_set_visible (self->cancel_button, self->writable);
|
||||
|
||||
@@ -280,6 +305,10 @@ apply_event_properties_to_template_event (GcalEvent *template_event,
|
||||
|
||||
if (!gcal_event_attendees_equal (template_event, event))
|
||||
gcal_event_copy_attendees (template_event, event);
|
||||
|
||||
/* A conference added to one occurrence is for the whole series */
|
||||
if (!gcal_event_conferences_equal (template_event, event))
|
||||
gcal_event_copy_conferences (template_event, event);
|
||||
}
|
||||
|
||||
static void
|
||||
@@ -320,7 +349,7 @@ save_event (GcalEventEditorDialog *self,
|
||||
GcalContext *context;
|
||||
GcalManager *manager;
|
||||
|
||||
gboolean calendar_equal, alarms_equal, schedule_equal, strings_equal, attendees_equal, event_equal;
|
||||
gboolean calendar_equal, alarms_equal, schedule_equal, strings_equal, attendees_equal, conferences_equal, event_equal;
|
||||
|
||||
GCAL_ENTRY;
|
||||
|
||||
@@ -337,12 +366,16 @@ save_event (GcalEventEditorDialog *self,
|
||||
gcal_event_set_organizer (self->edited_event, NULL, NULL);
|
||||
}
|
||||
|
||||
/* The people invited get the conference's link in the description */
|
||||
gcal_jitsi_ensure_description (self->edited_event);
|
||||
|
||||
calendar_equal = selected_calendar && calendar == selected_calendar;
|
||||
alarms_equal = gcal_event_alarms_equal (self->event, self->edited_event);
|
||||
schedule_equal = gcal_event_schedule_equal (self->event, self->edited_event);
|
||||
strings_equal = gcal_event_strings_equal (self->event, self->edited_event);
|
||||
attendees_equal = gcal_event_attendees_equal (self->event, self->edited_event);
|
||||
event_equal = calendar_equal && alarms_equal && schedule_equal && strings_equal && attendees_equal;
|
||||
conferences_equal = gcal_event_conferences_equal (self->event, self->edited_event);
|
||||
event_equal = calendar_equal && alarms_equal && schedule_equal && strings_equal && attendees_equal && conferences_equal;
|
||||
|
||||
if (self->event_is_new)
|
||||
{
|
||||
@@ -428,6 +461,7 @@ static void
|
||||
on_calendar_selected_cb (GcalEventEditorDialog *self)
|
||||
{
|
||||
update_invite_state (self);
|
||||
update_conference_state (self);
|
||||
}
|
||||
|
||||
static void
|
||||
|
||||
Reference in New Issue
Block a user