├── images ├── settings.png ├── cmd_install.png ├── modified_calendar.png └── modified_appointment.png ├── setup ├── favicon.ico └── setup.wixproj ├── JitsiMeetOutlook ├── Resources │ ├── favicon.ico │ ├── jitsiLogo_square.png │ ├── languages.Designer.cs │ └── languages.resx ├── README.md ├── CalendarRibbonButton.language.cs ├── ThisAddIn.Designer.xml ├── Entities │ ├── ConferenceSchedulerMessage.cs │ ├── PhoneNumberListResponse.cs │ └── ConferenceMapperResponse.cs ├── RequestCache.cs ├── AppointmentRibbonGroup.language.cs ├── AppointmentRibbonGroup.cs ├── Properties │ ├── AssemblyInfo.cs │ ├── Settings.settings │ ├── Resources.Designer.cs │ ├── Resources.resx │ └── Settings.Designer.cs ├── ThisAddIn.language.cs ├── CalendarRibbonButton.cs ├── packages.config ├── Utils.cs ├── CalendarRibbonButton.Designer.cs ├── JitsiUrl.cs ├── app.config ├── FormSettings.language.cs ├── ThisAddIn.cs ├── CalendarRibbonButton.resx ├── AppointmentRibbonGroup.resx ├── JitsiApiService.cs ├── FormSettings.resx ├── Recurrence.cs ├── FormSettings.cs ├── AppointmentRibbonGroup.Designer.cs └── AppointmentRibbonGroup.controls.cs ├── installers ├── JitsiMeetOutlook-v0.1.0-windows.zip ├── JitsiMeetOutlook-v0.2.0-windows.zip ├── JitsiMeetOutlook-v0.2.1-windows.zip ├── JitsiMeetOutlook-v0.3.0-windows.zip ├── JitsiMeetOutlook-v0.4.0-windows.zip ├── JitsiMeetOutlook-v0.5.0-windows.zip ├── JitsiMeetOutlook-v0.5.1-windows.zip ├── JitsiMeetOutlook-v0.6.0-windows.zip ├── JitsiMeetOutlook-v0.6.1-windows.zip ├── JitsiMeetOutlook-v0.6.2-windows.zip ├── JitsiMeetOutlook-v0.6.3-windows.zip ├── JitsiMeetOutlook-v0.6.4-windows.zip ├── JitsiMeetOutlook-v0.6.5-windows.zip ├── JitsiMeetOutlook-v0.6.6-windows.zip ├── JitsiMeetOutlook-v0.7.0-windows.zip └── JitsiMeetOutlook-install-script.bat ├── JitsiMeetOutlookTests ├── packages.config ├── app.config ├── Properties │ └── AssemblyInfo.cs ├── JitsiMeetOutlookTests.csproj └── TextUtilsTests.cs ├── SettingsInstallerParameters ├── Properties │ └── AssemblyInfo.cs ├── CustomAction.config ├── SettingsInstallerParameters.csproj └── CustomAction.cs ├── .gitattributes ├── JitsiMeetOutlook.sln ├── .gitignore └── README.md /images/settings.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/timetheoretical/jitsi-meet-outlook/HEAD/images/settings.png -------------------------------------------------------------------------------- /setup/favicon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/timetheoretical/jitsi-meet-outlook/HEAD/setup/favicon.ico -------------------------------------------------------------------------------- /images/cmd_install.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/timetheoretical/jitsi-meet-outlook/HEAD/images/cmd_install.png -------------------------------------------------------------------------------- /images/modified_calendar.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/timetheoretical/jitsi-meet-outlook/HEAD/images/modified_calendar.png -------------------------------------------------------------------------------- /images/modified_appointment.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/timetheoretical/jitsi-meet-outlook/HEAD/images/modified_appointment.png -------------------------------------------------------------------------------- /JitsiMeetOutlook/Resources/favicon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/timetheoretical/jitsi-meet-outlook/HEAD/JitsiMeetOutlook/Resources/favicon.ico -------------------------------------------------------------------------------- /installers/JitsiMeetOutlook-v0.1.0-windows.zip: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/timetheoretical/jitsi-meet-outlook/HEAD/installers/JitsiMeetOutlook-v0.1.0-windows.zip -------------------------------------------------------------------------------- /installers/JitsiMeetOutlook-v0.2.0-windows.zip: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/timetheoretical/jitsi-meet-outlook/HEAD/installers/JitsiMeetOutlook-v0.2.0-windows.zip -------------------------------------------------------------------------------- /installers/JitsiMeetOutlook-v0.2.1-windows.zip: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/timetheoretical/jitsi-meet-outlook/HEAD/installers/JitsiMeetOutlook-v0.2.1-windows.zip -------------------------------------------------------------------------------- /installers/JitsiMeetOutlook-v0.3.0-windows.zip: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/timetheoretical/jitsi-meet-outlook/HEAD/installers/JitsiMeetOutlook-v0.3.0-windows.zip -------------------------------------------------------------------------------- /installers/JitsiMeetOutlook-v0.4.0-windows.zip: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/timetheoretical/jitsi-meet-outlook/HEAD/installers/JitsiMeetOutlook-v0.4.0-windows.zip -------------------------------------------------------------------------------- /installers/JitsiMeetOutlook-v0.5.0-windows.zip: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/timetheoretical/jitsi-meet-outlook/HEAD/installers/JitsiMeetOutlook-v0.5.0-windows.zip -------------------------------------------------------------------------------- /installers/JitsiMeetOutlook-v0.5.1-windows.zip: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/timetheoretical/jitsi-meet-outlook/HEAD/installers/JitsiMeetOutlook-v0.5.1-windows.zip -------------------------------------------------------------------------------- /installers/JitsiMeetOutlook-v0.6.0-windows.zip: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/timetheoretical/jitsi-meet-outlook/HEAD/installers/JitsiMeetOutlook-v0.6.0-windows.zip -------------------------------------------------------------------------------- /installers/JitsiMeetOutlook-v0.6.1-windows.zip: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/timetheoretical/jitsi-meet-outlook/HEAD/installers/JitsiMeetOutlook-v0.6.1-windows.zip -------------------------------------------------------------------------------- /installers/JitsiMeetOutlook-v0.6.2-windows.zip: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/timetheoretical/jitsi-meet-outlook/HEAD/installers/JitsiMeetOutlook-v0.6.2-windows.zip -------------------------------------------------------------------------------- /installers/JitsiMeetOutlook-v0.6.3-windows.zip: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/timetheoretical/jitsi-meet-outlook/HEAD/installers/JitsiMeetOutlook-v0.6.3-windows.zip -------------------------------------------------------------------------------- /installers/JitsiMeetOutlook-v0.6.4-windows.zip: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/timetheoretical/jitsi-meet-outlook/HEAD/installers/JitsiMeetOutlook-v0.6.4-windows.zip -------------------------------------------------------------------------------- /installers/JitsiMeetOutlook-v0.6.5-windows.zip: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/timetheoretical/jitsi-meet-outlook/HEAD/installers/JitsiMeetOutlook-v0.6.5-windows.zip -------------------------------------------------------------------------------- /installers/JitsiMeetOutlook-v0.6.6-windows.zip: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/timetheoretical/jitsi-meet-outlook/HEAD/installers/JitsiMeetOutlook-v0.6.6-windows.zip -------------------------------------------------------------------------------- /installers/JitsiMeetOutlook-v0.7.0-windows.zip: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/timetheoretical/jitsi-meet-outlook/HEAD/installers/JitsiMeetOutlook-v0.7.0-windows.zip -------------------------------------------------------------------------------- /JitsiMeetOutlook/Resources/jitsiLogo_square.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/timetheoretical/jitsi-meet-outlook/HEAD/JitsiMeetOutlook/Resources/jitsiLogo_square.png -------------------------------------------------------------------------------- /JitsiMeetOutlook/README.md: -------------------------------------------------------------------------------- 1 | # Development 2 | 3 | ## How to add new Settings? 4 | 5 | 1. Add new XML Entry in app.config. 6 | 2. Open setting.settings in VS. It will be auto-synchronised. 7 | -------------------------------------------------------------------------------- /JitsiMeetOutlook/CalendarRibbonButton.language.cs: -------------------------------------------------------------------------------- 1 | using System.Text.Json; 2 | 3 | namespace JitsiMeetOutlook 4 | { 5 | public partial class CalendarRibbonButton 6 | { 7 | private void setLanguage() 8 | { 9 | this.buttonNewJitsiMeeting.Label = Globals.ThisAddIn.getElementTranslation("calendarRibbonButton", "buttonNewJitsiMeeting"); 10 | } 11 | } 12 | } 13 | -------------------------------------------------------------------------------- /JitsiMeetOutlook/ThisAddIn.Designer.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | -------------------------------------------------------------------------------- /JitsiMeetOutlook/Entities/ConferenceSchedulerMessage.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | 3 | 4 | namespace JitsiMeetOutlook.Entities 5 | { 6 | public class ConferenceSchedulerMessage 7 | { 8 | /// 9 | /// The name of the conference. 10 | /// 11 | public string ConferenceName { get; set; } 12 | 13 | /// 14 | /// The start date and time of the conference. 15 | /// 16 | public DateTime Start { get; set; } 17 | 18 | /// 19 | /// The end date and time of the conference. 20 | /// 21 | public DateTime End{ get; set; } 22 | 23 | /// 24 | /// Recurrance pattern as described in RFC. 25 | /// 26 | /// 27 | public string Recurrance{ get; set; } 28 | } 29 | } 30 | -------------------------------------------------------------------------------- /JitsiMeetOutlook/RequestCache.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Threading.Tasks; 3 | using Microsoft.Extensions.Caching.Memory; 4 | 5 | 6 | namespace JitsiMeetOutlook 7 | { 8 | internal class RequestCache 9 | { 10 | private MemoryCache _cache = new MemoryCache(new MemoryCacheOptions() 11 | { 12 | SizeLimit = 50 13 | }); 14 | 15 | public async Task GetOrCreate(object key, Func> createItem) 16 | { 17 | TItem cacheEntry; 18 | 19 | // Look for cache key. 20 | if (!_cache.TryGetValue(key, out cacheEntry)) 21 | { 22 | cacheEntry = await createItem(); 23 | 24 | var cacheEntryOptions = new MemoryCacheEntryOptions() 25 | .SetSize(1); 26 | 27 | _cache.Set(key, cacheEntry, cacheEntryOptions); 28 | } 29 | return cacheEntry; 30 | } 31 | } 32 | } 33 | -------------------------------------------------------------------------------- /JitsiMeetOutlook/AppointmentRibbonGroup.language.cs: -------------------------------------------------------------------------------- 1 | using System.Text.Json; 2 | 3 | namespace JitsiMeetOutlook 4 | { 5 | public partial class AppointmentRibbonGroup 6 | { 7 | 8 | private void setLanguage() 9 | { 10 | this.fieldRoomID.Label = Globals.ThisAddIn.getElementTranslation("appointmentRibbonGroup", "fieldRoomID"); 11 | this.fieldRoomID.SuperTip = Globals.ThisAddIn.getElementTranslation("appointmentRibbonGroup", "fieldRoomIDSuperTip"); 12 | this.buttonRandomRoomID.Label = Globals.ThisAddIn.getElementTranslation("appointmentRibbonGroup", "buttonRandomRoomID"); 13 | this.buttonRequireDisplayName.Label = Globals.ThisAddIn.getElementTranslation("appointmentRibbonGroup", "buttonRequireDisplayName"); 14 | this.buttonStartWithAudioMuted.Label = Globals.ThisAddIn.getElementTranslation("appointmentRibbonGroup", "buttonStartWithAudioMuted"); 15 | this.buttonStartWithVideoMuted.Label = Globals.ThisAddIn.getElementTranslation("appointmentRibbonGroup", "buttonStartWithVideoMuted"); 16 | 17 | } 18 | } 19 | 20 | } 21 | -------------------------------------------------------------------------------- /JitsiMeetOutlookTests/packages.config: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | -------------------------------------------------------------------------------- /JitsiMeetOutlook/Entities/PhoneNumberListResponse.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Text; 5 | using System.Text.Json.Serialization; 6 | using System.Threading.Tasks; 7 | 8 | namespace JitsiMeetOutlook.Entities 9 | { 10 | /// 11 | /// PhoneNumberList Endpoint Response 12 | /// Derived from https://github.com/jitsi/jitsi-meet/blob/master/resources/cloud-api.swagger 13 | /// 14 | public class PhoneNumberListResponse 15 | { 16 | /// 17 | /// Message from the server. 18 | /// 19 | /// 20 | [JsonPropertyName("message")] 21 | public string Message { get; set; } 22 | 23 | /// 24 | /// Switch whether the numbers are enabled. 25 | /// 26 | /// 27 | [JsonPropertyName("numbersEnabled")] 28 | public bool NumbersEnabled { get; set; } 29 | 30 | /// 31 | /// Dictionary of Numbers. 32 | /// CountryCode - Number 33 | /// 34 | [JsonPropertyName("numbers")] 35 | public Dictionary> Numbers { get; set; } 36 | } 37 | } 38 | -------------------------------------------------------------------------------- /JitsiMeetOutlook/Entities/ConferenceMapperResponse.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Text; 5 | using System.Text.Json.Serialization; 6 | using System.Threading.Tasks; 7 | 8 | namespace JitsiMeetOutlook.Entities 9 | { 10 | /// 11 | /// Conference Mapper Endpoint Response 12 | /// Derived from https://github.com/jitsi/jitsi-meet/blob/master/resources/cloud-api.swagger 13 | /// 14 | internal class ConferenceMapperResponse 15 | { 16 | /// 17 | /// Message from the server. 18 | /// 19 | /// 20 | [JsonPropertyName("message")] 21 | public string Message { get; set; } 22 | 23 | /// 24 | /// Conference Name. 25 | /// 26 | /// 27 | [JsonPropertyName("conference")] 28 | public string conference { get; set; } 29 | 30 | /// 31 | /// Id of the Conference (also the PIN). 32 | /// 33 | /// 34 | [JsonPropertyName("id")] 35 | public ulong Id { get; set; } 36 | 37 | [JsonIgnore] 38 | public string IdString => Id.ToString(); 39 | } 40 | } 41 | -------------------------------------------------------------------------------- /JitsiMeetOutlookTests/app.config: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | -------------------------------------------------------------------------------- /SettingsInstallerParameters/Properties/AssemblyInfo.cs: -------------------------------------------------------------------------------- 1 | using System.Reflection; 2 | using System.Runtime.CompilerServices; 3 | using System.Runtime.InteropServices; 4 | 5 | // General Information about an assembly is controlled through the following 6 | // set of attributes. Change these attribute values to modify the information 7 | // associated with an assembly. 8 | [assembly: AssemblyTitle("SettingsInstallerParameters")] 9 | [assembly: AssemblyDescription("")] 10 | [assembly: AssemblyCompany("")] 11 | [assembly: AssemblyProduct("SettingsInstallerParameters")] 12 | [assembly: AssemblyCopyright("Copyright © 2020")] 13 | [assembly: AssemblyTrademark("")] 14 | [assembly: AssemblyCulture("")] 15 | 16 | // Setting ComVisible to false makes the types in this assembly not visible 17 | // to COM components. If you need to access a type in this assembly from 18 | // COM, set the ComVisible attribute to true on that type. 19 | [assembly: ComVisible(false)] 20 | 21 | // The following GUID is for the ID of the typelib if this project is exposed to COM 22 | [assembly: Guid("1963a813-d744-49e1-b08b-9db661c8850e")] 23 | 24 | // Version information for an assembly consists of the following four values: 25 | // 26 | // Major Version 27 | // Minor Version 28 | // Build Number 29 | // Revision 30 | // 31 | // You can specify all the values or you can default the Build and Revision Numbers 32 | // by using the '*' as shown below: 33 | // [assembly: AssemblyVersion("1.0.*")] 34 | [assembly: AssemblyVersion("1.0.0.0")] 35 | [assembly: AssemblyFileVersion("1.0.0.0")] 36 | -------------------------------------------------------------------------------- /JitsiMeetOutlook/AppointmentRibbonGroup.cs: -------------------------------------------------------------------------------- 1 | using Microsoft.Office.Tools.Ribbon; 2 | 3 | namespace JitsiMeetOutlook 4 | { 5 | public partial class AppointmentRibbonGroup 6 | { 7 | 8 | private void AppointmentRibbonGroup_Load(object sender, RibbonUIEventArgs e) 9 | { 10 | initialise(); 11 | } 12 | 13 | private void buttonDialogLauncher_Click(object sender, RibbonControlEventArgs e) 14 | { 15 | 16 | FormSettings settingsWindow = new FormSettings(); 17 | settingsWindow.Show(); 18 | } 19 | 20 | private void buttonCustomiseJitsiMeeting_Click(object sender, RibbonControlEventArgs e) 21 | { 22 | randomiseRoomId(); 23 | } 24 | 25 | private void buttonRequireDisplayName_Click(object sender, RibbonControlEventArgs e) 26 | { 27 | toggleRequireName(); 28 | } 29 | 30 | private void buttonStartWithAudioMuted_Click(object sender, RibbonControlEventArgs e) 31 | { 32 | toggleMuteOnStart(); 33 | } 34 | 35 | private void RoomID_TextChanged(object sender, RibbonControlEventArgs e) 36 | { 37 | setRoomId(fieldRoomID.Text); 38 | } 39 | 40 | private void buttonStartWithVideoMuted_Click(object sender, RibbonControlEventArgs e) 41 | { 42 | toggleVideoOnStart(); 43 | } 44 | 45 | private void buttonNewJitsiMeeting_Click(object sender, RibbonControlEventArgs e) 46 | { 47 | addJitsiMeeting(); 48 | } 49 | } 50 | } 51 | -------------------------------------------------------------------------------- /JitsiMeetOutlookTests/Properties/AssemblyInfo.cs: -------------------------------------------------------------------------------- 1 | using System.Reflection; 2 | using System.Runtime.CompilerServices; 3 | using System.Runtime.InteropServices; 4 | 5 | // General Information about an assembly is controlled through the following 6 | // set of attributes. Change these attribute values to modify the information 7 | // associated with an assembly. 8 | [assembly: AssemblyTitle("JitsiMeetOutlookTests")] 9 | [assembly: AssemblyDescription("")] 10 | [assembly: AssemblyConfiguration("")] 11 | [assembly: AssemblyCompany("Private")] 12 | [assembly: AssemblyProduct("JitsiMeetOutlookTests")] 13 | [assembly: AssemblyCopyright("Daniel Habenicht")] 14 | [assembly: AssemblyTrademark("")] 15 | [assembly: AssemblyCulture("")] 16 | 17 | // Setting ComVisible to false makes the types in this assembly not visible 18 | // to COM components. If you need to access a type in this assembly from 19 | // COM, set the ComVisible attribute to true on that type. 20 | [assembly: ComVisible(false)] 21 | 22 | // The following GUID is for the ID of the typelib if this project is exposed to COM 23 | [assembly: Guid("b355f03d-db54-426c-bd96-59e3cf66eea1")] 24 | 25 | // Version information for an assembly consists of the following four values: 26 | // 27 | // Major Version 28 | // Minor Version 29 | // Build Number 30 | // Revision 31 | // 32 | // You can specify all the values or you can default the Build and Revision Numbers 33 | // by using the '*' as shown below: 34 | // [assembly: AssemblyVersion("1.0.*")] 35 | [assembly: AssemblyVersion("1.0.0.0")] 36 | [assembly: AssemblyFileVersion("1.0.0.0")] 37 | -------------------------------------------------------------------------------- /JitsiMeetOutlook/Properties/AssemblyInfo.cs: -------------------------------------------------------------------------------- 1 | using System.Reflection; 2 | using System.Runtime.CompilerServices; 3 | using System.Runtime.InteropServices; 4 | using System.Security; 5 | 6 | // General Information about an assembly is controlled through the following 7 | // set of attributes. Change these attribute values to modify the information 8 | // associated with an assembly. 9 | [assembly: AssemblyTitle("JitsiMeetOutlook")] 10 | [assembly: AssemblyDescription("")] 11 | [assembly: AssemblyConfiguration("")] 12 | [assembly: AssemblyCompany("")] 13 | [assembly: AssemblyProduct("JitsiMeetOutlook")] 14 | [assembly: AssemblyCopyright("Copyright © 2020")] 15 | [assembly: AssemblyTrademark("")] 16 | [assembly: AssemblyCulture("")] 17 | 18 | // Setting ComVisible to false makes the types in this assembly not visible 19 | // to COM components. If you need to access a type in this assembly from 20 | // COM, set the ComVisible attribute to true on that type. 21 | [assembly: ComVisible(false)] 22 | 23 | // The following GUID is for the ID of the typelib if this project is exposed to COM 24 | [assembly: Guid("7b692869-7e5c-46d4-8099-b62636f43549")] 25 | 26 | // Version information for an assembly consists of the following four values: 27 | // 28 | // Major Version 29 | // Minor Version 30 | // Build Number 31 | // Revision 32 | // 33 | // You can specify all the values or you can default the Build and Revision Numbers 34 | // by using the '*' as shown below: 35 | // [assembly: AssemblyVersion("1.0.*")] 36 | [assembly: AssemblyVersion("1.0.0.0")] 37 | [assembly: AssemblyFileVersion("1.0.0.0")] 38 | 39 | -------------------------------------------------------------------------------- /SettingsInstallerParameters/CustomAction.config: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 31 | 32 | 33 | -------------------------------------------------------------------------------- /installers/JitsiMeetOutlook-install-script.bat: -------------------------------------------------------------------------------- 1 | @ECHO OFF 2 | ::======================= 3 | :: SETUP 4 | ::======================= 5 | ::Jitsi access 6 | set ROOMID=default_room 7 | set DOMAIN=domain:port 8 | ::next variables, either True or False 9 | set REQNAME=False 10 | set NOAUDIO=False 11 | set NOVIDEO=False 12 | ::specify the display language (en/fr/ru) 13 | set LANG=en 14 | ::====================== 15 | :: Plugin URL and paths 16 | ::====================== 17 | set origin=https://github.com/timetheoretical/jitsi-meet-outlook/releases/download/v0.6.0/JitsiMeetOutlook-v0.6.0-windows-anycpu.msi 18 | set target=%ProgramFiles%\Jitsi Meet Outlook 19 | :: if x86 version, use target=%ProgramFiles(x86)%\Jitsi Meet Outlook 20 | :: if x64 version, use target=%ProgramFiles%\Jitsi Meet Outlook 21 | 22 | 23 | ::=============== 24 | 25 | ECHO Deleting previous version... 26 | IF EXIST %target% ( 27 | ECHO deleting %target% 28 | RMDIR "%target%" /S /Q 29 | ) ELSE ( 30 | ECHO No previous installation found. 31 | ) 32 | ECHO Downloading plugin Jitsi-Meet-Outlook... 33 | :PowerShell 34 | SET PSScript=%TEMP%\~tmpDlFile.ps1 35 | IF EXIST "%PSScript%" DEL /Q /F "%PSScript%" 36 | ECHO [Net.ServicePointManager]::SecurityProtocol = "tls12, tls11, tls">>"%PSScript%" 37 | ECHO Invoke-WebRequest "%origin%" -OutFile "%TEMP%\jmo.msi">>"%PSScript%" 38 | SET PowerShellDir=C:\Windows\System32\WindowsPowerShell\v1.0 39 | CD /D "%PowerShellDir%" 40 | Powershell -ExecutionPolicy Bypass -Command "& '%PSScript%'" 41 | ECHO Download done. 42 | ECHO Plugin installation... 43 | msiexec /i "%TEMP%\jmo.msi" TARGETDIR="%target%" DOMAIN="%DOMAIN%" ROOMID="%roomid%" REQNAME="%reqname%" NOAUDIO="%noaudio%" NOVIDEO="%novideo%" LANG="%lang%" /passive 44 | ECHO Done. 45 | PAUSE 46 | -------------------------------------------------------------------------------- /JitsiMeetOutlook/ThisAddIn.language.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Text; 3 | using System.Text.Json; 4 | using System.Collections.Generic; 5 | 6 | namespace JitsiMeetOutlook 7 | { 8 | public partial class ThisAddIn 9 | { 10 | private JsonElement languageJsonRoot; 11 | 12 | private void readLanguageJson() 13 | { 14 | try 15 | { 16 | byte[] jsonFile = findJson(Properties.Settings.Default.language); 17 | string jsonString = Encoding.UTF8.GetString(jsonFile); 18 | 19 | JsonDocument document = JsonDocument.Parse(jsonString); 20 | languageJsonRoot = document.RootElement; 21 | } 22 | catch (Exception ex) 23 | { 24 | //Do nothing 25 | } 26 | 27 | } 28 | 29 | private byte[] findJson(string language) 30 | { 31 | Dictionary languages = new Dictionary(); 32 | languages.Add("en", Resources.languages.en); 33 | languages.Add("de", Resources.languages.de); 34 | languages.Add("fr", Resources.languages.fr); 35 | languages.Add("ru", Resources.languages.ru); 36 | languages.Add("es", Resources.languages.es); 37 | languages.Add("cz", Resources.languages.cz); 38 | 39 | if (languages.ContainsKey(language)) 40 | { 41 | return languages[language]; 42 | } 43 | else 44 | { 45 | return null; 46 | } 47 | } 48 | 49 | public JsonElement getLanguageJsonRoot() 50 | { 51 | return languageJsonRoot; 52 | } 53 | 54 | public string getElementTranslation(string jsonGroup, string jsonElement) 55 | { 56 | return languageJsonRoot.GetProperty(jsonGroup).GetProperty(jsonElement).GetString(); 57 | } 58 | 59 | } 60 | 61 | } 62 | -------------------------------------------------------------------------------- /JitsiMeetOutlook/CalendarRibbonButton.cs: -------------------------------------------------------------------------------- 1 | using Microsoft.Office.Tools.Ribbon; 2 | using System; 3 | using System.Windows.Forms; 4 | using Outlook = Microsoft.Office.Interop.Outlook; 5 | 6 | namespace JitsiMeetOutlook 7 | { 8 | public partial class CalendarRibbonButton 9 | { 10 | private void CalendarRibbonButton_Load(object sender, RibbonUIEventArgs e) 11 | { 12 | setLanguage(); 13 | } 14 | 15 | private async void buttonNewJitsiMeeting_Click(object sender, RibbonControlEventArgs e) 16 | { 17 | // Get the Application object 18 | Outlook.Application application = Globals.ThisAddIn.Application; 19 | 20 | DateTime dateNull = new DateTime(4501, 1, 1, 0, 0, 0); 21 | Outlook.Explorer expl = application.ActiveExplorer(); 22 | Outlook.View view = expl.CurrentView as Outlook.View; 23 | 24 | try 25 | { 26 | // Create meeting object 27 | var newAppointment = (Outlook.AppointmentItem)application.CreateItem(Outlook.OlItemType.olAppointmentItem); 28 | 29 | // Appointment details 30 | newAppointment.MeetingStatus = Outlook.OlMeetingStatus.olMeeting; 31 | newAppointment.Location = "Jitsi Meet"; 32 | 33 | // Set appointment date if selected in calendar 34 | if (view.ViewType == Outlook.OlViewType.olCalendarView) 35 | { 36 | Outlook.CalendarView calView = view as Outlook.CalendarView; 37 | DateTime dateStart = calView.SelectedStartTime; 38 | DateTime dateEnd = calView.SelectedEndTime; 39 | if (dateStart != dateNull && dateEnd != dateNull) 40 | { 41 | newAppointment.Start = dateStart; 42 | newAppointment.End = dateEnd; 43 | } 44 | } 45 | 46 | // Display the appointment window 47 | newAppointment.Display(false); 48 | } 49 | catch (Exception ex) 50 | { 51 | MessageBox.Show("The following error occurred: " + ex.Message); 52 | } 53 | } 54 | } 55 | } 56 | -------------------------------------------------------------------------------- /JitsiMeetOutlook/Properties/Settings.settings: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | meet.jit.si 7 | 8 | 9 | False 10 | 11 | 12 | False 13 | 14 | 15 | False 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | en 25 | 26 | 27 | phrase 28 | 29 | 30 | https://api.jitsi.net/conferenceMapper 31 | 32 | 33 | https://api.jitsi.net/phoneNumberList 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | -------------------------------------------------------------------------------- /JitsiMeetOutlook/packages.config: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | -------------------------------------------------------------------------------- /.gitattributes: -------------------------------------------------------------------------------- 1 | ############################################################################### 2 | # Set default behavior to automatically normalize line endings. 3 | ############################################################################### 4 | * text=auto 5 | 6 | ############################################################################### 7 | # Set default behavior for command prompt diff. 8 | # 9 | # This is need for earlier builds of msysgit that does not have it on by 10 | # default for csharp files. 11 | # Note: This is only used by command line 12 | ############################################################################### 13 | #*.cs diff=csharp 14 | 15 | ############################################################################### 16 | # Set the merge driver for project and solution files 17 | # 18 | # Merging from the command prompt will add diff markers to the files if there 19 | # are conflicts (Merging from VS is not affected by the settings below, in VS 20 | # the diff markers are never inserted). Diff markers may cause the following 21 | # file extensions to fail to load in VS. An alternative would be to treat 22 | # these files as binary and thus will always conflict and require user 23 | # intervention with every merge. To do so, just uncomment the entries below 24 | ############################################################################### 25 | #*.sln merge=binary 26 | #*.csproj merge=binary 27 | #*.vbproj merge=binary 28 | #*.vcxproj merge=binary 29 | #*.vcproj merge=binary 30 | #*.dbproj merge=binary 31 | #*.fsproj merge=binary 32 | #*.lsproj merge=binary 33 | #*.wixproj merge=binary 34 | #*.modelproj merge=binary 35 | #*.sqlproj merge=binary 36 | #*.wwaproj merge=binary 37 | 38 | ############################################################################### 39 | # behavior for image files 40 | # 41 | # image files are treated as binary by default. 42 | ############################################################################### 43 | #*.jpg binary 44 | #*.png binary 45 | #*.gif binary 46 | 47 | ############################################################################### 48 | # diff behavior for common document formats 49 | # 50 | # Convert binary document formats to text before diffing them. This feature 51 | # is only available from the command line. Turn it on by uncommenting the 52 | # entries below. 53 | ############################################################################### 54 | #*.doc diff=astextplain 55 | #*.DOC diff=astextplain 56 | #*.docx diff=astextplain 57 | #*.DOCX diff=astextplain 58 | #*.dot diff=astextplain 59 | #*.DOT diff=astextplain 60 | #*.pdf diff=astextplain 61 | #*.PDF diff=astextplain 62 | #*.rtf diff=astextplain 63 | #*.RTF diff=astextplain 64 | -------------------------------------------------------------------------------- /SettingsInstallerParameters/SettingsInstallerParameters.csproj: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | Debug 5 | x86 6 | 8.0.30703 7 | 2.0 8 | {1963A813-D744-49E1-B08B-9DB661C8850E} 9 | Library 10 | Properties 11 | SettingsInstallerParameters 12 | SettingsInstallerParameters 13 | v4.7.2 14 | 512 15 | 16 | 17 | true 18 | full 19 | false 20 | bin\Debug\ 21 | DEBUG;TRACE 22 | prompt 23 | 4 24 | 25 | 26 | pdbonly 27 | true 28 | bin\Release\ 29 | TRACE 30 | prompt 31 | 4 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | True 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | 51 | 52 | 53 | 54 | -------------------------------------------------------------------------------- /JitsiMeetOutlook/Utils.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Text; 5 | using System.Text.RegularExpressions; 6 | using System.Threading; 7 | using System.Threading.Tasks; 8 | using System.Windows.Forms; 9 | 10 | namespace JitsiMeetOutlook 11 | { 12 | public class Utils 13 | { 14 | private static string escapeDomain(string domain) 15 | { 16 | string escapedDomain = Regex.Escape(domain); 17 | if (!escapedDomain.EndsWith("/")) 18 | { 19 | escapedDomain += "/"; 20 | } 21 | return escapedDomain; 22 | } 23 | 24 | public static string GetUrl(string oldBody, string domain) 25 | { 26 | return Regex.Match(oldBody, "http[s]*://" + escapeDomain(domain) + "[\\w\\/#%\\.=]+").Value; 27 | } 28 | 29 | public static bool SettingIsActive(string url, string setting) 30 | { 31 | return url.Contains("config." + setting + "=true"); 32 | } 33 | 34 | 35 | public static string findRoomId(string body, string domain) 36 | { 37 | string roomId = Regex.Match(body, "(?<=" + escapeDomain(domain) + ")\\S+?(?=(#config|&config|\\s))").Value; // Match all non-blanks after jitsi url and before config or end 38 | return roomId; 39 | } 40 | 41 | public static void RunInThread(Action function) 42 | { 43 | try 44 | { 45 | ThreadStart s = new ThreadStart(() => 46 | { 47 | try 48 | { 49 | function(); 50 | } 51 | catch (Exception ex) 52 | { 53 | MessageBox.Show("An Error occured within JitsiOutlook: " + ex.Message); 54 | } 55 | }); 56 | Thread ss = new Thread(s); 57 | ss.Start(); 58 | } 59 | catch (Exception ex) 60 | { 61 | MessageBox.Show("An Error occured within JitsiOutlook: " + ex.Message); 62 | } 63 | } 64 | 65 | public static List> SplitToTextAndHyperlinks(string text) 66 | { 67 | var list = new List>(); 68 | MatchCollection matches = Regex.Matches(text, "http[s]?:\\/\\/(?:[a-zA-Z]|[0-9]|[$-_@&+]|[!*\\(\\),]|(?:%[0-9a-fA-F][0-9a-fA-F]))+(?(false, text)); 72 | } 73 | var lastindex = 0; 74 | var index = 0; 75 | foreach (Match match in matches) 76 | { 77 | list.Add(new KeyValuePair(false, text.Substring(lastindex, match.Index - lastindex))); 78 | list.Add(new KeyValuePair(true, match.Value)); 79 | lastindex = match.Index + match.Length; 80 | if (index == matches.Count - 1) 81 | { 82 | list.Add(new KeyValuePair(false, text.Substring(lastindex, text.Length - lastindex))); 83 | } 84 | index++; 85 | } 86 | 87 | return list; 88 | } 89 | } 90 | } 91 | -------------------------------------------------------------------------------- /JitsiMeetOutlook/Properties/Resources.Designer.cs: -------------------------------------------------------------------------------- 1 | //------------------------------------------------------------------------------ 2 | // 3 | // This code was generated by a tool. 4 | // Runtime Version:4.0.30319.42000 5 | // 6 | // Changes to this file may cause incorrect behavior and will be lost if 7 | // the code is regenerated. 8 | // 9 | //------------------------------------------------------------------------------ 10 | 11 | namespace JitsiMeetOutlook.Properties { 12 | using System; 13 | 14 | 15 | /// 16 | /// A strongly-typed resource class, for looking up localized strings, etc. 17 | /// 18 | // This class was auto-generated by the StronglyTypedResourceBuilder 19 | // class via a tool like ResGen or Visual Studio. 20 | // To add or remove a member, edit your .ResX file then rerun ResGen 21 | // with the /str option, or rebuild your VS project. 22 | [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "16.0.0.0")] 23 | [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] 24 | [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] 25 | internal class Resources { 26 | 27 | private static global::System.Resources.ResourceManager resourceMan; 28 | 29 | private static global::System.Globalization.CultureInfo resourceCulture; 30 | 31 | [global::System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")] 32 | internal Resources() { 33 | } 34 | 35 | /// 36 | /// Returns the cached ResourceManager instance used by this class. 37 | /// 38 | [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)] 39 | internal static global::System.Resources.ResourceManager ResourceManager { 40 | get { 41 | if (object.ReferenceEquals(resourceMan, null)) { 42 | global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("JitsiMeetOutlook.Properties.Resources", typeof(Resources).Assembly); 43 | resourceMan = temp; 44 | } 45 | return resourceMan; 46 | } 47 | } 48 | 49 | /// 50 | /// Overrides the current thread's CurrentUICulture property for all 51 | /// resource lookups using this strongly typed resource class. 52 | /// 53 | [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)] 54 | internal static global::System.Globalization.CultureInfo Culture { 55 | get { 56 | return resourceCulture; 57 | } 58 | set { 59 | resourceCulture = value; 60 | } 61 | } 62 | 63 | /// 64 | /// Looks up a localized resource of type System.Drawing.Bitmap. 65 | /// 66 | internal static System.Drawing.Bitmap jitsiLogo_square { 67 | get { 68 | object obj = ResourceManager.GetObject("jitsiLogo_square", resourceCulture); 69 | return ((System.Drawing.Bitmap)(obj)); 70 | } 71 | } 72 | } 73 | } 74 | -------------------------------------------------------------------------------- /setup/setup.wixproj: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | Debug 5 | x86 6 | 3.10 7 | 85009cc8-078d-40e6-b4a5-f097d6b04c72 8 | 2.0 9 | setup 10 | Package 11 | 12 | 13 | bin\$(Configuration)\ 14 | obj\$(Configuration)\ 15 | Debug 16 | 17 | 18 | bin\$(Configuration)\ 19 | obj\$(Configuration)\ 20 | 21 | 22 | 23 | 24 | 25 | 26 | $(WixExtDir)\WixUtilExtension.dll 27 | WixUtilExtension 28 | 29 | 30 | $(WixExtDir)\WixUIExtension.dll 31 | WixUIExtension 32 | 33 | 34 | $(WixExtDir)\WixNetFxExtension.dll 35 | WixNetFxExtension 36 | 37 | 38 | 39 | 40 | JitsiMeetOutlook 41 | {92dd44f5-9b8c-4d40-ae0e-9b1edee99449} 42 | True 43 | True 44 | Binaries;Content;Satellites 45 | INSTALLFOLDER 46 | 47 | 48 | SettingsInstallerParameters 49 | {1963a813-d744-49e1-b08b-9db661c8850e} 50 | True 51 | True 52 | Binaries;Content;Satellites 53 | INSTALLFOLDER 54 | 55 | 56 | 57 | 58 | 59 | 60 | 61 | 69 | -------------------------------------------------------------------------------- /JitsiMeetOutlook.sln: -------------------------------------------------------------------------------- 1 | 2 | Microsoft Visual Studio Solution File, Format Version 12.00 3 | # Visual Studio Version 17 4 | VisualStudioVersion = 17.2.32505.173 5 | MinimumVisualStudioVersion = 10.0.40219.1 6 | Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "JitsiMeetOutlook", "JitsiMeetOutlook\JitsiMeetOutlook.csproj", "{92DD44F5-9B8C-4D40-AE0E-9B1EDEE99449}" 7 | EndProject 8 | Project("{930C7802-8A8C-48F9-8165-68863BCCD9DD}") = "setup", "setup\setup.wixproj", "{85009CC8-078D-40E6-B4A5-F097D6B04C72}" 9 | EndProject 10 | Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "SettingsInstallerParameters", "SettingsInstallerParameters\SettingsInstallerParameters.csproj", "{1963A813-D744-49E1-B08B-9DB661C8850E}" 11 | EndProject 12 | Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "JitsiMeetOutlookTests", "JitsiMeetOutlookTests\JitsiMeetOutlookTests.csproj", "{B355F03D-DB54-426C-BD96-59E3CF66EEA1}" 13 | EndProject 14 | Global 15 | GlobalSection(SolutionConfigurationPlatforms) = preSolution 16 | Debug|Any CPU = Debug|Any CPU 17 | Debug|x86 = Debug|x86 18 | Release|Any CPU = Release|Any CPU 19 | Release|x86 = Release|x86 20 | EndGlobalSection 21 | GlobalSection(ProjectConfigurationPlatforms) = postSolution 22 | {92DD44F5-9B8C-4D40-AE0E-9B1EDEE99449}.Debug|Any CPU.ActiveCfg = Debug|Any CPU 23 | {92DD44F5-9B8C-4D40-AE0E-9B1EDEE99449}.Debug|Any CPU.Build.0 = Debug|Any CPU 24 | {92DD44F5-9B8C-4D40-AE0E-9B1EDEE99449}.Debug|x86.ActiveCfg = Debug|Any CPU 25 | {92DD44F5-9B8C-4D40-AE0E-9B1EDEE99449}.Debug|x86.Build.0 = Debug|Any CPU 26 | {92DD44F5-9B8C-4D40-AE0E-9B1EDEE99449}.Release|Any CPU.ActiveCfg = Release|Any CPU 27 | {92DD44F5-9B8C-4D40-AE0E-9B1EDEE99449}.Release|Any CPU.Build.0 = Release|Any CPU 28 | {92DD44F5-9B8C-4D40-AE0E-9B1EDEE99449}.Release|x86.ActiveCfg = Release|Any CPU 29 | {92DD44F5-9B8C-4D40-AE0E-9B1EDEE99449}.Release|x86.Build.0 = Release|Any CPU 30 | {85009CC8-078D-40E6-B4A5-F097D6B04C72}.Debug|Any CPU.ActiveCfg = Debug|x86 31 | {85009CC8-078D-40E6-B4A5-F097D6B04C72}.Debug|Any CPU.Build.0 = Debug|x86 32 | {85009CC8-078D-40E6-B4A5-F097D6B04C72}.Debug|x86.ActiveCfg = Debug|x86 33 | {85009CC8-078D-40E6-B4A5-F097D6B04C72}.Debug|x86.Build.0 = Debug|x86 34 | {85009CC8-078D-40E6-B4A5-F097D6B04C72}.Release|Any CPU.ActiveCfg = Release|x86 35 | {85009CC8-078D-40E6-B4A5-F097D6B04C72}.Release|Any CPU.Build.0 = Release|x86 36 | {85009CC8-078D-40E6-B4A5-F097D6B04C72}.Release|x86.ActiveCfg = Release|x86 37 | {85009CC8-078D-40E6-B4A5-F097D6B04C72}.Release|x86.Build.0 = Release|x86 38 | {1963A813-D744-49E1-B08B-9DB661C8850E}.Debug|Any CPU.ActiveCfg = Debug|x86 39 | {1963A813-D744-49E1-B08B-9DB661C8850E}.Debug|Any CPU.Build.0 = Debug|x86 40 | {1963A813-D744-49E1-B08B-9DB661C8850E}.Debug|x86.ActiveCfg = Debug|x86 41 | {1963A813-D744-49E1-B08B-9DB661C8850E}.Debug|x86.Build.0 = Debug|x86 42 | {1963A813-D744-49E1-B08B-9DB661C8850E}.Release|Any CPU.ActiveCfg = Release|x86 43 | {1963A813-D744-49E1-B08B-9DB661C8850E}.Release|Any CPU.Build.0 = Release|x86 44 | {1963A813-D744-49E1-B08B-9DB661C8850E}.Release|x86.ActiveCfg = Release|x86 45 | {1963A813-D744-49E1-B08B-9DB661C8850E}.Release|x86.Build.0 = Release|x86 46 | {B355F03D-DB54-426C-BD96-59E3CF66EEA1}.Debug|Any CPU.ActiveCfg = Debug|Any CPU 47 | {B355F03D-DB54-426C-BD96-59E3CF66EEA1}.Debug|Any CPU.Build.0 = Debug|Any CPU 48 | {B355F03D-DB54-426C-BD96-59E3CF66EEA1}.Debug|x86.ActiveCfg = Debug|Any CPU 49 | {B355F03D-DB54-426C-BD96-59E3CF66EEA1}.Debug|x86.Build.0 = Debug|Any CPU 50 | {B355F03D-DB54-426C-BD96-59E3CF66EEA1}.Release|Any CPU.ActiveCfg = Release|Any CPU 51 | {B355F03D-DB54-426C-BD96-59E3CF66EEA1}.Release|Any CPU.Build.0 = Release|Any CPU 52 | {B355F03D-DB54-426C-BD96-59E3CF66EEA1}.Release|x86.ActiveCfg = Release|Any CPU 53 | {B355F03D-DB54-426C-BD96-59E3CF66EEA1}.Release|x86.Build.0 = Release|Any CPU 54 | EndGlobalSection 55 | GlobalSection(SolutionProperties) = preSolution 56 | HideSolutionNode = FALSE 57 | EndGlobalSection 58 | GlobalSection(ExtensibilityGlobals) = postSolution 59 | SolutionGuid = {638190E1-1DD1-4209-BE1B-534ED95908C8} 60 | EndGlobalSection 61 | EndGlobal 62 | -------------------------------------------------------------------------------- /JitsiMeetOutlook/CalendarRibbonButton.Designer.cs: -------------------------------------------------------------------------------- 1 | namespace JitsiMeetOutlook 2 | { 3 | partial class CalendarRibbonButton : Microsoft.Office.Tools.Ribbon.RibbonBase 4 | { 5 | /// 6 | /// Required designer variable. 7 | /// 8 | private System.ComponentModel.IContainer components = null; 9 | 10 | public CalendarRibbonButton() 11 | : base(Globals.Factory.GetRibbonFactory()) 12 | { 13 | InitializeComponent(); 14 | } 15 | 16 | /// 17 | /// Clean up any resources being used. 18 | /// 19 | /// true if managed resources should be disposed; otherwise, false. 20 | protected override void Dispose(bool disposing) 21 | { 22 | if (disposing && (components != null)) 23 | { 24 | components.Dispose(); 25 | } 26 | base.Dispose(disposing); 27 | } 28 | 29 | #region Component Designer generated code 30 | 31 | /// 32 | /// Required method for Designer support - do not modify 33 | /// the contents of this method with the code editor. 34 | /// 35 | private void InitializeComponent() 36 | { 37 | this.Calendar = this.Factory.CreateRibbonTab(); 38 | this.JitsiMeet = this.Factory.CreateRibbonGroup(); 39 | this.buttonNewJitsiMeeting = this.Factory.CreateRibbonButton(); 40 | this.Calendar.SuspendLayout(); 41 | this.JitsiMeet.SuspendLayout(); 42 | this.SuspendLayout(); 43 | // 44 | // Calendar 45 | // 46 | this.Calendar.ControlId.ControlIdType = Microsoft.Office.Tools.Ribbon.RibbonControlIdType.Office; 47 | this.Calendar.ControlId.OfficeId = "TabCalendar"; 48 | this.Calendar.Groups.Add(this.JitsiMeet); 49 | this.Calendar.Label = "TabCalendar"; 50 | this.Calendar.Name = "Calendar"; 51 | // 52 | // JitsiMeet 53 | // 54 | this.JitsiMeet.Items.Add(this.buttonNewJitsiMeeting); 55 | this.JitsiMeet.Label = "Jitsi Meet"; 56 | this.JitsiMeet.Name = "JitsiMeet"; 57 | this.JitsiMeet.Position = this.Factory.RibbonPosition.BeforeOfficeId("GroupGoto"); 58 | // 59 | // buttonNewJitsiMeeting 60 | // 61 | this.buttonNewJitsiMeeting.ControlSize = Microsoft.Office.Core.RibbonControlSize.RibbonControlSizeLarge; 62 | this.buttonNewJitsiMeeting.Image = global::JitsiMeetOutlook.Properties.Resources.jitsiLogo_square; 63 | this.buttonNewJitsiMeeting.Label = "New Jitsi Meeting"; 64 | this.buttonNewJitsiMeeting.Name = "buttonNewJitsiMeeting"; 65 | this.buttonNewJitsiMeeting.ShowImage = true; 66 | this.buttonNewJitsiMeeting.Click += new Microsoft.Office.Tools.Ribbon.RibbonControlEventHandler(this.buttonNewJitsiMeeting_Click); 67 | // 68 | // CalendarRibbonButton 69 | // 70 | this.Name = "CalendarRibbonButton"; 71 | this.RibbonType = "Microsoft.Outlook.Explorer"; 72 | this.Tabs.Add(this.Calendar); 73 | this.Load += new Microsoft.Office.Tools.Ribbon.RibbonUIEventHandler(this.CalendarRibbonButton_Load); 74 | this.Calendar.ResumeLayout(false); 75 | this.Calendar.PerformLayout(); 76 | this.JitsiMeet.ResumeLayout(false); 77 | this.JitsiMeet.PerformLayout(); 78 | this.ResumeLayout(false); 79 | 80 | } 81 | 82 | #endregion 83 | 84 | internal Microsoft.Office.Tools.Ribbon.RibbonTab Calendar; 85 | internal Microsoft.Office.Tools.Ribbon.RibbonGroup JitsiMeet; 86 | internal Microsoft.Office.Tools.Ribbon.RibbonButton buttonNewJitsiMeeting; 87 | } 88 | 89 | partial class ThisRibbonCollection 90 | { 91 | internal CalendarRibbonButton CalendarRibbonButton 92 | { 93 | get { return this.GetRibbon(); } 94 | } 95 | } 96 | } 97 | -------------------------------------------------------------------------------- /JitsiMeetOutlook/JitsiUrl.cs: -------------------------------------------------------------------------------- 1 | // This Class generates a random url 2 | // Based on: https://github.com/edenemmanuel/jitsiurl/blob/master/jitsiurl 3 | // and on: https://github.com/jitsi/js-utils/blob/master/random/roomNameGenerator.js 4 | 5 | using System; 6 | using System.Security.Cryptography; 7 | using System.Text; 8 | 9 | using System.Text.Json; 10 | using Diacritics.Extensions; 11 | using System.Text.RegularExpressions; 12 | 13 | namespace JitsiMeetOutlook 14 | { 15 | public static class JitsiUrl 16 | 17 | { 18 | public static string generateRandomId() 19 | { 20 | if (Properties.Settings.Default.randomRoomIdGeneratorMode == "phrase") 21 | { 22 | return generateRandomPhrase(); 23 | } 24 | else 25 | { 26 | return generateRandomString(16); 27 | } 28 | } 29 | public static string generateRandomPhrase() 30 | { 31 | return randomListElement(getAdjectiveList()) + randomListElement(getPluralNounList()) + randomListElement(getVerbList()) + randomListElement(getAdverbList()); 32 | } 33 | 34 | public static string getUrlBase() 35 | { 36 | string urlBase = "https://" + getDomain() + "/"; 37 | return urlBase; 38 | } 39 | 40 | public static string getDomain() 41 | { 42 | Properties.Settings.Default.Reload(); 43 | string domain = Properties.Settings.Default.Domain; 44 | return domain; 45 | } 46 | 47 | private static string randomListElement(JsonElement list) 48 | { 49 | int index = random.Next(list.GetArrayLength()); 50 | string word = list[index].GetString(); 51 | 52 | return filterLegalCharacters(word); 53 | } 54 | 55 | private static Random random = new Random(); 56 | 57 | // The list of plural nouns. 58 | private static JsonElement getPluralNounList() 59 | { 60 | return Globals.ThisAddIn.getLanguageJsonRoot().GetProperty("roomNameGenerator").GetProperty("pluralNoun"); 61 | } 62 | 63 | // The list of verbs. 64 | private static JsonElement getVerbList() 65 | { 66 | return Globals.ThisAddIn.getLanguageJsonRoot().GetProperty("roomNameGenerator").GetProperty("verb"); 67 | } 68 | 69 | // The list of adverbs. 70 | private static JsonElement getAdverbList() 71 | { 72 | return Globals.ThisAddIn.getLanguageJsonRoot().GetProperty("roomNameGenerator").GetProperty("adverb"); 73 | } 74 | 75 | // The list of adjectives. 76 | private static JsonElement getAdjectiveList() 77 | { 78 | return Globals.ThisAddIn.getLanguageJsonRoot().GetProperty("roomNameGenerator").GetProperty("adjective"); 79 | } 80 | 81 | public static string filterLegalCharacters(string word) 82 | { 83 | // Remove diacritics 84 | string wordWithoutDiacritics = word.RemoveDiacritics(); 85 | 86 | // Keep only letters of the latin alphabet 87 | string wordLatin = Regex.Replace(wordWithoutDiacritics, "[^a-zA-Z0-9_-]+", ""); 88 | 89 | return wordLatin; 90 | } 91 | 92 | public static string generateRandomString(int size) 93 | { 94 | char[] chars = ( 95 | "ABCDEFGHIJKLMNOPQRSTUVWXYZ" + 96 | "abcdefghijklmnopqrstuvwxyz" + 97 | "0123456789" 98 | ).ToCharArray(); 99 | 100 | byte[] data = new byte[4 * size]; 101 | using (RNGCryptoServiceProvider crypto = new RNGCryptoServiceProvider()) 102 | { 103 | crypto.GetBytes(data); 104 | } 105 | StringBuilder result = new StringBuilder(size); 106 | for (int i = 0; i < size; i++) 107 | { 108 | var rnd = BitConverter.ToUInt32(data, i * 4); 109 | var idx = rnd % chars.Length; 110 | 111 | result.Append(chars[idx]); 112 | } 113 | 114 | return result.ToString(); 115 | } 116 | } 117 | } 118 | -------------------------------------------------------------------------------- /JitsiMeetOutlook/app.config: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 |
6 | 7 | 8 | 9 | 10 | 11 | meet.jit.si 12 | 13 | 14 | False 15 | 16 | 17 | False 18 | 19 | 20 | False 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | en 30 | 31 | 32 | phrase 33 | 34 | 35 | https://api.jitsi.net/conferenceMapper 36 | 37 | 38 | https://api.jitsi.net/phoneNumberList 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | 51 | 52 | 53 | 54 | 55 | 56 | 57 | 58 | 59 | 60 | 61 | 62 | 63 | 64 | 65 | 66 | 67 | 68 | 69 | 70 | 71 | 72 | 73 | 74 | 75 | 76 | 77 | 78 | 79 | 80 | 81 | -------------------------------------------------------------------------------- /JitsiMeetOutlook/FormSettings.language.cs: -------------------------------------------------------------------------------- 1 | using System.Collections.Generic; 2 | using System.Text.Json; 3 | 4 | 5 | namespace JitsiMeetOutlook 6 | { 7 | partial class FormSettings 8 | { 9 | private Dictionary languageDropDown = new Dictionary(); 10 | private Dictionary randomGeneratorModeDropDown = new Dictionary(); 11 | 12 | private void setLanguage() 13 | { 14 | setLanguageTabs(); 15 | setLanguageDropDown(); 16 | setRandomGeneratorMode(); 17 | 18 | this.groupBoxDomain.Text = Globals.ThisAddIn.getElementTranslation("settings", "groupBoxDomain"); 19 | this.radioButtonDefaultDomain.Text = Globals.ThisAddIn.getElementTranslation("settings", "radioButtonDefaultDomain"); 20 | this.radioButtonCustomDomain.Text = Globals.ThisAddIn.getElementTranslation("settings", "radioButtonCustomDomain"); 21 | this.groupBoxDefaultRoomID.Text = Globals.ThisAddIn.getElementTranslation("settings", "groupBoxDefaultRoomID"); 22 | this.radioButtonRandomRoomID.Text = Globals.ThisAddIn.getElementTranslation("settings", "radioButtonRandomRoomID"); 23 | this.radioButtonCustomRoomID.Text = Globals.ThisAddIn.getElementTranslation("settings", "radioButtonCustomRoomID"); 24 | this.groupBoxToggleDefaults.Text = Globals.ThisAddIn.getElementTranslation("settings", "groupBoxToggleDefaults"); 25 | this.labelToggled.Text = Globals.ThisAddIn.getElementTranslation("settings", "labelToggled"); 26 | this.labelUntoggled.Text = Globals.ThisAddIn.getElementTranslation("settings", "labelUntoggled"); 27 | this.labelRequireDisplayName.Text = Globals.ThisAddIn.getElementTranslation("settings", "labelRequireDisplayName"); 28 | this.labelStartWithAudioMuted.Text = Globals.ThisAddIn.getElementTranslation("settings", "labelStartWithAudioMuted"); 29 | this.labelStartWithVideoMuted.Text = Globals.ThisAddIn.getElementTranslation("settings", "labelStartWithVideoMuted"); 30 | this.groupBoxLanguage.Text = Globals.ThisAddIn.getElementTranslation("settings", "groupBoxLanguage"); 31 | 32 | } 33 | 34 | 35 | private void setLanguageDropDown() 36 | { 37 | JsonElement jsonUILanguage = Globals.ThisAddIn.getLanguageJsonRoot().GetProperty("settings"); 38 | languageDropDown.Add("de", jsonUILanguage.GetProperty("comboBoxLanguageItems").GetProperty("de").GetString()); 39 | languageDropDown.Add("en", jsonUILanguage.GetProperty("comboBoxLanguageItems").GetProperty("en").GetString()); 40 | languageDropDown.Add("fr", jsonUILanguage.GetProperty("comboBoxLanguageItems").GetProperty("fr").GetString()); 41 | languageDropDown.Add("ru", jsonUILanguage.GetProperty("comboBoxLanguageItems").GetProperty("ru").GetString()); 42 | languageDropDown.Add("es", jsonUILanguage.GetProperty("comboBoxLanguageItems").GetProperty("es").GetString()); 43 | languageDropDown.Add("cz", jsonUILanguage.GetProperty("comboBoxLanguageItems").GetProperty("cz").GetString()); 44 | 45 | this.comboBoxLanguage.Items.Clear(); 46 | this.comboBoxLanguage.Items.AddRange(new object[] { 47 | languageDropDown["de"], 48 | languageDropDown["en"], 49 | languageDropDown["fr"], 50 | languageDropDown["ru"], 51 | languageDropDown["es"], 52 | languageDropDown["cz"] 53 | }); 54 | } 55 | 56 | private void setLanguageTabs() 57 | { 58 | JsonElement jsonUILanguage = Globals.ThisAddIn.getLanguageJsonRoot().GetProperty("settings"); 59 | this.tabPageDomain.Text = jsonUILanguage.GetProperty("tabControlSettings").GetProperty("tabPageDomain").GetString(); 60 | this.tabPageRoomId.Text = jsonUILanguage.GetProperty("tabControlSettings").GetProperty("tabPageRoomId").GetString(); 61 | this.tabPageMeetingOptions.Text = jsonUILanguage.GetProperty("tabControlSettings").GetProperty("tabPageMeetingOptions").GetString(); 62 | this.tabPageLanguage.Text = jsonUILanguage.GetProperty("tabControlSettings").GetProperty("tabPageLanguage").GetString(); 63 | } 64 | 65 | private void setRandomGeneratorMode() 66 | { 67 | JsonElement jsonUILanguage = Globals.ThisAddIn.getLanguageJsonRoot().GetProperty("settings"); 68 | randomGeneratorModeDropDown.Add("phrase", jsonUILanguage.GetProperty("comboBoxRandomGeneratorMode").GetProperty("phrase").GetString()); 69 | randomGeneratorModeDropDown.Add("string", jsonUILanguage.GetProperty("comboBoxRandomGeneratorMode").GetProperty("string").GetString()); 70 | 71 | this.comboBoxRandomGeneratorMode.Items.Clear(); 72 | this.comboBoxRandomGeneratorMode.Items.AddRange(new object[] { 73 | randomGeneratorModeDropDown["phrase"], 74 | randomGeneratorModeDropDown["string"], 75 | }); 76 | } 77 | } 78 | } 79 | -------------------------------------------------------------------------------- /JitsiMeetOutlook/Resources/languages.Designer.cs: -------------------------------------------------------------------------------- 1 | //------------------------------------------------------------------------------ 2 | // 3 | // This code was generated by a tool. 4 | // Runtime Version:4.0.30319.42000 5 | // 6 | // Changes to this file may cause incorrect behavior and will be lost if 7 | // the code is regenerated. 8 | // 9 | //------------------------------------------------------------------------------ 10 | 11 | namespace JitsiMeetOutlook.Resources { 12 | using System; 13 | 14 | 15 | /// 16 | /// A strongly-typed resource class, for looking up localized strings, etc. 17 | /// 18 | // This class was auto-generated by the StronglyTypedResourceBuilder 19 | // class via a tool like ResGen or Visual Studio. 20 | // To add or remove a member, edit your .ResX file then rerun ResGen 21 | // with the /str option, or rebuild your VS project. 22 | [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "16.0.0.0")] 23 | [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] 24 | [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] 25 | internal class languages { 26 | 27 | private static global::System.Resources.ResourceManager resourceMan; 28 | 29 | private static global::System.Globalization.CultureInfo resourceCulture; 30 | 31 | [global::System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")] 32 | internal languages() { 33 | } 34 | 35 | /// 36 | /// Returns the cached ResourceManager instance used by this class. 37 | /// 38 | [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)] 39 | internal static global::System.Resources.ResourceManager ResourceManager { 40 | get { 41 | if (object.ReferenceEquals(resourceMan, null)) { 42 | global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("JitsiMeetOutlook.Resources.languages", typeof(languages).Assembly); 43 | resourceMan = temp; 44 | } 45 | return resourceMan; 46 | } 47 | } 48 | 49 | /// 50 | /// Overrides the current thread's CurrentUICulture property for all 51 | /// resource lookups using this strongly typed resource class. 52 | /// 53 | [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)] 54 | internal static global::System.Globalization.CultureInfo Culture { 55 | get { 56 | return resourceCulture; 57 | } 58 | set { 59 | resourceCulture = value; 60 | } 61 | } 62 | 63 | /// 64 | /// Looks up a localized resource of type System.Byte[]. 65 | /// 66 | internal static byte[] cz { 67 | get { 68 | object obj = ResourceManager.GetObject("cz", resourceCulture); 69 | return ((byte[])(obj)); 70 | } 71 | } 72 | 73 | /// 74 | /// Looks up a localized resource of type System.Byte[]. 75 | /// 76 | internal static byte[] de { 77 | get { 78 | object obj = ResourceManager.GetObject("de", resourceCulture); 79 | return ((byte[])(obj)); 80 | } 81 | } 82 | 83 | /// 84 | /// Looks up a localized resource of type System.Byte[]. 85 | /// 86 | internal static byte[] en { 87 | get { 88 | object obj = ResourceManager.GetObject("en", resourceCulture); 89 | return ((byte[])(obj)); 90 | } 91 | } 92 | 93 | /// 94 | /// Looks up a localized resource of type System.Byte[]. 95 | /// 96 | internal static byte[] es { 97 | get { 98 | object obj = ResourceManager.GetObject("es", resourceCulture); 99 | return ((byte[])(obj)); 100 | } 101 | } 102 | 103 | /// 104 | /// Looks up a localized resource of type System.Byte[]. 105 | /// 106 | internal static byte[] fr { 107 | get { 108 | object obj = ResourceManager.GetObject("fr", resourceCulture); 109 | return ((byte[])(obj)); 110 | } 111 | } 112 | 113 | /// 114 | /// Looks up a localized resource of type System.Byte[]. 115 | /// 116 | internal static byte[] ru { 117 | get { 118 | object obj = ResourceManager.GetObject("ru", resourceCulture); 119 | return ((byte[])(obj)); 120 | } 121 | } 122 | } 123 | } 124 | -------------------------------------------------------------------------------- /JitsiMeetOutlook/ThisAddIn.cs: -------------------------------------------------------------------------------- 1 | using JitsiMeetOutlook.Entities; 2 | using Microsoft.Office.Interop.Outlook; 3 | using System; 4 | using System.IO; 5 | using System.Threading; 6 | using System.Windows.Forms; 7 | using Outlook = Microsoft.Office.Interop.Outlook; 8 | 9 | namespace JitsiMeetOutlook 10 | { 11 | public partial class ThisAddIn 12 | { 13 | public JitsiApiService JitsiApiService; 14 | 15 | // Define these so they are not garbarge collected 16 | private MAPIFolder calendarFolder; 17 | private Items calendarFolderItems; 18 | 19 | private void ThisAddIn_Startup(object sender, EventArgs e) 20 | { 21 | checkFirstRunSettings(); 22 | readLanguageJson(); 23 | 24 | JitsiApiService = new JitsiApiService(); 25 | 26 | // Create Hooks for all Outlook Calendar Items 27 | // Maybe there is a better way, but thats the best I could find. 28 | // It will call the change event multiple times! 29 | calendarFolder = this.Application.Session.GetDefaultFolder(Outlook.OlDefaultFolders.olFolderCalendar); 30 | calendarFolderItems = calendarFolder.Items; 31 | calendarFolderItems.ItemAdd += new 32 | ItemsEvents_ItemAddEventHandler(AppointmentAddedOrChanged); 33 | calendarFolderItems.ItemChange += new 34 | ItemsEvents_ItemChangeEventHandler(AppointmentAddedOrChanged); 35 | } 36 | 37 | private void ThisAddIn_Shutdown(object sender, System.EventArgs e) 38 | { 39 | // Note: Outlook no longer raises this event. If you have code that 40 | // must run when Outlook shuts down, see https://go.microsoft.com/fwlink/?LinkId=506785 41 | } 42 | 43 | private void checkFirstRunSettings() 44 | { 45 | if (isFirstRun()) 46 | { 47 | customSettingsOnFirstRun(); 48 | } 49 | else if (isTxtOlderThanInstallation()) 50 | { 51 | File.Delete(firstRunMarkerFilePath()); 52 | customSettingsOnFirstRun(); 53 | } 54 | } 55 | 56 | private bool isFirstRun() 57 | { 58 | return !File.Exists(firstRunMarkerFilePath()); 59 | } 60 | 61 | private bool isTxtOlderThanInstallation() 62 | { 63 | string mainDllPath = Path.Combine(Properties.Settings.Default.installDirectory, "Jitsi Meet Outlook Add-In.dll.config"); 64 | 65 | FileInfo infoMainDll = new FileInfo(mainDllPath); 66 | FileInfo infoFirstRunTxt = new FileInfo(firstRunMarkerFilePath()); 67 | 68 | return infoMainDll.LastWriteTime > infoFirstRunTxt.LastWriteTime; 69 | } 70 | 71 | private string firstRunMarkerFilePath() 72 | { 73 | string shadowCopyLocation = Path.GetDirectoryName(System.Reflection.Assembly.GetExecutingAssembly().Location); 74 | string firstRunMarkerFile = Path.Combine(shadowCopyLocation, "firstrun.txt"); 75 | 76 | return firstRunMarkerFile; 77 | } 78 | 79 | private void customSettingsOnFirstRun() 80 | { 81 | // Reset settings to those specified during install, and if none were specified, to default settings 82 | Properties.Settings.Default.Reset(); 83 | 84 | // Create a file in the assembly shadow copy location to mark this code as executed 85 | string firstRunText = "This file is created the first time the add-in is launched.\n\nRemoval of this file will reset settings, whereafter it will be re-created on next launch of the add-in."; 86 | File.WriteAllText(firstRunMarkerFilePath(), firstRunText); 87 | } 88 | 89 | public void AppointmentAddedOrChanged(object appointment) 90 | { 91 | // Make sure we only react to Appointments 92 | if (appointment is AppointmentItem) 93 | { 94 | AppointmentItem item = appointment as AppointmentItem; 95 | 96 | if (item.Location == "Jitsi Meet") 97 | { 98 | Utils.RunInThread(() => 99 | { 100 | string recurrencePattern = null; 101 | if (item.IsRecurring) 102 | { 103 | var recurrencebuilder = new Recurrence(); 104 | recurrencePattern = recurrencebuilder.buildRrule(item.GetRecurrencePattern()); 105 | } 106 | 107 | var scheduledConference = new ConferenceSchedulerMessage 108 | { 109 | 110 | ConferenceName = Utils.findRoomId(item.Body,Properties.Settings.Default.Domain), 111 | Start = item.StartUTC, 112 | End = item.EndUTC, 113 | Recurrance = recurrencePattern 114 | }; 115 | JitsiApiService.ScheduleConference(scheduledConference); 116 | }); 117 | } 118 | } 119 | } 120 | 121 | #region VSTO generated code 122 | 123 | /// 124 | /// Required method for Designer support - do not modify 125 | /// the contents of this method with the code editor. 126 | /// 127 | private void InternalStartup() 128 | { 129 | this.Startup += new System.EventHandler(ThisAddIn_Startup); 130 | this.Shutdown += new System.EventHandler(ThisAddIn_Shutdown); 131 | } 132 | 133 | #endregion 134 | } 135 | } 136 | -------------------------------------------------------------------------------- /JitsiMeetOutlook/CalendarRibbonButton.resx: -------------------------------------------------------------------------------- 1 | 2 | 3 | 62 | 63 | 64 | 65 | 66 | 67 | 68 | 69 | 70 | 71 | 72 | 73 | 74 | 75 | 76 | 77 | 78 | 79 | 80 | 81 | 82 | 83 | 84 | 85 | 86 | 87 | 88 | 89 | 90 | 91 | 92 | 93 | 94 | 95 | 96 | 97 | 98 | 99 | 100 | 101 | 102 | 103 | 104 | 105 | 106 | 107 | 108 | 109 | text/microsoft-resx 110 | 111 | 112 | 2.0 113 | 114 | 115 | System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 116 | 117 | 118 | System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 119 | 120 | -------------------------------------------------------------------------------- /JitsiMeetOutlook/AppointmentRibbonGroup.resx: -------------------------------------------------------------------------------- 1 | 2 | 3 | 62 | 63 | 64 | 65 | 66 | 67 | 68 | 69 | 70 | 71 | 72 | 73 | 74 | 75 | 76 | 77 | 78 | 79 | 80 | 81 | 82 | 83 | 84 | 85 | 86 | 87 | 88 | 89 | 90 | 91 | 92 | 93 | 94 | 95 | 96 | 97 | 98 | 99 | 100 | 101 | 102 | 103 | 104 | 105 | 106 | 107 | 108 | 109 | text/microsoft-resx 110 | 111 | 112 | 2.0 113 | 114 | 115 | System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 116 | 117 | 118 | System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 119 | 120 | -------------------------------------------------------------------------------- /JitsiMeetOutlook/JitsiApiService.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using Outlook = Microsoft.Office.Interop.Outlook; 3 | using MessageBox = System.Windows.Forms.MessageBox; 4 | using System.Security.Cryptography; 5 | using System.Text; 6 | using System.Numerics; 7 | using System.Net.Http; 8 | using System.Text.Json; 9 | using System.Collections.Generic; 10 | using JitsiMeetOutlook.Entities; 11 | using System.Threading.Tasks; 12 | using System.Linq; 13 | using System.Net; 14 | using System.Text.Json.Serialization; 15 | using System.Net.Http.Headers; 16 | using System.Security.Claims; 17 | using System.IdentityModel.Tokens.Jwt; 18 | using Microsoft.IdentityModel.Tokens; 19 | 20 | namespace JitsiMeetOutlook 21 | { 22 | public class JitsiApiService 23 | { 24 | readonly HttpClient client = new HttpClient(); 25 | 26 | private readonly JsonSerializerOptions serializerOptions = new JsonSerializerOptions 27 | { 28 | NumberHandling = JsonNumberHandling.AllowReadingFromString, 29 | }; 30 | 31 | private RequestCache PINCache = new RequestCache(); 32 | private RequestCache PhoneNumbersCache = new RequestCache(); 33 | 34 | public JitsiApiService() { 35 | ServicePointManager.SecurityProtocol = SecurityProtocolType.Tls12; 36 | } 37 | 38 | public async Task getPIN(string roomName) 39 | { 40 | string conferenceMapperRequestUrl = $"{Properties.Settings.Default.conferenceMapperEndpoint}?conference={roomName}@conference.{JitsiUrl.getDomain()}"; 41 | 42 | try 43 | { 44 | return await PINCache.GetOrCreate(roomName, async () => 45 | { 46 | HttpResponseMessage response = await client.GetAsync(conferenceMapperRequestUrl); 47 | response.EnsureSuccessStatusCode(); 48 | var responsestring = await response.Content.ReadAsStringAsync(); 49 | return JsonSerializer.Deserialize(responsestring, serializerOptions).IdString; 50 | }); 51 | } 52 | catch (Exception ex) 53 | { 54 | MessageBox.Show("An Error occured within JitsiOutlook: " + ex.Message + ex.InnerException?.Message + ex.InnerException?.InnerException?.Message + " for " + conferenceMapperRequestUrl); 55 | return "ERROR"; 56 | } 57 | } 58 | 59 | public async Task getPhoneNumbers(string roomName) 60 | { 61 | string phoneNumberListRequestUrl = $"{Properties.Settings.Default.phoneNumberListEndpoint}?conference={roomName}@conference.{JitsiUrl.getDomain()}"; 62 | try 63 | { 64 | return await PhoneNumbersCache.GetOrCreate(roomName, async () => 65 | { 66 | HttpResponseMessage response = await client.GetAsync(phoneNumberListRequestUrl); 67 | response.EnsureSuccessStatusCode(); 68 | var responsestring = await response.Content.ReadAsStringAsync(); 69 | PhoneNumberListResponse phoneNumbers = JsonSerializer.Deserialize(responsestring, serializerOptions); 70 | 71 | return phoneNumbers; 72 | }); 73 | } 74 | catch (Exception ex) 75 | { 76 | MessageBox.Show("An Error occured within JitsiOutlook: " + ex.Message + ex.InnerException?.Message + ex.InnerException?.InnerException?.Message + " for " + phoneNumberListRequestUrl); 77 | return new PhoneNumberListResponse { Numbers = new Dictionary>() }; 78 | } 79 | 80 | } 81 | 82 | 83 | public async void ScheduleConference(ConferenceSchedulerMessage scheduledConference) 84 | { 85 | try 86 | { 87 | if (Properties.Settings.Default.conferenceSchedulerEndpoint != String.Empty) 88 | { 89 | string json = JsonSerializer.Serialize(scheduledConference, serializerOptions); 90 | using (var request = new HttpRequestMessage(HttpMethod.Post, Properties.Settings.Default.conferenceSchedulerEndpoint)) 91 | { 92 | var content = new StringContent(json, Encoding.UTF8, "application/json"); 93 | request.Content = content; 94 | request.Headers.Authorization = new AuthenticationHeaderValue("Bearer", GetJWT()); 95 | var response = await client.SendAsync(request); 96 | response.EnsureSuccessStatusCode(); 97 | } 98 | } 99 | } 100 | catch (Exception ex) 101 | { 102 | MessageBox.Show("An Error occured within JitsiOutlook: " + ex.Message + ex.InnerException?.Message + ex.InnerException?.InnerException?.Message + " for " + Properties.Settings.Default.conferenceSchedulerEndpoint); 103 | } 104 | } 105 | 106 | private string GetJWT() 107 | { 108 | var secret = Encoding.ASCII.GetBytes(Properties.Settings.Default.conferenceSchedulerEndpointSecret); 109 | var now = DateTime.UtcNow; 110 | var tokenDescriptor = new SecurityTokenDescriptor 111 | { 112 | //Subject = new ClaimsIdentity(new[] { new Claim("sub", "customer") }), 113 | Issuer = "JitsiOutlookPlugin", 114 | Claims = new Dictionary 115 | { 116 | ["admin"] = true, 117 | }, 118 | IssuedAt = now, 119 | NotBefore = now, 120 | Expires = now + TimeSpan.FromDays(1), 121 | SigningCredentials = new SigningCredentials(new SymmetricSecurityKey(secret), SecurityAlgorithms.HmacSha256Signature) 122 | }; 123 | var tokenHandler = new JwtSecurityTokenHandler(); 124 | var token = tokenHandler.CreateToken(tokenDescriptor); 125 | return tokenHandler.WriteToken(token); 126 | } 127 | } 128 | } 129 | -------------------------------------------------------------------------------- /JitsiMeetOutlook/FormSettings.resx: -------------------------------------------------------------------------------- 1 | 2 | 3 | 62 | 63 | 64 | 65 | 66 | 67 | 68 | 69 | 70 | 71 | 72 | 73 | 74 | 75 | 76 | 77 | 78 | 79 | 80 | 81 | 82 | 83 | 84 | 85 | 86 | 87 | 88 | 89 | 90 | 91 | 92 | 93 | 94 | 95 | 96 | 97 | 98 | 99 | 100 | 101 | 102 | 103 | 104 | 105 | 106 | 107 | 108 | 109 | text/microsoft-resx 110 | 111 | 112 | 2.0 113 | 114 | 115 | System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 116 | 117 | 118 | System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 119 | 120 | 121 | 17, 17 122 | 123 | 124 | 51 125 | 126 | -------------------------------------------------------------------------------- /JitsiMeetOutlook/Properties/Resources.resx: -------------------------------------------------------------------------------- 1 | 2 | 3 | 62 | 63 | 64 | 65 | 66 | 67 | 68 | 69 | 70 | 71 | 72 | 73 | 74 | 75 | 76 | 77 | 78 | 79 | 80 | 81 | 82 | 83 | 84 | 85 | 86 | 87 | 88 | 89 | 90 | 91 | 92 | 93 | 94 | 95 | 96 | 97 | 98 | 99 | 100 | 101 | 102 | 103 | 104 | 105 | 106 | 107 | 108 | 109 | text/microsoft-resx 110 | 111 | 112 | 2.0 113 | 114 | 115 | System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 116 | 117 | 118 | System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 119 | 120 | 121 | 122 | ..\Resources\jitsiLogo_square.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a 123 | 124 | -------------------------------------------------------------------------------- /JitsiMeetOutlook/Properties/Settings.Designer.cs: -------------------------------------------------------------------------------- 1 | //------------------------------------------------------------------------------ 2 | // 3 | // This code was generated by a tool. 4 | // Runtime Version:4.0.30319.42000 5 | // 6 | // Changes to this file may cause incorrect behavior and will be lost if 7 | // the code is regenerated. 8 | // 9 | //------------------------------------------------------------------------------ 10 | 11 | namespace JitsiMeetOutlook.Properties { 12 | 13 | 14 | [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] 15 | [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "17.2.0.0")] 16 | internal sealed partial class Settings : global::System.Configuration.ApplicationSettingsBase { 17 | 18 | private static Settings defaultInstance = ((Settings)(global::System.Configuration.ApplicationSettingsBase.Synchronized(new Settings()))); 19 | 20 | public static Settings Default { 21 | get { 22 | return defaultInstance; 23 | } 24 | } 25 | 26 | [global::System.Configuration.UserScopedSettingAttribute()] 27 | [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] 28 | [global::System.Configuration.DefaultSettingValueAttribute("meet.jit.si")] 29 | public string Domain { 30 | get { 31 | return ((string)(this["Domain"])); 32 | } 33 | set { 34 | this["Domain"] = value; 35 | } 36 | } 37 | 38 | [global::System.Configuration.UserScopedSettingAttribute()] 39 | [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] 40 | [global::System.Configuration.DefaultSettingValueAttribute("False")] 41 | public bool requireDisplayName { 42 | get { 43 | return ((bool)(this["requireDisplayName"])); 44 | } 45 | set { 46 | this["requireDisplayName"] = value; 47 | } 48 | } 49 | 50 | [global::System.Configuration.UserScopedSettingAttribute()] 51 | [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] 52 | [global::System.Configuration.DefaultSettingValueAttribute("False")] 53 | public bool startWithAudioMuted { 54 | get { 55 | return ((bool)(this["startWithAudioMuted"])); 56 | } 57 | set { 58 | this["startWithAudioMuted"] = value; 59 | } 60 | } 61 | 62 | [global::System.Configuration.UserScopedSettingAttribute()] 63 | [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] 64 | [global::System.Configuration.DefaultSettingValueAttribute("False")] 65 | public bool startWithVideoMuted { 66 | get { 67 | return ((bool)(this["startWithVideoMuted"])); 68 | } 69 | set { 70 | this["startWithVideoMuted"] = value; 71 | } 72 | } 73 | 74 | [global::System.Configuration.UserScopedSettingAttribute()] 75 | [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] 76 | [global::System.Configuration.DefaultSettingValueAttribute("")] 77 | public string roomID { 78 | get { 79 | return ((string)(this["roomID"])); 80 | } 81 | set { 82 | this["roomID"] = value; 83 | } 84 | } 85 | 86 | [global::System.Configuration.UserScopedSettingAttribute()] 87 | [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] 88 | [global::System.Configuration.DefaultSettingValueAttribute("")] 89 | public string installDirectory { 90 | get { 91 | return ((string)(this["installDirectory"])); 92 | } 93 | set { 94 | this["installDirectory"] = value; 95 | } 96 | } 97 | 98 | [global::System.Configuration.UserScopedSettingAttribute()] 99 | [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] 100 | [global::System.Configuration.DefaultSettingValueAttribute("en")] 101 | public string language { 102 | get { 103 | return ((string)(this["language"])); 104 | } 105 | set { 106 | this["language"] = value; 107 | } 108 | } 109 | 110 | [global::System.Configuration.UserScopedSettingAttribute()] 111 | [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] 112 | [global::System.Configuration.DefaultSettingValueAttribute("phrase")] 113 | public string randomRoomIdGeneratorMode { 114 | get { 115 | return ((string)(this["randomRoomIdGeneratorMode"])); 116 | } 117 | set { 118 | this["randomRoomIdGeneratorMode"] = value; 119 | } 120 | } 121 | 122 | [global::System.Configuration.UserScopedSettingAttribute()] 123 | [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] 124 | [global::System.Configuration.DefaultSettingValueAttribute("https://api.jitsi.net/conferenceMapper")] 125 | public string conferenceMapperEndpoint { 126 | get { 127 | return ((string)(this["conferenceMapperEndpoint"])); 128 | } 129 | set { 130 | this["conferenceMapperEndpoint"] = value; 131 | } 132 | } 133 | 134 | [global::System.Configuration.UserScopedSettingAttribute()] 135 | [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] 136 | [global::System.Configuration.DefaultSettingValueAttribute("https://api.jitsi.net/phoneNumberList")] 137 | public string phoneNumberListEndpoint { 138 | get { 139 | return ((string)(this["phoneNumberListEndpoint"])); 140 | } 141 | set { 142 | this["phoneNumberListEndpoint"] = value; 143 | } 144 | } 145 | 146 | [global::System.Configuration.UserScopedSettingAttribute()] 147 | [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] 148 | [global::System.Configuration.DefaultSettingValueAttribute("")] 149 | public string conferenceSchedulerEndpoint { 150 | get { 151 | return ((string)(this["conferenceSchedulerEndpoint"])); 152 | } 153 | set { 154 | this["conferenceSchedulerEndpoint"] = value; 155 | } 156 | } 157 | 158 | [global::System.Configuration.UserScopedSettingAttribute()] 159 | [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] 160 | [global::System.Configuration.DefaultSettingValueAttribute("")] 161 | public string conferenceSchedulerEndpointSecret { 162 | get { 163 | return ((string)(this["conferenceSchedulerEndpointSecret"])); 164 | } 165 | set { 166 | this["conferenceSchedulerEndpointSecret"] = value; 167 | } 168 | } 169 | } 170 | } 171 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | ## Ignore Visual Studio temporary files, build results, and 2 | ## files generated by popular Visual Studio add-ons. 3 | ## 4 | ## Get latest from https://github.com/github/gitignore/blob/master/VisualStudio.gitignore 5 | 6 | # User-specific files 7 | *.rsuser 8 | *.suo 9 | *.user 10 | *.userosscache 11 | *.sln.docstates 12 | 13 | # User-specific files (MonoDevelop/Xamarin Studio) 14 | *.userprefs 15 | 16 | # Build results 17 | [Dd]ebug/ 18 | [Dd]ebugPublic/ 19 | [Rr]elease/ 20 | [Rr]eleases/ 21 | x64/ 22 | x86/ 23 | [Aa][Rr][Mm]/ 24 | [Aa][Rr][Mm]64/ 25 | bld/ 26 | [Bb]in/ 27 | [Oo]bj/ 28 | [Ll]og/ 29 | 30 | # Visual Studio 2015/2017 cache/options directory 31 | .vs/ 32 | # Uncomment if you have tasks that create the project's static files in wwwroot 33 | #wwwroot/ 34 | 35 | # Visual Studio 2017 auto generated files 36 | Generated\ Files/ 37 | 38 | # MSTest test Results 39 | [Tt]est[Rr]esult*/ 40 | [Bb]uild[Ll]og.* 41 | 42 | # NUNIT 43 | *.VisualState.xml 44 | TestResult.xml 45 | 46 | # Build Results of an ATL Project 47 | [Dd]ebugPS/ 48 | [Rr]eleasePS/ 49 | dlldata.c 50 | 51 | # Benchmark Results 52 | BenchmarkDotNet.Artifacts/ 53 | 54 | # .NET Core 55 | project.lock.json 56 | project.fragment.lock.json 57 | artifacts/ 58 | 59 | # StyleCop 60 | StyleCopReport.xml 61 | 62 | # Files built by Visual Studio 63 | *_i.c 64 | *_p.c 65 | *_h.h 66 | *.ilk 67 | *.meta 68 | *.obj 69 | *.iobj 70 | *.pch 71 | *.pdb 72 | *.ipdb 73 | *.pgc 74 | *.pgd 75 | *.rsp 76 | *.sbr 77 | *.tlb 78 | *.tli 79 | *.tlh 80 | *.tmp 81 | *.tmp_proj 82 | *_wpftmp.csproj 83 | *.log 84 | *.vspscc 85 | *.vssscc 86 | .builds 87 | *.pidb 88 | *.svclog 89 | *.scc 90 | 91 | # Chutzpah Test files 92 | _Chutzpah* 93 | 94 | # Visual C++ cache files 95 | ipch/ 96 | *.aps 97 | *.ncb 98 | *.opendb 99 | *.opensdf 100 | *.sdf 101 | *.cachefile 102 | *.VC.db 103 | *.VC.VC.opendb 104 | 105 | # Visual Studio profiler 106 | *.psess 107 | *.vsp 108 | *.vspx 109 | *.sap 110 | 111 | # Visual Studio Trace Files 112 | *.e2e 113 | 114 | # TFS 2012 Local Workspace 115 | $tf/ 116 | 117 | # Guidance Automation Toolkit 118 | *.gpState 119 | 120 | # ReSharper is a .NET coding add-in 121 | _ReSharper*/ 122 | *.[Rr]e[Ss]harper 123 | *.DotSettings.user 124 | 125 | # JustCode is a .NET coding add-in 126 | .JustCode 127 | 128 | # TeamCity is a build add-in 129 | _TeamCity* 130 | 131 | # DotCover is a Code Coverage Tool 132 | *.dotCover 133 | 134 | # AxoCover is a Code Coverage Tool 135 | .axoCover/* 136 | !.axoCover/settings.json 137 | 138 | # Visual Studio code coverage results 139 | *.coverage 140 | *.coveragexml 141 | 142 | # NCrunch 143 | _NCrunch_* 144 | .*crunch*.local.xml 145 | nCrunchTemp_* 146 | 147 | # MightyMoose 148 | *.mm.* 149 | AutoTest.Net/ 150 | 151 | # Web workbench (sass) 152 | .sass-cache/ 153 | 154 | # Installshield output folder 155 | [Ee]xpress/ 156 | 157 | # DocProject is a documentation generator add-in 158 | DocProject/buildhelp/ 159 | DocProject/Help/*.HxT 160 | DocProject/Help/*.HxC 161 | DocProject/Help/*.hhc 162 | DocProject/Help/*.hhk 163 | DocProject/Help/*.hhp 164 | DocProject/Help/Html2 165 | DocProject/Help/html 166 | 167 | # Click-Once directory 168 | publish/ 169 | 170 | # Publish Web Output 171 | *.[Pp]ublish.xml 172 | *.azurePubxml 173 | # Note: Comment the next line if you want to checkin your web deploy settings, 174 | # but database connection strings (with potential passwords) will be unencrypted 175 | *.pubxml 176 | *.publishproj 177 | 178 | # Microsoft Azure Web App publish settings. Comment the next line if you want to 179 | # checkin your Azure Web App publish settings, but sensitive information contained 180 | # in these scripts will be unencrypted 181 | PublishScripts/ 182 | 183 | # NuGet Packages 184 | *.nupkg 185 | # The packages folder can be ignored because of Package Restore 186 | **/[Pp]ackages/* 187 | # except build/, which is used as an MSBuild target. 188 | !**/[Pp]ackages/build/ 189 | # Uncomment if necessary however generally it will be regenerated when needed 190 | #!**/[Pp]ackages/repositories.config 191 | # NuGet v3's project.json files produces more ignorable files 192 | *.nuget.props 193 | *.nuget.targets 194 | 195 | # Microsoft Azure Build Output 196 | csx/ 197 | *.build.csdef 198 | 199 | # Microsoft Azure Emulator 200 | ecf/ 201 | rcf/ 202 | 203 | # Windows Store app package directories and files 204 | AppPackages/ 205 | BundleArtifacts/ 206 | Package.StoreAssociation.xml 207 | _pkginfo.txt 208 | *.appx 209 | 210 | # Visual Studio cache files 211 | # files ending in .cache can be ignored 212 | *.[Cc]ache 213 | # but keep track of directories ending in .cache 214 | !?*.[Cc]ache/ 215 | 216 | # Others 217 | ClientBin/ 218 | ~$* 219 | *~ 220 | *.dbmdl 221 | *.dbproj.schemaview 222 | *.jfm 223 | *.pfx 224 | *.publishsettings 225 | orleans.codegen.cs 226 | 227 | # Including strong name files can present a security risk 228 | # (https://github.com/github/gitignore/pull/2483#issue-259490424) 229 | #*.snk 230 | 231 | # Since there are multiple workflows, uncomment next line to ignore bower_components 232 | # (https://github.com/github/gitignore/pull/1529#issuecomment-104372622) 233 | #bower_components/ 234 | 235 | # RIA/Silverlight projects 236 | Generated_Code/ 237 | 238 | # Backup & report files from converting an old project file 239 | # to a newer Visual Studio version. Backup files are not needed, 240 | # because we have git ;-) 241 | _UpgradeReport_Files/ 242 | Backup*/ 243 | UpgradeLog*.XML 244 | UpgradeLog*.htm 245 | ServiceFabricBackup/ 246 | *.rptproj.bak 247 | 248 | # SQL Server files 249 | *.mdf 250 | *.ldf 251 | *.ndf 252 | 253 | # Business Intelligence projects 254 | *.rdl.data 255 | *.bim.layout 256 | *.bim_*.settings 257 | *.rptproj.rsuser 258 | *- Backup*.rdl 259 | 260 | # Microsoft Fakes 261 | FakesAssemblies/ 262 | 263 | # GhostDoc plugin setting file 264 | *.GhostDoc.xml 265 | 266 | # Node.js Tools for Visual Studio 267 | .ntvs_analysis.dat 268 | node_modules/ 269 | 270 | # Visual Studio 6 build log 271 | *.plg 272 | 273 | # Visual Studio 6 workspace options file 274 | *.opt 275 | 276 | # Visual Studio 6 auto-generated workspace file (contains which files were open etc.) 277 | *.vbw 278 | 279 | # Visual Studio LightSwitch build output 280 | **/*.HTMLClient/GeneratedArtifacts 281 | **/*.DesktopClient/GeneratedArtifacts 282 | **/*.DesktopClient/ModelManifest.xml 283 | **/*.Server/GeneratedArtifacts 284 | **/*.Server/ModelManifest.xml 285 | _Pvt_Extensions 286 | 287 | # Paket dependency manager 288 | .paket/paket.exe 289 | paket-files/ 290 | 291 | # FAKE - F# Make 292 | .fake/ 293 | 294 | # JetBrains Rider 295 | .idea/ 296 | *.sln.iml 297 | 298 | # CodeRush personal settings 299 | .cr/personal 300 | 301 | # Python Tools for Visual Studio (PTVS) 302 | __pycache__/ 303 | *.pyc 304 | 305 | # Cake - Uncomment if you are using it 306 | # tools/** 307 | # !tools/packages.config 308 | 309 | # Tabs Studio 310 | *.tss 311 | 312 | # Telerik's JustMock configuration file 313 | *.jmconfig 314 | 315 | # BizTalk build output 316 | *.btp.cs 317 | *.btm.cs 318 | *.odx.cs 319 | *.xsd.cs 320 | 321 | # OpenCover UI analysis results 322 | OpenCover/ 323 | 324 | # Azure Stream Analytics local run output 325 | ASALocalRun/ 326 | 327 | # MSBuild Binary and Structured Log 328 | *.binlog 329 | 330 | # NVidia Nsight GPU debugger configuration file 331 | *.nvuser 332 | 333 | # MFractors (Xamarin productivity tool) working folder 334 | .mfractor/ 335 | 336 | # Local History for Visual Studio 337 | .localhistory/ 338 | 339 | # BeatPulse healthcheck temp database 340 | healthchecksdb 341 | /images/image_edits.pptx 342 | -------------------------------------------------------------------------------- /JitsiMeetOutlook/Resources/languages.resx: -------------------------------------------------------------------------------- 1 | 2 | 3 | 62 | 63 | 64 | 65 | 66 | 67 | 68 | 69 | 70 | 71 | 72 | 73 | 74 | 75 | 76 | 77 | 78 | 79 | 80 | 81 | 82 | 83 | 84 | 85 | 86 | 87 | 88 | 89 | 90 | 91 | 92 | 93 | 94 | 95 | 96 | 97 | 98 | 99 | 100 | 101 | 102 | 103 | 104 | 105 | 106 | 107 | 108 | 109 | text/microsoft-resx 110 | 111 | 112 | 2.0 113 | 114 | 115 | System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 116 | 117 | 118 | System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 119 | 120 | 121 | 122 | ..\languages\cz.json;System.Byte[], mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 123 | 124 | 125 | ..\languages\de.json;System.Byte[], mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 126 | 127 | 128 | ..\languages\en.json;System.Byte[], mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 129 | 130 | 131 | ..\languages\es.json;System.Byte[], mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 132 | 133 | 134 | ..\languages\fr.json;System.Byte[], mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 135 | 136 | 137 | ..\languages\ru.json;System.Byte[], mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 138 | 139 | -------------------------------------------------------------------------------- /JitsiMeetOutlook/Recurrence.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Text; 5 | using System.Threading.Tasks; 6 | 7 | using Microsoft.Office.Interop.Outlook; 8 | using System.Windows.Forms; 9 | /** 10 | * Copied from https://github.com/phw198/OutlookGoogleCalendarSync/blob/master/src/OutlookGoogleCalendarSync/Recurrence.cs 11 | * Please retain the Copyright notice: MPL-2 12 | * https://github.com/phw198/OutlookGoogleCalendarSync/blob/master/license.md 13 | */ 14 | 15 | namespace JitsiMeetOutlook 16 | { 17 | class Recurrence 18 | { 19 | /* 20 | * Recurrence rule standards for iCalendar: http://www.ietf.org/rfc/rfc2445 21 | */ 22 | private static Recurrence instance; 23 | public static Recurrence Instance 24 | { 25 | get 26 | { 27 | if (instance == null) instance = new Recurrence(); 28 | return instance; 29 | } 30 | } 31 | 32 | public Recurrence() { } 33 | 34 | private Dictionary rrule = new Dictionary(); 35 | 36 | /// 37 | /// Maps to RRule () 38 | /// 39 | /// Recurrence Pattern 40 | /// RFC compliant RRule 41 | public string buildRrule(RecurrencePattern oPattern) 42 | { 43 | rrule = new Dictionary(); 44 | 45 | switch (oPattern.RecurrenceType) 46 | { 47 | case OlRecurrenceType.olRecursDaily: 48 | { 49 | addRule(rrule, "FREQ", "DAILY"); 50 | setInterval(oPattern.Interval); 51 | break; 52 | } 53 | 54 | case OlRecurrenceType.olRecursWeekly: 55 | { 56 | addRule(rrule, "FREQ", "WEEKLY"); 57 | setInterval(oPattern.Interval); 58 | if ((oPattern.DayOfWeekMask & (oPattern.DayOfWeekMask - 1)) != 0) 59 | { //is not a power of 2 (i.e. not just a single day) 60 | // Need to work out "BY" pattern 61 | // Eg "BYDAY=MO,TU,WE,TH,FR" 62 | addRule(rrule, "BYDAY", string.Join(",", getByDay(oPattern.DayOfWeekMask).ToArray())); 63 | } 64 | break; 65 | } 66 | 67 | case OlRecurrenceType.olRecursMonthly: 68 | { 69 | addRule(rrule, "FREQ", "MONTHLY"); 70 | setInterval(oPattern.Interval); 71 | //Outlook runs on last day of month if day doesn't exist; Google doesn't run at all - so fix 72 | if (oPattern.PatternStartDate.Day > 28) 73 | { 74 | addRule(rrule, "BYDAY", "SU,MO,TU,WE,TH,FR,SA"); 75 | addRule(rrule, "BYSETPOS", "-1"); 76 | } 77 | break; 78 | } 79 | 80 | case OlRecurrenceType.olRecursMonthNth: 81 | { 82 | addRule(rrule, "FREQ", "MONTHLY"); 83 | setInterval(oPattern.Interval); 84 | addRule(rrule, "BYDAY", string.Join(",", getByDay(oPattern.DayOfWeekMask).ToArray())); 85 | addRule(rrule, "BYSETPOS", (oPattern.Instance == 5) ? "-1" : oPattern.Instance.ToString()); 86 | break; 87 | } 88 | 89 | case OlRecurrenceType.olRecursYearly: 90 | { 91 | addRule(rrule, "FREQ", "YEARLY"); 92 | //Google interval is years, Outlook is months 93 | if (oPattern.Interval != 12) 94 | addRule(rrule, "INTERVAL", (oPattern.Interval / 12).ToString()); 95 | break; 96 | } 97 | 98 | case OlRecurrenceType.olRecursYearNth: 99 | { 100 | //Issue 445: Outlook incorrectly surfaces 12 monthly recurrences as olRecursYearNth, so we'll undo that. 101 | //In addition, many apps, indeed even the Google webapp, doesn't display a yearly recurrence rule properly 102 | //despite actually showing the events on the right dates. 103 | //So to make OGCS work better with apps that aren't providing full iCal functionality, we'll translate this 104 | //into a monthly recurrence instead. 105 | addRule(rrule, "FREQ", "MONTHLY"); 106 | addRule(rrule, "INTERVAL", oPattern.Interval.ToString()); 107 | 108 | /*Strictly, what we /should/ be doing is: 109 | addRule(rrule, "FREQ", "YEARLY"); 110 | if (oPattern.Interval != 12) 111 | addRule(rrule, "INTERVAL", (oPattern.Interval / 12).ToString()); 112 | addRule(rrule, "BYMONTH", oPattern.MonthOfYear.ToString()); 113 | */ 114 | if (oPattern.DayOfWeekMask != (OlDaysOfWeek)127) 115 | { //If not every day of week, define which ones 116 | addRule(rrule, "BYDAY", string.Join(",", getByDay(oPattern.DayOfWeekMask).ToArray())); 117 | } 118 | addRule(rrule, "BYSETPOS", (oPattern.Instance == 5) ? "-1" : oPattern.Instance.ToString()); 119 | break; 120 | } 121 | } 122 | 123 | if (!oPattern.NoEndDate) 124 | { 125 | addRule(rrule, "UNTIL", Recurrence.IANAdate(oPattern.PatternEndDate.ToUniversalTime())); 126 | } 127 | return string.Join(";", rrule.Select(x => x.Key + "=" + x.Value).ToArray()); 128 | } 129 | 130 | private Dictionary explodeRrule(IList allRules) 131 | { 132 | foreach (String rrule in allRules) 133 | { 134 | if (rrule.StartsWith("RRULE:")) 135 | { 136 | String[] rrules = rrule.TrimStart("RRULE:".ToCharArray()).Split(';'); 137 | Dictionary rules = new Dictionary(); 138 | for (int r = 0; r < rrules.Count(); r++) 139 | { 140 | String[] ruleKVPs = rrules[r].Split('='); 141 | rules.Add(ruleKVPs[0], ruleKVPs[1]); 142 | } 143 | return rules; 144 | } 145 | } 146 | // Warn("There aren't any RRULEs present. Outlook doesn't support this: https://support.microsoft.com/en-gb/kb/2643084"); 147 | //foreach (String rule in allRules) 148 | //{ 149 | // log.Debug("rule: " + rule); 150 | //} 151 | return null; 152 | } 153 | 154 | private void addRule(Dictionary ruleBook, string key, string value) 155 | { 156 | ruleBook.Add(key, value); 157 | } 158 | 159 | private void setInterval(int interval) 160 | { 161 | if (interval > 1) addRule(rrule, "INTERVAL", interval.ToString()); 162 | } 163 | 164 | private static List getByDay(OlDaysOfWeek dowMask) 165 | { 166 | List byDay = new List(); 167 | byDay.Add(((dowMask & OlDaysOfWeek.olMonday) != 0) ? "MO" : ""); 168 | byDay.Add(((dowMask & OlDaysOfWeek.olTuesday) != 0) ? "TU" : ""); 169 | byDay.Add(((dowMask & OlDaysOfWeek.olWednesday) != 0) ? "WE" : ""); 170 | byDay.Add(((dowMask & OlDaysOfWeek.olThursday) != 0) ? "TH" : ""); 171 | byDay.Add(((dowMask & OlDaysOfWeek.olFriday) != 0) ? "FR" : ""); 172 | byDay.Add(((dowMask & OlDaysOfWeek.olSaturday) != 0) ? "SA" : ""); 173 | byDay.Add(((dowMask & OlDaysOfWeek.olSunday) != 0) ? "SU" : ""); 174 | byDay = byDay.Where(s => !string.IsNullOrEmpty(s)).ToList(); 175 | return byDay; 176 | } 177 | private static OlDaysOfWeek getDOWmask(Dictionary ruleBook) 178 | { 179 | OlDaysOfWeek dowMask = 0; 180 | if (ruleBook.ContainsKey("BYDAY")) dowMask = getDOWmask(ruleBook["BYDAY"]); 181 | return dowMask; 182 | } 183 | private static OlDaysOfWeek getDOWmask(String byDay) 184 | { 185 | OlDaysOfWeek dowMask = 0; 186 | if (byDay.Contains("MO")) dowMask |= OlDaysOfWeek.olMonday; 187 | if (byDay.Contains("TU")) dowMask |= OlDaysOfWeek.olTuesday; 188 | if (byDay.Contains("WE")) dowMask |= OlDaysOfWeek.olWednesday; 189 | if (byDay.Contains("TH")) dowMask |= OlDaysOfWeek.olThursday; 190 | if (byDay.Contains("FR")) dowMask |= OlDaysOfWeek.olFriday; 191 | if (byDay.Contains("SA")) dowMask |= OlDaysOfWeek.olSaturday; 192 | if (byDay.Contains("SU")) dowMask |= OlDaysOfWeek.olSunday; 193 | return dowMask; 194 | } 195 | 196 | public static String IANAdate(DateTime dt) 197 | { 198 | return dt.ToString("yyyyMMddTHHmmssZ"); 199 | } 200 | } 201 | } -------------------------------------------------------------------------------- /SettingsInstallerParameters/CustomAction.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.IO; 3 | using System.Linq; 4 | using System.Xml; 5 | using Microsoft.Deployment.WindowsInstaller; 6 | 7 | namespace SettingsInstallerParameters 8 | { 9 | public class CustomActions 10 | { 11 | 12 | [CustomAction] 13 | public static ActionResult UpdateConfigXml(Session session) 14 | { 15 | session.Log("Starting UpdateConfigXml"); 16 | try 17 | { 18 | updateConfigXml(session); 19 | session.Log("Successfully finished UpdateConfigXml"); 20 | return ActionResult.Success; 21 | } 22 | catch (Exception err) 23 | { 24 | session.Log("An issue was encountered in UpdateConfigXml:\n" + err); 25 | return ActionResult.Failure; 26 | } 27 | } 28 | 29 | private static void updateConfigXml(Session session) 30 | { 31 | // Write install path to config file 32 | string xmlPath = Path.Combine(getInstallDir(session), "JitsiMeetOutlookAddIn.dll.config"); 33 | 34 | session.Log($"Executing on file: {xmlPath}"); 35 | if (!File.Exists(xmlPath)) 36 | { 37 | session.Log($"File to patch does not exist: {xmlPath}"); 38 | return; 39 | } 40 | 41 | // TODO: Implement new settings 42 | 43 | XmlDocument document = new XmlDocument(); 44 | document.Load(xmlPath); 45 | System.Xml.XPath.XPathNavigator navigator = document.CreateNavigator(); 46 | 47 | 48 | if (getDomain(session).Length != 0) 49 | { 50 | session.Log($"Setting custom domain: {getDomain(session)}"); 51 | navigator.SelectSingleNode(@"/configuration/userSettings/JitsiMeetOutlook.Properties.Settings/setting[@name='Domain']/value").SetValue(getDomain(session)); 52 | } 53 | 54 | if (getRoomID(session).Length != 0) 55 | { 56 | session.Log($"Setting custom room ID: {getRoomID(session)}"); 57 | navigator.SelectSingleNode(@"/configuration/userSettings/JitsiMeetOutlook.Properties.Settings/setting[@name='roomID']/value").SetValue(getRoomID(session)); 58 | } 59 | 60 | session.Log($"Setting require name option: {getRequireDisplayName(session)}"); 61 | navigator.SelectSingleNode(@"/configuration/userSettings/JitsiMeetOutlook.Properties.Settings/setting[@name='requireDisplayName']/value").SetValue(getRequireDisplayName(session)); 62 | 63 | session.Log($"Setting audio muted option: {getStartWithAudioMuted(session)}"); 64 | navigator.SelectSingleNode(@"/configuration/userSettings/JitsiMeetOutlook.Properties.Settings/setting[@name='startWithAudioMuted']/value").SetValue(getStartWithAudioMuted(session)); 65 | 66 | session.Log($"Setting video muted option: {getStartWithVideoMuted(session)}"); 67 | navigator.SelectSingleNode(@"/configuration/userSettings/JitsiMeetOutlook.Properties.Settings/setting[@name='startWithVideoMuted']/value").SetValue(getStartWithVideoMuted(session)); 68 | 69 | session.Log($"Setting install directory: {getInstallDir(session)}"); 70 | navigator.SelectSingleNode(@"/configuration/userSettings/JitsiMeetOutlook.Properties.Settings/setting[@name='installDirectory']/value").SetValue(getInstallDir(session)); 71 | 72 | session.Log($"Setting display language: {getLanguage(session)}"); 73 | navigator.SelectSingleNode(@"/configuration/userSettings/JitsiMeetOutlook.Properties.Settings/setting[@name='language']/value").SetValue(getLanguage(session)); 74 | 75 | session.Log($"Setting random ID generator mode: {getLanguage(session)}"); 76 | navigator.SelectSingleNode(@"/configuration/userSettings/JitsiMeetOutlook.Properties.Settings/setting[@name='randomRoomIdGeneratorMode']/value").SetValue(getRandomRoomIdGeneratorMode(session)); 77 | 78 | if (getConferenceMapperEndpoint(session).Length != 0) 79 | { 80 | session.Log($"Setting custom ConferenceMapperEndpoint: {getConferenceMapperEndpoint(session)}"); 81 | navigator.SelectSingleNode(@"/configuration/userSettings/JitsiMeetOutlook.Properties.Settings/setting[@name='conferenceMapperEndpoint']/value").SetValue(getConferenceMapperEndpoint(session)); 82 | } 83 | 84 | if (getPhoneNumberListEndpoint(session).Length != 0) 85 | { 86 | session.Log($"Setting custom phoneNumberListEndpoint: {getPhoneNumberListEndpoint(session)}"); 87 | navigator.SelectSingleNode(@"/configuration/userSettings/JitsiMeetOutlook.Properties.Settings/setting[@name='phoneNumberListEndpoint']/value").SetValue(getPhoneNumberListEndpoint(session)); 88 | } 89 | 90 | if (getConferenceSchedulerEndpoint(session).Length != 0) 91 | { 92 | session.Log($"Setting custom conferenceSchedulerEndpoint: {getConferenceSchedulerEndpoint(session)}"); 93 | navigator.SelectSingleNode(@"/configuration/userSettings/JitsiMeetOutlook.Properties.Settings/setting[@name='conferenceSchedulerEndpoint']/value").SetValue(getConferenceSchedulerEndpoint(session)); 94 | } 95 | 96 | if (getConferenceSchedulerEndpointSecret(session).Length != 0) 97 | { 98 | if (getConferenceSchedulerEndpointSecret(session).Length < 8) 99 | { 100 | session.Log($"WARNING: The secret is to short. This will throw errors in the application."); 101 | } 102 | session.Log($"Setting custom conferenceSchedulerEndpointSecret: {getConferenceSchedulerEndpointSecret(session)}"); 103 | navigator.SelectSingleNode(@"/configuration/userSettings/JitsiMeetOutlook.Properties.Settings/setting[@name='conferenceSchedulerEndpointSecret']/value").SetValue(getConferenceSchedulerEndpointSecret(session)); 104 | } 105 | 106 | session.Log($"Saving settings to: {xmlPath}"); 107 | document.Save(xmlPath); 108 | } 109 | 110 | private static string getInstallDir(Session session) 111 | { 112 | return Path.GetDirectoryName(session.CustomActionData["InstallDir"]); 113 | } 114 | 115 | private static string getDomain(Session session) 116 | { 117 | return session.CustomActionData["Domain"]; 118 | } 119 | 120 | private static string getRoomID(Session session) 121 | { 122 | return session.CustomActionData["roomID"]; 123 | } 124 | 125 | private static string getConferenceMapperEndpoint(Session session) 126 | { 127 | return session.CustomActionData["conferenceMapperEndpoint"]; 128 | } 129 | 130 | private static string getPhoneNumberListEndpoint(Session session) 131 | { 132 | return session.CustomActionData["phoneNumberListEndpoint"]; 133 | } 134 | 135 | private static string getConferenceSchedulerEndpoint(Session session) 136 | { 137 | return session.CustomActionData["conferenceSchedulerEndpoint"]; 138 | } 139 | 140 | private static string getConferenceSchedulerEndpointSecret(Session session) 141 | { 142 | return session.CustomActionData["conferenceSchedulerEndpointSecret"]; 143 | } 144 | 145 | private static string getRequireDisplayName(Session session) 146 | { 147 | return getBooleanParameter(session, "requireDisplayName"); 148 | } 149 | 150 | private static string getStartWithAudioMuted(Session session) 151 | { 152 | return getBooleanParameter(session, "startWithAudioMuted"); 153 | } 154 | 155 | private static string getStartWithVideoMuted(Session session) 156 | { 157 | return getBooleanParameter(session, "startWithVideoMuted"); 158 | } 159 | 160 | private static string getLanguage(Session session) 161 | { 162 | string[] availableLanguages = { "en", "cz", "de", "es", "fr", "ru" }; 163 | string userLanguageInput = session.CustomActionData["language"]; 164 | 165 | if (availableLanguages.Contains(userLanguageInput)) 166 | { 167 | return userLanguageInput; 168 | } 169 | else 170 | { 171 | return "en"; 172 | } 173 | 174 | } 175 | 176 | private static string getRandomRoomIdGeneratorMode(Session session) 177 | { 178 | string[] availableModes = { "phrase", "string" }; 179 | string userModeInput = session.CustomActionData["randomRoomIdGeneratorMode"]; 180 | 181 | if (availableModes.Contains(userModeInput)) 182 | { 183 | return userModeInput; 184 | } 185 | else 186 | { 187 | return "phrase"; 188 | } 189 | 190 | } 191 | 192 | 193 | private static string getBooleanParameter(Session session, string parameter) 194 | { 195 | string userInput = session.CustomActionData[parameter]; 196 | 197 | if (userInput == null) 198 | { 199 | return "False"; 200 | } 201 | else if (validBoolSettingInput(userInput)) 202 | { 203 | return ToTitleCase(userInput); 204 | } 205 | else 206 | { 207 | return "False"; 208 | } 209 | } 210 | 211 | private static bool validBoolSettingInput(string input) 212 | { 213 | String[] xmlBoolean = { "true", "false" }; 214 | 215 | if (xmlBoolean.Contains(input.ToLower())) 216 | { 217 | return true; 218 | } 219 | else 220 | { 221 | return false; 222 | } 223 | } 224 | 225 | private static string ToTitleCase(string input) 226 | { 227 | return System.Threading.Thread.CurrentThread.CurrentCulture.TextInfo.ToTitleCase(input.ToLower()); 228 | } 229 | } 230 | } 231 | -------------------------------------------------------------------------------- /JitsiMeetOutlook/FormSettings.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Windows.Forms; 3 | using System.Text.RegularExpressions; 4 | using MessageBox = System.Windows.Forms.MessageBox; 5 | using System.Linq; 6 | using System.Text.Json; 7 | 8 | namespace JitsiMeetOutlook 9 | { 10 | public partial class FormSettings : Form 11 | { 12 | 13 | string defaultDomain; 14 | 15 | public FormSettings() 16 | { 17 | InitializeComponent(); 18 | 19 | // Set default domain 20 | defaultDomain = "meet.jit.si"; 21 | 22 | // Set radio buttons 23 | loadDomainButtons(); 24 | loadRoomIDButtons(); 25 | loadStartWithAudioMutedButtons(); 26 | loadStartWithVideoMutedButtons(); 27 | loadRequireDisplayNameButtons(); 28 | 29 | // Load text field 30 | textBoxDomain.Text = Properties.Settings.Default.Domain; 31 | } 32 | 33 | private void Form1_Load(object sender, EventArgs e) 34 | { 35 | setLanguage(); 36 | loadComboBoxLanguage(); 37 | loadComboBoxRandomGeneratorMode(); 38 | } 39 | 40 | private void buttonOK_Click(object sender, EventArgs e) 41 | { 42 | try 43 | { 44 | setSettings(); 45 | Properties.Settings.Default.Save(); 46 | Dispose(); 47 | } 48 | catch (InvalidOperationException ex) 49 | { 50 | MessageBox.Show(ex.Message); 51 | } 52 | } 53 | 54 | private void buttonCancel_Click(object sender, EventArgs e) 55 | { 56 | Dispose(); 57 | } 58 | 59 | private void radioButtonDefaultDomain_CheckedChanged(object sender, EventArgs e) 60 | { 61 | if (radioButtonDefaultDomain.Checked) 62 | { 63 | textBoxDomain.Enabled = false; 64 | textBoxDomain.Text = defaultDomain; 65 | } 66 | } 67 | 68 | private void radioButtonCustomDomain_CheckedChanged(object sender, EventArgs e) 69 | { 70 | if (radioButtonCustomDomain.Checked) 71 | { 72 | textBoxDomain.Text = null; 73 | textBoxDomain.Enabled = true; 74 | } 75 | } 76 | 77 | private void radioButtonRandomID_CheckedChanged(object sender, EventArgs e) 78 | { 79 | if (radioButtonRandomRoomID.Checked) 80 | { 81 | textBoxRoomID.Enabled = false; 82 | textBoxRoomID.Text = null; 83 | } 84 | } 85 | 86 | private void radioButtonCustomRoomID_CheckedChanged(object sender, EventArgs e) 87 | { 88 | textBoxRoomID.Enabled = true; 89 | } 90 | 91 | private void textBoxDomain_TextChanged(object sender, EventArgs e) 92 | { 93 | 94 | } 95 | 96 | private bool isDefaultDomain() 97 | { 98 | if (Properties.Settings.Default.Domain == defaultDomain) 99 | { 100 | return true; 101 | } 102 | else 103 | { 104 | return false; 105 | } 106 | } 107 | 108 | private void setSettings() 109 | { 110 | // Set domain 111 | if (radioButtonDefaultDomain.Checked) 112 | { 113 | Properties.Settings.Default.Domain = defaultDomain; 114 | } 115 | else 116 | { 117 | string newDomain = cleanDomain(textBoxDomain.Text); 118 | 119 | if (validDomain(newDomain)) 120 | { 121 | Properties.Settings.Default.Domain = newDomain; 122 | } 123 | else 124 | { 125 | throw new InvalidOperationException("The domain entered is not valid.\n\nPlease specify a domain in the format 'your.domain.tld', 'yourdomain.tld' or similar."); 126 | } 127 | } 128 | 129 | // Set room ID 130 | if (radioButtonRandomRoomID.Checked) 131 | { 132 | Properties.Settings.Default.roomID = ""; 133 | } 134 | else 135 | { 136 | if (textBoxRoomID.Text.Length > 0) 137 | { 138 | Properties.Settings.Default.roomID = textBoxRoomID.Text; 139 | } 140 | } 141 | 142 | // Set toggles 143 | if (radioButtonRequireDisplayNameToggled.Checked) 144 | { 145 | Properties.Settings.Default.requireDisplayName = true; 146 | } 147 | else 148 | { 149 | Properties.Settings.Default.requireDisplayName = false; 150 | } 151 | 152 | if (radioButtonStartWithAudioMutedToggled.Checked) 153 | { 154 | Properties.Settings.Default.startWithAudioMuted = true; 155 | } 156 | else 157 | { 158 | Properties.Settings.Default.startWithAudioMuted = false; 159 | } 160 | 161 | if (radioButtonStartWithVideoMutedToggled.Checked) 162 | { 163 | Properties.Settings.Default.startWithVideoMuted = true; 164 | } 165 | else 166 | { 167 | Properties.Settings.Default.startWithVideoMuted = false; 168 | } 169 | 170 | // Set language 171 | string languageSelection = (string)comboBoxLanguage.SelectedItem; 172 | Properties.Settings.Default.language = languageDropDown.FirstOrDefault(x => x.Value == languageSelection).Key; 173 | 174 | // Set random generator mode 175 | string randomGeneratorModeSelection = (string)comboBoxRandomGeneratorMode.SelectedItem; 176 | Properties.Settings.Default.randomRoomIdGeneratorMode = randomGeneratorModeDropDown.FirstOrDefault(x => x.Value == randomGeneratorModeSelection).Key; 177 | } 178 | 179 | private string cleanDomain(string userInput) 180 | { 181 | string withoutEndSlash = Regex.Replace(userInput, "/*$", ""); 182 | 183 | string withoutHttp = Regex.Replace(withoutEndSlash, "^http(s)?://", ""); 184 | 185 | string cleanedDomain = withoutHttp; 186 | 187 | return cleanedDomain; 188 | } 189 | 190 | private void exitToolStripMenuItem_Click(object sender, EventArgs e) 191 | { 192 | Dispose(); 193 | } 194 | 195 | private bool validDomain(string domain) 196 | { 197 | string domainWithoutPort = Regex.Replace(domain, ":\\d+", ""); 198 | 199 | return Uri.CheckHostName(domainWithoutPort) != UriHostNameType.Unknown; 200 | } 201 | 202 | private void loadDomainButtons() 203 | { 204 | if (isDefaultDomain()) 205 | { 206 | radioButtonDefaultDomain.Checked = true; 207 | radioButtonCustomDomain.Checked = false; 208 | } 209 | else 210 | { 211 | radioButtonDefaultDomain.Checked = false; 212 | radioButtonCustomDomain.Checked = true; 213 | } 214 | } 215 | 216 | private void loadRoomIDButtons() 217 | { 218 | if (Properties.Settings.Default.roomID.Length == 0) 219 | { 220 | radioButtonRandomRoomID.Checked = true; 221 | radioButtonCustomRoomID.Checked = false; 222 | } 223 | else 224 | { 225 | radioButtonRandomRoomID.Checked = false; 226 | radioButtonCustomRoomID.Checked = true; 227 | textBoxRoomID.Text = Properties.Settings.Default.roomID; 228 | } 229 | } 230 | 231 | private void loadRequireDisplayNameButtons() 232 | { 233 | if (Properties.Settings.Default.requireDisplayName) 234 | { 235 | radioButtonRequireDisplayNameToggled.Checked = true; 236 | radioButtonRequireDisplayNameUntoggled.Checked = false; 237 | } 238 | else 239 | { 240 | radioButtonRequireDisplayNameToggled.Checked = false; 241 | radioButtonRequireDisplayNameUntoggled.Checked = true; 242 | } 243 | } 244 | 245 | private void loadStartWithAudioMutedButtons() 246 | { 247 | if (Properties.Settings.Default.startWithAudioMuted) 248 | { 249 | radioButtonStartWithAudioMutedToggled.Checked = true; 250 | radioButtonStartWithAudioMutedUntoggled.Checked = false; 251 | } 252 | else 253 | { 254 | radioButtonStartWithAudioMutedToggled.Checked = false; 255 | radioButtonStartWithAudioMutedUntoggled.Checked = true; 256 | } 257 | } 258 | 259 | private void loadStartWithVideoMutedButtons() 260 | { 261 | if (Properties.Settings.Default.startWithVideoMuted) 262 | { 263 | radioButtonStartWithVideoMutedToggled.Checked = true; 264 | radioButtonStartWithVideoMutedUntoggled.Checked = false; 265 | } 266 | else 267 | { 268 | radioButtonStartWithVideoMutedToggled.Checked = false; 269 | radioButtonStartWithVideoMutedUntoggled.Checked = true; 270 | } 271 | } 272 | 273 | private void loadComboBoxLanguage() 274 | { 275 | JsonElement jsonUILanguage = Globals.ThisAddIn.getLanguageJsonRoot().GetProperty("settings"); 276 | comboBoxLanguage.SelectedItem = jsonUILanguage.GetProperty("comboBoxLanguageItems").GetProperty(Properties.Settings.Default.language).GetString(); 277 | } 278 | 279 | private void loadComboBoxRandomGeneratorMode() 280 | { 281 | JsonElement jsonUILanguage = Globals.ThisAddIn.getLanguageJsonRoot().GetProperty("settings"); 282 | comboBoxRandomGeneratorMode.SelectedItem = jsonUILanguage.GetProperty("comboBoxRandomGeneratorMode").GetProperty(Properties.Settings.Default.randomRoomIdGeneratorMode).GetString(); 283 | } 284 | 285 | private void comboBoxLanguage_SelectedIndexChanged(object sender, EventArgs e) 286 | { 287 | 288 | } 289 | } 290 | } 291 | -------------------------------------------------------------------------------- /JitsiMeetOutlookTests/JitsiMeetOutlookTests.csproj: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | Debug 6 | AnyCPU 7 | {B355F03D-DB54-426C-BD96-59E3CF66EEA1} 8 | Library 9 | Properties 10 | JitsiMeetOutlookTests 11 | JitsiMeetOutlookTests 12 | v4.7.2 13 | 512 14 | {3AC096D0-A1C2-E12C-1390-A8335801FDAB};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC} 15 | 10.0 16 | $(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v$(VisualStudioVersion) 17 | $(ProgramFiles)\Common Files\microsoft shared\VSTT\$(VisualStudioVersion)\UITestExtensionPackages 18 | False 19 | UnitTest 20 | 21 | 22 | 23 | 24 | true 25 | full 26 | false 27 | bin\Debug\ 28 | DEBUG;TRACE 29 | prompt 30 | 4 31 | 32 | 33 | pdbonly 34 | true 35 | bin\Release\ 36 | TRACE 37 | prompt 38 | 4 39 | 40 | 41 | 42 | ..\packages\FluentAssertions.6.7.0\lib\net47\FluentAssertions.dll 43 | 44 | 45 | 46 | ..\packages\MSTest.TestFramework.2.2.7\lib\net45\Microsoft.VisualStudio.TestPlatform.TestFramework.dll 47 | 48 | 49 | ..\packages\MSTest.TestFramework.2.2.7\lib\net45\Microsoft.VisualStudio.TestPlatform.TestFramework.Extensions.dll 50 | 51 | 52 | 53 | 54 | 55 | 56 | ..\packages\System.IO.4.3.0\lib\net462\System.IO.dll 57 | True 58 | True 59 | 60 | 61 | ..\packages\System.Net.Http.4.3.4\lib\net46\System.Net.Http.dll 62 | True 63 | True 64 | 65 | 66 | ..\packages\System.Runtime.4.3.0\lib\net462\System.Runtime.dll 67 | True 68 | True 69 | 70 | 71 | ..\packages\System.Runtime.CompilerServices.Unsafe.4.5.0\lib\netstandard2.0\System.Runtime.CompilerServices.Unsafe.dll 72 | 73 | 74 | ..\packages\System.Security.Cryptography.Algorithms.4.3.0\lib\net463\System.Security.Cryptography.Algorithms.dll 75 | True 76 | True 77 | 78 | 79 | ..\packages\System.Security.Cryptography.Encoding.4.3.0\lib\net46\System.Security.Cryptography.Encoding.dll 80 | True 81 | True 82 | 83 | 84 | ..\packages\System.Security.Cryptography.Primitives.4.3.0\lib\net46\System.Security.Cryptography.Primitives.dll 85 | True 86 | True 87 | 88 | 89 | ..\packages\System.Security.Cryptography.X509Certificates.4.3.0\lib\net461\System.Security.Cryptography.X509Certificates.dll 90 | True 91 | True 92 | 93 | 94 | ..\packages\System.Threading.Tasks.Extensions.4.5.0\lib\netstandard2.0\System.Threading.Tasks.Extensions.dll 95 | 96 | 97 | 98 | 99 | 100 | 101 | 102 | 103 | 104 | 105 | 106 | 107 | 108 | 109 | 110 | 111 | 112 | 113 | 114 | 115 | 116 | 117 | {92DD44F5-9B8C-4D40-AE0E-9B1EDEE99449} 118 | JitsiMeetOutlook 119 | 120 | 121 | 122 | 123 | 124 | 125 | False 126 | 127 | 128 | False 129 | 130 | 131 | False 132 | 133 | 134 | False 135 | 136 | 137 | 138 | 139 | 140 | 141 | 142 | 143 | This project references NuGet package(s) that are missing on this computer. Use NuGet Package Restore to download them. For more information, see http://go.microsoft.com/fwlink/?LinkID=322105. The missing file is {0}. 144 | 145 | 146 | 147 | 148 | 149 | 156 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # Jitsi Meet Outlook Add-In 2 | 3 | ## Introduction 4 | 5 | This is a small plug-in that aims to integrate Jitsi Meet with Microsoft Outlook. Specifically, it adds two main features: 6 | 7 | 1. A button in the Outlook calendar tab that opens a new appointment and inserts a randomly generated Jitsi Meet URL. 8 | 2. A set of controls in the Outlook appointment window that, for example, allows for specification of a Room ID of choice and whether participants will be muted upon entry to the room. 9 | 10 | It was created to fulfil [this](https://community.jitsi.org/t/plug-ins-for-adding-jitsi-meet-links-to-appointment-requests-emails/21564) request, and more generally with a view to facilitate organisational use of Jitsi Meet. This project is not affiliated with that of Jitsi Meet nor its creators. 11 | 12 | The screenshots below display the features of implemented in this add-in. 13 | 14 | ## Screenshots 15 | 16 | ### Calendar view 17 | 18 |
19 | 20 | ### Appointment view 21 | 22 | 23 | 24 | ### Settings 25 | 26 | 27 | 28 | ### CMD Install 29 | 30 | 31 | 32 | ## Installation 33 | 34 | ### New 35 | 36 | Go to the [releases](/../../releases) page and download the MSI installer for the latest version. 37 | 38 | For versions prior to 0.5.0: Make sure to download and run the JitsiMeetOutlook-v-windows-.msi file that matches the architecture of your installation of Microsoft Office. I.e. if Office was installed as 64-bit, then run JitsiMeetOutlook-v0.4.0-windows-x64.msi. 39 | 40 | ### Upgrade 41 | 42 | Please uninstall any previously installed version of this add-in via the "Add or remove programs" pane in Windows before upgrading. 43 | 44 | ### Uninstall 45 | 46 | The add-in can be uninstalled via the "Add or remove programs" pane in Windows, or by running the MSI installer again. 47 | 48 | ### Command Line 49 | 50 | As of v0.4.0, the add-in can be installed via command line with custom setting passed as parameters. This works by calling `msiexec` on the .msi installer file. The following parameters can be passed to the installer to preconfigure the Jitsi Meet Outlook add-in settings (all are optional): 51 | 52 | - `TARGETDIR`: Path to the install directory. 53 | - `DOMAIN`: Custom domain. 54 | - `ROOMID`: A default room ID new Jitsi Meet appointments get assigned. 55 | - `MODE`: The mode of the random room ID generator, e.g. phrases or strings. (phrase/string) 56 | - `REQNAME`: Require name by default in new Jitsi Meet appointments. (True/False) 57 | - `NOAUDIO`: Mute audio by default in new Jitsi Meet appointments. (True/False) 58 | - `NOVIDEO`: Disable video by default in new Jitsi Meet appointments. (True/False) 59 | - `LANG`: Specify the display language. Currently, English, French, German, and Russian are available. (en/fr/de/ru) 60 | - `CONFERENCEMAPPER_ENDPOINT`: Endpoint to get the Conference PIN from 61 | - `PHONENUMBERLIST_ENDPOINT`: Endpoint to get the Phone Number from to call in 62 | - `CONFERENCESCHEDULER_ENDPOINT`: Endpoint to send the conference information to in advance, in order to make the call available for call in before the first person joins 63 | - `CONFERENCESCHEDULER_ENDPOINT_SECRET`: Secret for the `CONFERENCESCHEDULER_ENDPOINT`, used for JWT generation. 64 | 65 | Example install command: `msiexec /i "C:\Downloads\JitsiMeetOutlook-v0.6.0-windows-anycpu.msi" TARGETDIR="C:\Program Files (x86)\Jitsi Meet Outlook" DOMAIN="my.domain.com" ROOMID="PermanentRoomName" MODE="string" REQNAME="True" NOAUDIO="True" NOVIDEO="True" LANG="en" CONFERENCEMAPPER_ENDPOINT="https://my.domain.com/conferenceMapper" PHONENUMBERLIST_ENDPOINT="https://my.domain.com/phoneNumberList" /passive` 66 | 67 | All settings can be changed from the settings menu after installation. 68 | 69 | ### Proxy 70 | 71 | Set them via `PROXY_INFORMATION` variable, e.g.: 72 | 73 | ``` 74 | 75 | 76 | 81 | 82 | 83 | 84 | ``` 85 | 86 | ## Roadmap 87 | 88 | The published code and installer is still at an early stage. Preliminarily, the following amendments are in the pipeline: 89 | 90 | - [ ] Add RTF body text to appointment for improved appearance 91 | - [ ] Shift the controls in the appointment ribbon to the left 92 | - [ ] Create appointment with time as specified in the calendar view 93 | - [ ] Add checks for Outlook having been installed on the target computer 94 | - [ ] Add persistent setting: add URL to Location field of appointment 95 | - [x] Add setting allowing users to generate random strings instead of random combinations of words (0.6.0) 96 | - [x] Add possibility for preconfiguration of settings via silent installs (v0.4.0) 97 | - [x] Make the installation procedure less painful (v0.2.0) 98 | - [x] Add small icons to the buttons in the appointment ribbon (v0.2.0) 99 | - [x] Add a button for starting a conference with video muted to appointment tab (v0.2.0) 100 | - [x] Only show Jitsi buttons if appointment was created through "New Jitsi Meeting" (v0.2.0) 101 | - [x] Add persistent setting: change Jitsi domain (v0.2.0) 102 | - [x] Add persistent setting: preference for whether to start a call with muted mic or video (v0.3.0) 103 | - [x] Add persistent setting: assign a default or random room ID on creation of new appointment (v0.3.0) 104 | - [x] Add checks on the validity of the custom domain value provided (v0.2.1) 105 | - [x] Widen the custom Room ID field (v0.2.1) 106 | 107 | Since this plug-in is brand new, any feedback would be most appreciated! 108 | 109 | ## Changelog 110 | 111 | ### v0.7.0 112 | 113 | Breaking: 114 | 115 | Changed the .dll and Registry Entries to not contain spaces anymore. ("Jitsi Meet Outlook Add-In" => "JitsiMeetOutlookAddIn") 116 | 117 | Enhancements: 118 | 119 | - Add Phone Numbers (from the Jitsi Installation pointed to) 120 | - Use Conference PIN (from the Jitsi Installation pointed to, instead of manually generated) 121 | - Add Conference Scheduler to plan meetings ahead of time on the jitsi server side 122 | - Add Button to add Jitsi Conference in normal meetings 123 | - Refactoring to enable modification of already saved/closed meetings 124 | 125 | ### v0.6.6 126 | 127 | Enhancements: 128 | 129 | - Add Czech language support (thanks to [eltovegasag](/../../../../eltovegasag)) 130 | - Add Spanish language support (thanks to [nessor](/../../../../nessor)) 131 | - Patch French language support (thanks to [reseauconcept](/../../../../reseauconcept)) 132 | 133 | ### v0.6.5 134 | 135 | Bugfixes: 136 | 137 | - Upgrade dependencies to patch [security vulnerability](https://github.com/dotnet/runtime/issues/49377) in System.Text.Encodings.Web 4.7.1 138 | 139 | ### v0.6.4 140 | 141 | Enhancements: 142 | 143 | - #40: Set new appointments to Meeting mode by default 144 | - #19: Assign time-slot selection in calendar view to new appointment (thanks to [Extazx2](/../../../../Extazx2)) 145 | 146 | ### v0.6.3 147 | 148 | Bugfixes: 149 | 150 | - Reset ribbon buttons if the link is re-created in an empty appointment. 151 | Enhancements: 152 | - Improved French translation (thanks to [guizmo05](/../../../../guizmo05)) 153 | 154 | ### v0.6.2 155 | 156 | Bugfixes: 157 | 158 | - #26: Plugin no longer breaks when users try to generate a random ID in an appointment where the URL has been partially or completely deleted. A new message and URL is instead added to the appointment. 159 | 160 | ### v0.6.1 161 | 162 | Enhancements: 163 | 164 | - Added German as a language option (thanks to [AdaptiveThinking](/../../../../AdaptiveThinking) for providing the translation) 165 | 166 | ### v0.6.0 167 | 168 | Bugfixes: 169 | 170 | - #11: Room ID names typed by users are now filtered such that only legal characters (latin alphanumeric) enter the URL 171 | - #18: The installer check for VSTO runtime is now less stringent 172 | 173 | Enhancements: 174 | 175 | - #6: Random string generation as a new option 176 | - #20: Translation of random phrases (thanks to [gillesdubois](https://github.com/gillesdubois) for the French translation) 177 | - #17: Minor update to Russian translation 178 | 179 | ### v0.5.1 180 | 181 | Enhancements: 182 | 183 | - Added Russian as a language option (thanks to [semencha](/../../../../semencha) for providing the translation) 184 | - Updated link to the latest VSTO runtime in warning pop-up from install check 185 | 186 | ### v0.5.0 187 | 188 | Enhancements: 189 | 190 | - Added support for changing display language 191 | - Added French as a language option (thanks to [gillesdubois](/../../../../gillesdubois) for providing the translation) 192 | - Installer has been migrated from Microsoft Setup Project to WiX 3.14 for improved reliability 193 | Other issues: 194 | - From this version onwards, the add-in will only be compiled for "AnyCPU", which means that the same installer will work with both x86 and x64 bit versions of Outlook. See more information at [Microsoft's pages](https://docs.microsoft.com/en-us/visualstudio/vsto/building-office-solutions?view=vs-2019#change-the-platform-target). 195 | 196 | ### v0.4.0 197 | 198 | Enhancements: 199 | 200 | - Added possibility of passing custom settings as parameters to the installer via the command line 201 | 202 | ### v0.3.0 203 | 204 | Enhancements: 205 | 206 | - New setting for whether to start a call with muted mic or video 207 | - New setting for whether new appointments should be assigned a random or a default room ID 208 | - The custom domain setting now accepts port specification in the domain name (e.g. my.domain.com:8080) 209 | 210 | ### v0.2.1 211 | 212 | - Bug fixes related to specification of a custom domain 213 | - Custom domain names provided by user now has to pass a validity check 214 | - Improved layout in the appointment view (widened Room ID field and reorganisation of buttons) 215 | 216 | ### v0.2.0 217 | 218 | - The installer no longer prompts trust certificate issues and delegates trust decision to user 219 | - Small icons have been added to the buttons in the appointment ribbon 220 | - A button for starting with the video turned off has been added to the appointment ribbon 221 | - The appointment ribbon buttons are only displayed for appointments created via the "New Jitsi Meeting" button in the calendar tab 222 | - Persistent settings have been enabled 223 | - It is now possible to specify a custom domain in the settings dialogue 224 | - Various small bugs have been fixed to improve reliability 225 | 226 | ### v0.1.0 227 | 228 | - Initial release of the project 229 | -------------------------------------------------------------------------------- /JitsiMeetOutlook/AppointmentRibbonGroup.Designer.cs: -------------------------------------------------------------------------------- 1 | namespace JitsiMeetOutlook 2 | { 3 | partial class AppointmentRibbonGroup : Microsoft.Office.Tools.Ribbon.RibbonBase 4 | { 5 | /// 6 | /// Required designer variable. 7 | /// 8 | private System.ComponentModel.IContainer components = null; 9 | 10 | public AppointmentRibbonGroup() 11 | : base(Globals.Factory.GetRibbonFactory()) 12 | { 13 | InitializeComponent(); 14 | } 15 | 16 | /// 17 | /// Clean up any resources being used. 18 | /// 19 | /// true if managed resources should be disposed; otherwise, false. 20 | protected override void Dispose(bool disposing) 21 | { 22 | if (disposing && (components != null)) 23 | { 24 | components.Dispose(); 25 | } 26 | base.Dispose(disposing); 27 | } 28 | 29 | #region Component Designer generated code 30 | 31 | /// 32 | /// Required method for Designer support - do not modify 33 | /// the contents of this method with the code editor. 34 | /// 35 | private void InitializeComponent() 36 | { 37 | Microsoft.Office.Tools.Ribbon.RibbonDialogLauncher ribbonDialogLauncherImpl1 = this.Factory.CreateRibbonDialogLauncher(); 38 | this.Appointment = this.Factory.CreateRibbonTab(); 39 | this.groupJitsiMeetControls = this.Factory.CreateRibbonGroup(); 40 | this.box1 = this.Factory.CreateRibbonBox(); 41 | this.fieldRoomID = this.Factory.CreateRibbonEditBox(); 42 | this.box2 = this.Factory.CreateRibbonBox(); 43 | this.buttonRandomRoomID = this.Factory.CreateRibbonButton(); 44 | this.buttonStartWithAudioMuted = this.Factory.CreateRibbonToggleButton(); 45 | this.box3 = this.Factory.CreateRibbonBox(); 46 | this.buttonRequireDisplayName = this.Factory.CreateRibbonToggleButton(); 47 | this.buttonStartWithVideoMuted = this.Factory.CreateRibbonToggleButton(); 48 | this.groupNewMeeting = this.Factory.CreateRibbonGroup(); 49 | this.buttonNewJitsiMeeting = this.Factory.CreateRibbonButton(); 50 | this.Appointment.SuspendLayout(); 51 | this.groupJitsiMeetControls.SuspendLayout(); 52 | this.box1.SuspendLayout(); 53 | this.box2.SuspendLayout(); 54 | this.box3.SuspendLayout(); 55 | this.groupNewMeeting.SuspendLayout(); 56 | this.SuspendLayout(); 57 | // 58 | // Appointment 59 | // 60 | this.Appointment.ControlId.ControlIdType = Microsoft.Office.Tools.Ribbon.RibbonControlIdType.Office; 61 | this.Appointment.ControlId.OfficeId = "TabAppointment"; 62 | this.Appointment.Groups.Add(this.groupJitsiMeetControls); 63 | this.Appointment.Groups.Add(this.groupNewMeeting); 64 | this.Appointment.Label = "TabAppointment"; 65 | this.Appointment.Name = "Appointment"; 66 | // 67 | // groupJitsiMeetControls 68 | // 69 | ribbonDialogLauncherImpl1.SuperTip = "Preferences"; 70 | this.groupJitsiMeetControls.DialogLauncher = ribbonDialogLauncherImpl1; 71 | this.groupJitsiMeetControls.Items.Add(this.box1); 72 | this.groupJitsiMeetControls.Items.Add(this.box2); 73 | this.groupJitsiMeetControls.Items.Add(this.box3); 74 | this.groupJitsiMeetControls.Label = "Jitsi Meet"; 75 | this.groupJitsiMeetControls.Name = "groupJitsiMeetControls"; 76 | this.groupJitsiMeetControls.Position = this.Factory.RibbonPosition.BeforeOfficeId("GroupAttendees"); 77 | this.groupJitsiMeetControls.Visible = false; 78 | this.groupJitsiMeetControls.DialogLauncherClick += new Microsoft.Office.Tools.Ribbon.RibbonControlEventHandler(this.buttonDialogLauncher_Click); 79 | // 80 | // box1 81 | // 82 | this.box1.Items.Add(this.fieldRoomID); 83 | this.box1.Name = "box1"; 84 | // 85 | // fieldRoomID 86 | // 87 | this.fieldRoomID.Label = "ID:"; 88 | this.fieldRoomID.Name = "fieldRoomID"; 89 | this.fieldRoomID.OfficeImageId = "StylesPaneNewStyle"; 90 | this.fieldRoomID.ShowImage = true; 91 | this.fieldRoomID.SizeString = "wwwwwwwwwwwwwwwwwwwwww"; 92 | this.fieldRoomID.SuperTip = "Longer names are more secure."; 93 | this.fieldRoomID.Text = null; 94 | this.fieldRoomID.TextChanged += new Microsoft.Office.Tools.Ribbon.RibbonControlEventHandler(this.RoomID_TextChanged); 95 | // 96 | // box2 97 | // 98 | this.box2.Items.Add(this.buttonRandomRoomID); 99 | this.box2.Items.Add(this.buttonStartWithAudioMuted); 100 | this.box2.Name = "box2"; 101 | // 102 | // buttonRandomRoomID 103 | // 104 | this.buttonRandomRoomID.Label = "Random ID"; 105 | this.buttonRandomRoomID.Name = "buttonRandomRoomID"; 106 | this.buttonRandomRoomID.OfficeImageId = "AccessRefreshAllLists"; 107 | this.buttonRandomRoomID.ShowImage = true; 108 | this.buttonRandomRoomID.Click += new Microsoft.Office.Tools.Ribbon.RibbonControlEventHandler(this.buttonCustomiseJitsiMeeting_Click); 109 | // 110 | // buttonStartWithAudioMuted 111 | // 112 | this.buttonStartWithAudioMuted.Label = "Mute on Start"; 113 | this.buttonStartWithAudioMuted.Name = "buttonStartWithAudioMuted"; 114 | this.buttonStartWithAudioMuted.OfficeImageId = "SpeechMicrophone"; 115 | this.buttonStartWithAudioMuted.ShowImage = true; 116 | this.buttonStartWithAudioMuted.Click += new Microsoft.Office.Tools.Ribbon.RibbonControlEventHandler(this.buttonStartWithAudioMuted_Click); 117 | // 118 | // box3 119 | // 120 | this.box3.Items.Add(this.buttonRequireDisplayName); 121 | this.box3.Items.Add(this.buttonStartWithVideoMuted); 122 | this.box3.Name = "box3"; 123 | // 124 | // buttonRequireDisplayName 125 | // 126 | this.buttonRequireDisplayName.Label = "Require Name"; 127 | this.buttonRequireDisplayName.Name = "buttonRequireDisplayName"; 128 | this.buttonRequireDisplayName.OfficeImageId = "FormControlEditBox"; 129 | this.buttonRequireDisplayName.ShowImage = true; 130 | this.buttonRequireDisplayName.Click += new Microsoft.Office.Tools.Ribbon.RibbonControlEventHandler(this.buttonRequireDisplayName_Click); 131 | // 132 | // buttonStartWithVideoMuted 133 | // 134 | this.buttonStartWithVideoMuted.Label = "No Video on Start"; 135 | this.buttonStartWithVideoMuted.Name = "buttonStartWithVideoMuted"; 136 | this.buttonStartWithVideoMuted.OfficeImageId = "Camera"; 137 | this.buttonStartWithVideoMuted.ShowImage = true; 138 | this.buttonStartWithVideoMuted.Click += new Microsoft.Office.Tools.Ribbon.RibbonControlEventHandler(this.buttonStartWithVideoMuted_Click); 139 | // 140 | // groupNewMeeting 141 | // 142 | this.groupNewMeeting.Items.Add(this.buttonNewJitsiMeeting); 143 | this.groupNewMeeting.Label = "Jitsi Meet"; 144 | this.groupNewMeeting.Name = "groupNewMeeting"; 145 | this.groupNewMeeting.Position = this.Factory.RibbonPosition.BeforeOfficeId("GroupAttendees"); 146 | this.groupNewMeeting.Visible = false; 147 | // 148 | // buttonNewJitsiMeeting 149 | // 150 | this.buttonNewJitsiMeeting.ControlSize = Microsoft.Office.Core.RibbonControlSize.RibbonControlSizeLarge; 151 | this.buttonNewJitsiMeeting.Image = global::JitsiMeetOutlook.Properties.Resources.jitsiLogo_square; 152 | this.buttonNewJitsiMeeting.Label = "New Jitsi Meeting"; 153 | this.buttonNewJitsiMeeting.Name = "buttonNewJitsiMeeting"; 154 | this.buttonNewJitsiMeeting.ShowImage = true; 155 | this.buttonNewJitsiMeeting.Click += new Microsoft.Office.Tools.Ribbon.RibbonControlEventHandler(this.buttonNewJitsiMeeting_Click); 156 | // 157 | // AppointmentRibbonGroup 158 | // 159 | this.Name = "AppointmentRibbonGroup"; 160 | this.RibbonType = "Microsoft.Outlook.Appointment"; 161 | this.Tabs.Add(this.Appointment); 162 | this.Load += new Microsoft.Office.Tools.Ribbon.RibbonUIEventHandler(this.AppointmentRibbonGroup_Load); 163 | this.Appointment.ResumeLayout(false); 164 | this.Appointment.PerformLayout(); 165 | this.groupJitsiMeetControls.ResumeLayout(false); 166 | this.groupJitsiMeetControls.PerformLayout(); 167 | this.box1.ResumeLayout(false); 168 | this.box1.PerformLayout(); 169 | this.box2.ResumeLayout(false); 170 | this.box2.PerformLayout(); 171 | this.box3.ResumeLayout(false); 172 | this.box3.PerformLayout(); 173 | this.groupNewMeeting.ResumeLayout(false); 174 | this.groupNewMeeting.PerformLayout(); 175 | this.ResumeLayout(false); 176 | 177 | } 178 | #endregion 179 | 180 | internal Microsoft.Office.Tools.Ribbon.RibbonTab Appointment; 181 | internal Microsoft.Office.Tools.Ribbon.RibbonGroup groupJitsiMeetControls; 182 | internal Microsoft.Office.Tools.Ribbon.RibbonEditBox fieldRoomID; 183 | internal Microsoft.Office.Tools.Ribbon.RibbonToggleButton buttonStartWithAudioMuted; 184 | internal Microsoft.Office.Tools.Ribbon.RibbonToggleButton buttonStartWithVideoMuted; 185 | internal Microsoft.Office.Tools.Ribbon.RibbonButton buttonRandomRoomID; 186 | internal Microsoft.Office.Tools.Ribbon.RibbonToggleButton buttonRequireDisplayName; 187 | internal Microsoft.Office.Tools.Ribbon.RibbonBox box1; 188 | internal Microsoft.Office.Tools.Ribbon.RibbonBox box2; 189 | internal Microsoft.Office.Tools.Ribbon.RibbonBox box3; 190 | internal Microsoft.Office.Tools.Ribbon.RibbonGroup groupNewMeeting; 191 | internal Microsoft.Office.Tools.Ribbon.RibbonButton buttonNewJitsiMeeting; 192 | } 193 | 194 | partial class ThisRibbonCollection 195 | { 196 | internal AppointmentRibbonGroup AppointmentRibbonGroup 197 | { 198 | get { return this.GetRibbon(); } 199 | } 200 | } 201 | } 202 | -------------------------------------------------------------------------------- /JitsiMeetOutlookTests/TextUtilsTests.cs: -------------------------------------------------------------------------------- 1 | using Microsoft.VisualStudio.TestTools.UnitTesting; 2 | using JitsiMeetOutlook; 3 | using System; 4 | using System.Collections.Generic; 5 | using System.Linq; 6 | using System.Text; 7 | using System.Threading.Tasks; 8 | using FluentAssertions; 9 | 10 | namespace JitsiMeetOutlook.Tests 11 | { 12 | [TestClass()] 13 | public class TextUtilsTests 14 | { 15 | [TestMethod()] 16 | public void findRoomIdTest() 17 | { 18 | var body = "\r\n\r\nJitsi - Meeting \r\n\r\nJoin the meeting: https://meet.jit.si/UpstairsAllowancesSpillQuite \r\n\r\nDial in number: \r\n US: +1.512.647.1431 \r\n UK: +44.203.885.2179 \r\n France: +33.1.87.21.0005 \r\n Netherlands: +31.85.208.1541 \r\n Spain: +34.932.205.409 \r\n Canada: +1.437.538.3987 \r\n Australia: +61.8.7150.1136 \r\n Brazil: +55.21.3500.0112 \r\n Japan: +81.3.4510.2372 \r\n Switzerland: +41.61.588.0496 \r\nConference number: 1080637763 \r\n\r\n_________________________________________________ \r\n\r\nDISCLAIMER \r\n\r\nhttps://example.de/disclaimer.pdf \r\n"; 19 | var roomId = Utils.findRoomId(body, "meet.jit.si"); 20 | Assert.AreEqual("UpstairsAllowancesSpillQuite", roomId); 21 | } 22 | 23 | 24 | [TestMethod()] 25 | public void switchSettingInTextTest() 26 | { 27 | var body = "\r\n\r\nJitsi - Meeting \r\n\r\nJoin the meeting: https://meet.jit.si/UpstairsAllowancesSpillQuite \r\n\r\nDial in number: \r\n US: +1.512.647.1431 \r\n UK: +44.203.885.2179 \r\n France: +33.1.87.21.0005 \r\n Netherlands: +31.85.208.1541 \r\n Spain: +34.932.205.409 \r\n Canada: +1.437.538.3987 \r\n Australia: +61.8.7150.1136 \r\n Brazil: +55.21.3500.0112 \r\n Japan: +81.3.4510.2372 \r\n Switzerland: +41.61.588.0496 \r\nConference number: 1080637763 \r\n\r\n_________________________________________________ \r\n\r\nDISCLAIMER \r\n\r\nhttps://example.de/disclaimer.pdf \r\n"; 28 | var roomId = Utils.findRoomId(body, "meet.jit.si"); 29 | Assert.AreEqual("UpstairsAllowancesSpillQuite", roomId); 30 | } 31 | 32 | [TestMethod()] 33 | public void findRoomIdTestMissing() 34 | { 35 | var body = ""; 36 | var roomId = Utils.findRoomId(body, "meet.jit.si"); 37 | Assert.AreEqual(string.Empty, roomId); 38 | } 39 | 40 | [TestMethod()] 41 | public void GetUrlTest() 42 | { 43 | var body = "{\\rtf1\\ansi\\ansicpg1252\\fromhtml1 \\fbidis \\deff0{\\fonttbl\r\n{\\f0\\fswiss\\fcharset0 Arial;}\r\n{\\f1\\fmodern Courier New;}\r\n{\\f2\\fnil\\fcharset2 Symbol;}\r\n{\\f3\\fmodern\\fcharset0 Courier New;}}\r\n{\\colortbl\\red0\\green0\\blue0;\\red0\\green0\\blue255;}\r\n\\uc1\\pard\\plain\\deftab360 \\f0\\fs24 \r\n{\\*\\htmltag19 }\r\n{\\*\\htmltag34 }\r\n{\\*\\htmltag161 }\r\n{\\*\\htmltag241 }\r\n{\\*\\htmltag241 }\r\n{\\*\\htmltag241 }\r\n{\\*\\htmltag41 }\r\n{\\*\\htmltag50 }\r\n{\\*\\htmltag96
}\\htmlrtf {\\htmlrtf0 \r\n{\\*\\htmltag64

}\\htmlrtf {\\htmlrtf0 \r\n{\\*\\htmltag148 }\\htmlrtf {\\htmlrtf0 Test \r\n{\\*\\htmltag244 }\r\n{\\*\\htmltag252 }\r\n{\\*\\htmltag156 }\\htmlrtf }\\htmlrtf0 \\htmlrtf\\par}\\htmlrtf0\r\n\\htmlrtf \\par\r\n\\htmlrtf0 \r\n{\\*\\htmltag72

}\r\n{\\*\\htmltag64

}\\htmlrtf {\\htmlrtf0 \r\n{\\*\\htmltag148 }\\htmlrtf {\\htmlrtf0 dfsdfsdf\r\n{\\*\\htmltag244 }\r\n{\\*\\htmltag252 }\r\n{\\*\\htmltag156 }\\htmlrtf }\\htmlrtf0 \\htmlrtf\\par}\\htmlrtf0\r\n\\htmlrtf \\par\r\n\\htmlrtf0 \r\n{\\*\\htmltag72

}\r\n{\\*\\htmltag64

}\\htmlrtf {\\htmlrtf0 \r\n{\\*\\htmltag148 }\\htmlrtf {\\htmlrtf0 sfsdfsdf\r\n{\\*\\htmltag116
}\\htmlrtf \\line\r\n\\htmlrtf0 \r\n{\\*\\htmltag84  }\\htmlrtf \\'a0\\htmlrtf0 \r\n{\\*\\htmltag116
}\\htmlrtf \\line\r\n\\htmlrtf0 \r\n{\\*\\htmltag84  }\\htmlrtf \\'a0\\htmlrtf0 \r\n{\\*\\htmltag116
}\\htmlrtf \\line\r\n\\htmlrtf0 Jitsi-Meeting \r\n{\\*\\htmltag116
}\\htmlrtf \\line\r\n\\htmlrtf0 Join the meeting: \r\n{\\*\\htmltag156
}\\htmlrtf }\\htmlrtf0 \r\n{\\*\\htmltag84 }\\htmlrtf {\\field{\\*\\fldinst{HYPERLINK \"https://meet.jit.si/UnderlyingDescentsPledgeOverseas\"}}{\\fldrslt\\cf1\\ul \\htmlrtf0 \r\n{\\*\\htmltag148 }\\htmlrtf {\\htmlrtf0 https://meet.jit.si/UnderlyingDescentsPledgeOverseas\r\n{\\*\\htmltag156 }\\htmlrtf }\\htmlrtf0 \\htmlrtf }\\htmlrtf0 \\htmlrtf }\\htmlrtf0 \r\n{\\*\\htmltag92 }\r\n{\\*\\htmltag148 }\\htmlrtf {\\htmlrtf0 \r\n{\\*\\htmltag244 }\r\n{\\*\\htmltag252 }\r\n{\\*\\htmltag156 }\\htmlrtf }\\htmlrtf0 \\htmlrtf\\par}\\htmlrtf0\r\n\\htmlrtf \\par\r\n\\htmlrtf0 \r\n{\\*\\htmltag72

}\r\n{\\*\\htmltag64

}\\htmlrtf {\\htmlrtf0 \r\n{\\*\\htmltag148 }\\htmlrtf {\\htmlrtf0 Dial in number:\r\n{\\*\\htmltag84  }\\htmlrtf \\'a0\\htmlrtf0 \r\n{\\*\\htmltag84  }\\htmlrtf \\'a0\\htmlrtf0 US: +1.512.647.1431 \r\n{\\*\\htmltag116
}\\htmlrtf \\line\r\n\\htmlrtf0 \r\n{\\*\\htmltag84  }\\htmlrtf \\'a0\\htmlrtf0 UK: +44.203.885.2179 \r\n{\\*\\htmltag116
}\\htmlrtf \\line\r\n\\htmlrtf0 \r\n{\\*\\htmltag84  }\\htmlrtf \\'a0\\htmlrtf0 France: +33.1.87.21.0005 \r\n{\\*\\htmltag116
}\\htmlrtf \\line\r\n\\htmlrtf0 \r\n{\\*\\htmltag84  }\\htmlrtf \\'a0\\htmlrtf0 Netherlands: +31.85.208.1541 \r\n{\\*\\htmltag116
}\\htmlrtf \\line\r\n\\htmlrtf0 \r\n{\\*\\htmltag84  }\\htmlrtf \\'a0\\htmlrtf0 Spain: +34.932.205.409 \r\n{\\*\\htmltag116
}\\htmlrtf \\line\r\n\\htmlrtf0 \r\n{\\*\\htmltag84  }\\htmlrtf \\'a0\\htmlrtf0 Canada: +1.437.538.3987 \r\n{\\*\\htmltag116
}\\htmlrtf \\line\r\n\\htmlrtf0 \r\n{\\*\\htmltag84  }\\htmlrtf \\'a0\\htmlrtf0 Australia: +61.8.7150.1136 \r\n{\\*\\htmltag116
}\\htmlrtf \\line\r\n\\htmlrtf0 \r\n{\\*\\htmltag84  }\\htmlrtf \\'a0\\htmlrtf0 Brazil: +55.21.3500.0112 \r\n{\\*\\htmltag116
}\\htmlrtf \\line\r\n\\htmlrtf0 \r\n{\\*\\htmltag84  }\\htmlrtf \\'a0\\htmlrtf0 Japan: +81.3.4510.2372 \r\n{\\*\\htmltag116
}\\htmlrtf \\line\r\n\\htmlrtf0 \r\n{\\*\\htmltag84  }\\htmlrtf \\'a0\\htmlrtf0 Switzerland: +41.61.588.0496 \r\n{\\*\\htmltag116
}\\htmlrtf \\line\r\n\\htmlrtf0 Conference number: 1024100710 \r\n{\\*\\htmltag116
}\\htmlrtf \\line\r\n\\htmlrtf0 \r\n{\\*\\htmltag84  }\\htmlrtf \\'a0\\htmlrtf0 \r\n{\\*\\htmltag244 }\r\n{\\*\\htmltag252 }\r\n{\\*\\htmltag156
}\\htmlrtf }\\htmlrtf0 \\htmlrtf\\par}\\htmlrtf0\r\n\\htmlrtf \\par\r\n\\htmlrtf0 \r\n{\\*\\htmltag72

}\r\n{\\*\\htmltag104
}\\htmlrtf }\\htmlrtf0 \r\n{\\*\\htmltag58 }\r\n{\\*\\htmltag27 }}"; 44 | var url = Utils.GetUrl(body, "meet.jit.si"); 45 | Assert.AreEqual("https://meet.jit.si/UnderlyingDescentsPledgeOverseas", url); 46 | } 47 | 48 | [TestMethod()] 49 | public void GetUrlTest2() 50 | { 51 | var body = "https://meet.jit.si/UnderlyingDescentsPledgeOverseas"; 52 | var url = Utils.GetUrl(body, "meet.jit.si"); 53 | Assert.AreEqual("https://meet.jit.si/UnderlyingDescentsPledgeOverseas", url); 54 | 55 | body = "http://meet.jit.si/UnderlyingDescentsPledgeOverseas"; 56 | url = Utils.GetUrl(body, "meet.jit.si"); 57 | Assert.AreEqual("http://meet.jit.si/UnderlyingDescentsPledgeOverseas", url); 58 | } 59 | 60 | [TestMethod()] 61 | public void SplitToTextAndHyperlinks() 62 | { 63 | var text = "test https://meet.jit.si/UnderlyingDescentsPledgeOverseas with links https://cool.link everywhere https://example.com interesting end"; 64 | List> split = Utils.SplitToTextAndHyperlinks(text); 65 | split.Should().NotBeEmpty().And.HaveCount(7); 66 | 67 | split.Should().Equal(new List>() 68 | { 69 | new KeyValuePair( false, "test " ), 70 | new KeyValuePair( true, "https://meet.jit.si/UnderlyingDescentsPledgeOverseas" ), 71 | new KeyValuePair( false, " with links " ), 72 | new KeyValuePair( true, "https://cool.link" ), 73 | new KeyValuePair( false, " everywhere " ), 74 | new KeyValuePair( true, "https://example.com" ), 75 | new KeyValuePair( false, " interesting end" ) 76 | 77 | }); 78 | 79 | } 80 | 81 | [TestMethod()] 82 | public void SplitToTextAndHyperlinksEmpty() 83 | { 84 | var text = "test with no links everywhere interesting end"; 85 | List> split = Utils.SplitToTextAndHyperlinks(text); 86 | split.Should().Equal(new List>() 87 | { 88 | new KeyValuePair( false, "test with no links everywhere interesting end") 89 | 90 | }); 91 | } 92 | 93 | [TestMethod()] 94 | public void SplitToTextAndHyperlinksSpecialCharacter() 95 | { 96 | var text = "test with no links everywhere interesting end https://cool.link."; 97 | List> split = Utils.SplitToTextAndHyperlinks(text); 98 | split.Should().Equal(new List>() 99 | { 100 | new KeyValuePair( false, "test with no links everywhere interesting end "), 101 | new KeyValuePair( true, "https://cool.link"), 102 | new KeyValuePair( false, "."), 103 | }); 104 | } 105 | } 106 | } -------------------------------------------------------------------------------- /JitsiMeetOutlook/AppointmentRibbonGroup.controls.cs: -------------------------------------------------------------------------------- 1 | using System.Linq; 2 | using Outlook = Microsoft.Office.Interop.Outlook; 3 | using Word = Microsoft.Office.Interop.Word; 4 | using System.Text.RegularExpressions; 5 | using System.Threading.Tasks; 6 | using System.Text; 7 | using JitsiMeetOutlook.Entities; 8 | using Microsoft.Office.Interop.Word; 9 | using System.Collections.Generic; 10 | 11 | namespace JitsiMeetOutlook 12 | { 13 | public partial class AppointmentRibbonGroup 14 | { 15 | private Outlook.AppointmentItem appointmentItem; 16 | private string oldDomain; 17 | 18 | private void initialise() 19 | { 20 | // Set language 21 | setLanguage(); 22 | 23 | // Assign the domain prevailing at appointment item launch 24 | Properties.Settings.Default.Reload(); 25 | oldDomain = Properties.Settings.Default.Domain; 26 | 27 | // Assign the relevant appointment item 28 | Outlook.Inspector inspector = (Outlook.Inspector)this.Context; 29 | appointmentItem = inspector.CurrentItem as Outlook.AppointmentItem; 30 | 31 | if (appointmentItem.Location == "Jitsi Meet") 32 | { 33 | groupJitsiMeetControls.Visible = true; 34 | groupNewMeeting.Visible = false; 35 | Utils.RunInThread(() => 36 | { 37 | InitializeRibbonWithCurrentData(); 38 | }); 39 | } 40 | else 41 | { 42 | groupNewMeeting.Visible = true; 43 | groupJitsiMeetControls.Visible = false; 44 | } 45 | 46 | 47 | } 48 | 49 | 50 | private async void InitializeRibbonWithCurrentData() 51 | { 52 | var roomId = Utils.findRoomId(appointmentItem.Body, oldDomain); 53 | if (roomId != string.Empty) 54 | { 55 | // The Meeting already exists 56 | if (roomId != null) 57 | { 58 | fieldRoomID.Text = roomId; 59 | } 60 | 61 | var url = Utils.GetUrl(appointmentItem.Body, oldDomain); 62 | if (Utils.SettingIsActive(url, "requireDisplayName")) 63 | { 64 | buttonRequireDisplayName.Checked = true; 65 | } 66 | if (Utils.SettingIsActive(url, "startWithAudioMuted")) 67 | { 68 | buttonStartWithAudioMuted.Checked = true; 69 | } 70 | if (Utils.SettingIsActive(url, "startWithVideoMuted")) 71 | { 72 | buttonStartWithVideoMuted.Checked = true; 73 | } 74 | 75 | } 76 | else 77 | { 78 | // New Meeting 79 | await appendNewMeetingText(); 80 | if (Properties.Settings.Default.requireDisplayName) 81 | { 82 | toggleRequireName(); 83 | buttonRequireDisplayName.Checked = true; 84 | } 85 | if (Properties.Settings.Default.startWithAudioMuted) 86 | { 87 | toggleMuteOnStart(); 88 | buttonStartWithAudioMuted.Checked = true; 89 | } 90 | if (Properties.Settings.Default.startWithVideoMuted) 91 | { 92 | toggleVideoOnStart(); 93 | buttonStartWithVideoMuted.Checked = true; 94 | } 95 | } 96 | 97 | } 98 | 99 | public async System.Threading.Tasks.Task appendNewMeetingText() 100 | { 101 | string roomId; 102 | if (Properties.Settings.Default.roomID.Length == 0) 103 | { 104 | roomId = JitsiUrl.generateRandomId(); 105 | } 106 | else 107 | { 108 | roomId = Properties.Settings.Default.roomID; 109 | } 110 | fieldRoomID.Text = roomId; 111 | 112 | 113 | Word.Document wordDocument = appointmentItem.GetInspector.WordEditor as Word.Document; 114 | wordDocument.Select(); 115 | var endSel = wordDocument.Application.Selection; 116 | endSel.Collapse(Word.WdCollapseDirection.wdCollapseEnd); 117 | 118 | var phoneNumbers = await Globals.ThisAddIn.JitsiApiService.getPhoneNumbers(roomId); 119 | var pinNumber = await Globals.ThisAddIn.JitsiApiService.getPIN(roomId); 120 | object missing = System.Reflection.Missing.Value; 121 | 122 | var link = JitsiUrl.getUrlBase() + roomId; 123 | 124 | 125 | 126 | 127 | endSel.InsertAfter("\n"); 128 | endSel.MoveDown(Word.WdUnits.wdLine); 129 | endSel.InsertAfter("\n"); 130 | endSel.MoveDown(Word.WdUnits.wdLine); 131 | endSel.InsertAfter("\n"); 132 | endSel.MoveDown(Word.WdUnits.wdLine); 133 | endSel.InsertAfter(Globals.ThisAddIn.getElementTranslation("appointmentItem", "textBodyMessage")); 134 | endSel.EndKey(Word.WdUnits.wdLine); 135 | wordDocument.Hyperlinks.Add(endSel.Range, link, ref missing, ref missing, link, ref missing); 136 | endSel.EndKey(Word.WdUnits.wdLine); 137 | endSel.InsertAfter("\n"); 138 | endSel.MoveDown(Word.WdUnits.wdLine); 139 | 140 | if (phoneNumbers.NumbersEnabled) 141 | { 142 | // Add Phone Number Text if they are enabled 143 | endSel.InsertAfter(Globals.ThisAddIn.getElementTranslation("appointmentItem", "textBodyMessagePhone")); 144 | endSel.EndKey(Word.WdUnits.wdLine); 145 | endSel.InsertAfter("\n"); 146 | endSel.MoveDown(Word.WdUnits.wdLine); 147 | foreach (var entry in phoneNumbers.Numbers) 148 | { 149 | endSel.InsertAfter(entry.Key + ": "); 150 | endSel.EndKey(Word.WdUnits.wdLine); 151 | for (int i = 0; i < entry.Value.Count; i++) 152 | { 153 | wordDocument.Hyperlinks.Add(endSel.Range, "tel:" + entry.Value[i], ref missing, ref missing, entry.Value[i], ref missing); 154 | endSel.EndKey(Word.WdUnits.wdLine); 155 | if (i < entry.Value.Count - 1) 156 | { 157 | endSel.InsertAfter(","); 158 | } 159 | } 160 | endSel.InsertAfter("\n"); 161 | endSel.MoveDown(Word.WdUnits.wdLine); 162 | } 163 | endSel.InsertAfter(Globals.ThisAddIn.getElementTranslation("appointmentItem", "textBodyPin") + pinNumber); 164 | endSel.EndKey(Word.WdUnits.wdLine); 165 | } 166 | endSel.InsertAfter("\n"); 167 | endSel.MoveDown(Word.WdUnits.wdLine); 168 | endSel.InsertAfter("\n"); 169 | endSel.MoveDown(Word.WdUnits.wdLine); 170 | 171 | IEnumerable> disclaimer = Utils.SplitToTextAndHyperlinks(Globals.ThisAddIn.getElementTranslation("appointmentItem", "textBodyDisclaimer")); 172 | foreach (var textblock in disclaimer) 173 | { 174 | if (textblock.Key) 175 | { 176 | // Textblock is a link 177 | wordDocument.Hyperlinks.Add(endSel.Range, textblock.Value, ref missing, ref missing, textblock.Value, ref missing); 178 | endSel.EndKey(Word.WdUnits.wdLine); 179 | } 180 | else 181 | { 182 | // Textblock is no link 183 | endSel.InsertAfter(textblock.Value); 184 | endSel.EndKey(Word.WdUnits.wdLine); 185 | } 186 | } 187 | endSel.EndKey(Word.WdUnits.wdLine); 188 | endSel.InsertAfter("\n"); 189 | endSel.MoveDown(Word.WdUnits.wdLine); 190 | 191 | wordDocument.Select(); 192 | endSel.Collapse(Word.WdCollapseDirection.wdCollapseStart); 193 | } 194 | 195 | public async void setRoomId(string newRoomId) 196 | { 197 | // Filter room id for illegal characters 198 | string newRoomIdLegal = JitsiUrl.filterLegalCharacters(newRoomId); 199 | fieldRoomID.Text = newRoomIdLegal; 200 | 201 | 202 | string newDomain = JitsiUrl.getDomain(); 203 | Word.Document wordDocument = appointmentItem.GetInspector.WordEditor as Word.Document; 204 | string oldBody = wordDocument.Range().Text; 205 | 206 | 207 | // Update Domain if it was updated in the meantime 208 | object missing = System.Reflection.Missing.Value; 209 | Find findObject = wordDocument.Content.Find; 210 | findObject.ClearFormatting(); 211 | findObject.Text = oldDomain; 212 | findObject.Replacement.ClearFormatting(); 213 | findObject.Format = true; 214 | findObject.Execute(ref missing, ref missing, ref missing, ref missing, ref missing, 215 | ref missing, ref missing, ref missing, ref missing, newDomain, 216 | WdReplace.wdReplaceAll, ref missing, ref missing, ref missing, ref missing); 217 | oldDomain = newDomain; 218 | 219 | var oldRoomId = Utils.findRoomId(oldBody, newDomain); 220 | 221 | Word.Hyperlinks wLinks = wordDocument.Hyperlinks; 222 | for (int i = 1; i <= wLinks.Count; i++) 223 | { 224 | if (wLinks[i].Address.Contains(oldDomain)) 225 | { 226 | var urlNew = wLinks[i].TextToDisplay.Replace(Utils.findRoomId(appointmentItem.Body, oldDomain), newRoomIdLegal); 227 | wLinks[i].Address = fixUrl(urlNew); 228 | wLinks[i].TextToDisplay = fixUrl(urlNew); 229 | } 230 | } 231 | 232 | 233 | 234 | // Update PIN 235 | var newPIN = await Globals.ThisAddIn.JitsiApiService.getPIN(newRoomIdLegal); 236 | var oldPIN = await Globals.ThisAddIn.JitsiApiService.getPIN(oldRoomId); 237 | 238 | Find findPINObject = wordDocument.Content.Find; 239 | findPINObject.ClearFormatting(); 240 | findPINObject.Text = oldPIN; 241 | findPINObject.Replacement.ClearFormatting(); 242 | findPINObject.Format = true; 243 | 244 | findPINObject.Execute(ref missing, ref missing, ref missing, ref missing, ref missing, 245 | ref missing, ref missing, ref missing, ref missing, newPIN, 246 | WdReplace.wdReplaceAll, ref missing, ref missing, ref missing, ref missing); 247 | 248 | } 249 | 250 | public void randomiseRoomId() 251 | { 252 | setRoomId(JitsiUrl.generateRandomId()); 253 | } 254 | 255 | public void toggleMuteOnStart() 256 | { 257 | toggleSetting("startWithAudioMuted"); 258 | } 259 | public void toggleVideoOnStart() 260 | { 261 | toggleSetting("startWithVideoMuted"); 262 | } 263 | 264 | public void toggleRequireName() 265 | { 266 | toggleSetting("requireDisplayName"); 267 | } 268 | 269 | 270 | private void addJitsiMeeting() 271 | { 272 | appointmentItem.Location = "Jitsi Meet"; 273 | initialise(); 274 | 275 | } 276 | 277 | private void toggleSetting(string setting) 278 | { 279 | // Find Jitsi URL in message 280 | Word.Document wordDocument = appointmentItem.GetInspector.WordEditor as Word.Document; 281 | 282 | Word.Hyperlinks wLinks = wordDocument.Hyperlinks; 283 | for (int i = 1; i <= wLinks.Count; i++) 284 | { 285 | if (wLinks[i].Address.Contains(oldDomain)) 286 | { 287 | var urlMatch = wLinks[i].TextToDisplay; 288 | string urlNew; 289 | if (Utils.SettingIsActive(urlMatch, setting)) 290 | { 291 | urlNew = Regex.Replace(urlMatch, "(#|&)config\\." + setting + "=true", ""); 292 | } 293 | else 294 | { 295 | // Otherwise add 296 | if (urlMatch.Contains("#config")) 297 | { 298 | urlNew = urlMatch + "&config." + setting + "=true"; 299 | } 300 | else 301 | { 302 | urlNew = urlMatch + "#config." + setting + "=true"; 303 | } 304 | } 305 | wLinks[i].Address = fixUrl(urlNew); 306 | wLinks[i].TextToDisplay = fixUrl(urlNew); 307 | } 308 | } 309 | } 310 | 311 | private string fixUrl(string url) 312 | { 313 | string fixedUrl = url; 314 | 315 | // Make sure settings appear correctly 316 | int countHashConfig = url.Count(f => f == '#'); 317 | int countAndConfig = url.Count(f => f == '&'); 318 | 319 | if (countHashConfig == 0 && countAndConfig == 1) 320 | { 321 | fixedUrl = url.Replace("&config", "#config"); 322 | } 323 | 324 | return fixedUrl; 325 | } 326 | } 327 | } 328 | --------------------------------------------------------------------------------