feat(calendar): Can defined the Jitsi server url for meeting created

This commit is contained in:
Hivert Quentin
2025-02-03 14:19:02 +01:00
parent 092e7694e0
commit 9f4f48a44f
6 changed files with 34 additions and 2 deletions

View File

@@ -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

View File

@@ -77,6 +77,7 @@
- (BOOL) appointmentSendEMailNotifications;
- (BOOL) foldersSendEMailNotifications;
- (NSArray *) calendarDefaultRoles;
- (NSString *) calendarJistiBaseUrl;
- (NSArray *) contactsDefaultRoles;
- (NSArray *) refreshViewIntervals;
- (NSString *) subscriptionFolderFormat;

View File

@@ -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"];

View File

@@ -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

View File

@@ -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;
}
}

View File

@@ -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);
};