diff --git a/Documentation/SOGoInstallationGuide.asciidoc b/Documentation/SOGoInstallationGuide.asciidoc index 9b51417f5..130261fd8 100644 --- a/Documentation/SOGoInstallationGuide.asciidoc +++ b/Documentation/SOGoInstallationGuide.asciidoc @@ -484,6 +484,12 @@ platform that Jitsi supports: Google, Facebook or Github Defaults to `NO` when unset. +|D |SOGoCalendarJitsiBaseUrl +|Only used if SOGoCalendarEnableJitsiLink is set to YES. String for the URL of +the jitsi server used for creating the meeting link. + +Defaults to `https://meet.jit.si` when unset. + |S |SOGoSAML2PrivateKeyLocation |The location of the SSL private key file on the filesystem that is used by SOGo to sign and encrypt communications with the SAML2 identity diff --git a/SoObjects/SOGo/SOGoDomainDefaults.h b/SoObjects/SOGo/SOGoDomainDefaults.h index f7bddceee..c7fe90199 100644 --- a/SoObjects/SOGo/SOGoDomainDefaults.h +++ b/SoObjects/SOGo/SOGoDomainDefaults.h @@ -77,6 +77,7 @@ - (BOOL) appointmentSendEMailNotifications; - (BOOL) foldersSendEMailNotifications; - (NSArray *) calendarDefaultRoles; +- (NSString *) calendarJistiBaseUrl; - (NSArray *) contactsDefaultRoles; - (NSArray *) refreshViewIntervals; - (NSString *) subscriptionFolderFormat; diff --git a/SoObjects/SOGo/SOGoDomainDefaults.m b/SoObjects/SOGo/SOGoDomainDefaults.m index c67e83b59..089296528 100644 --- a/SoObjects/SOGo/SOGoDomainDefaults.m +++ b/SoObjects/SOGo/SOGoDomainDefaults.m @@ -169,6 +169,16 @@ return [self stringArrayForKey: @"SOGoCalendarDefaultRoles"]; } +- (NSString *) calendarJistiBaseUrl +{ + NSString *jitsiBaseUrl; + jitsiBaseUrl = [self stringForKey: @"SOGoCalendarJitsiBaseUrl"]; + if(!jitsiBaseUrl) + jitsiBaseUrl = @"https://meet.jit.si"; + + return jitsiBaseUrl; +} + - (NSArray *) contactsDefaultRoles { return [self stringArrayForKey: @"SOGoContactsDefaultRoles"]; diff --git a/UI/PreferencesUI/UIxJSONPreferences.m b/UI/PreferencesUI/UIxJSONPreferences.m index a2cfd3f1f..4655aff52 100644 --- a/UI/PreferencesUI/UIxJSONPreferences.m +++ b/UI/PreferencesUI/UIxJSONPreferences.m @@ -147,6 +147,7 @@ static SoProduct *preferencesProduct = nil; NSMutableDictionary *values, *account, *vacation; SOGoUserDefaults *defaults; SOGoDomainDefaults *domainDefaults; + SOGoSystemDefaults *sd; NSMutableArray *accounts; NSDictionary *calendarCategoryLabels, *contactsCategoriesLabels, *vacationOptions; @@ -333,6 +334,13 @@ static SoProduct *preferencesProduct = nil; [defaults setCalendarCategoriesColors: colors]; } } + // Add the jisti link if needed + sd = [SOGoSystemDefaults sharedSystemDefaults]; + if([sd isCalendarJitsiLinkEnabled]) + { + if (![[defaults source] objectForKey: @"SOGoCalendarJitsiBaseUrl"]) + [[defaults source] setObject: [domainDefaults calendarJistiBaseUrl] forKey: @"SOGoCalendarJitsiBaseUrl"]; + } // // Default Contacts preferences diff --git a/UI/WebServerResources/js/Scheduler/Component.service.js b/UI/WebServerResources/js/Scheduler/Component.service.js index da6df5807..1c0946417 100644 --- a/UI/WebServerResources/js/Scheduler/Component.service.js +++ b/UI/WebServerResources/js/Scheduler/Component.service.js @@ -848,8 +848,11 @@ return false; } else { + var jitsiBaseUrl = "https://meet.jit.si"; + if(Component.$Preferences.defaults && Component.$Preferences.defaults.SOGoCalendarJitsiBaseUrl) + jitsiBaseUrl = Component.$Preferences.defaults.SOGoCalendarJitsiBaseUrl; for (var i = 0; i < this.attachUrls.length; i++) { - if (this.attachUrls[i].value.includes("meet.jit.si")) { + if (this.attachUrls[i].value.includes(jitsiBaseUrl)) { return true; } } diff --git a/UI/WebServerResources/js/Scheduler/ComponentController.js b/UI/WebServerResources/js/Scheduler/ComponentController.js index 0dbbec769..f33eb34f3 100644 --- a/UI/WebServerResources/js/Scheduler/ComponentController.js +++ b/UI/WebServerResources/js/Scheduler/ComponentController.js @@ -232,6 +232,7 @@ this.showAttendeesEditor = this.component.attendees && this.component.attendees.length; this.isFullscreen = (typeof screen.orientation !== 'undefined' && screen.orientation && 'portrait-primary' == screen.orientation.type); this.originalModalCancel = $mdDialog.cancel; + this.preferences = Preferences; if (this.component.type == 'appointment') { this.component.initAttendees(); @@ -314,7 +315,10 @@ }; this.addJitsiUrl = function () { - var jitsiUrl = "https://meet.jit.si/SOGo_meeting/" + crypto.randomUUID(); + var jitsiBaseUrl = "https://meet.jit.si"; + if(this.preferences.defaults && this.preferences.defaults.SOGoCalendarJitsiBaseUrl) + jitsiBaseUrl = this.preferences.defaults.SOGoCalendarJitsiBaseUrl; + var jitsiUrl = jitsiBaseUrl + "/SOGo_meeting/" + crypto.randomUUID(); var i = this.component.addAttachUrl(jitsiUrl); focus('attachUrl_' + i); };