-
Notifications
You must be signed in to change notification settings - Fork 212
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Squashed commit of the following GMeet development for #1076 :-
commit 4b77326 Author: Paul Woolcock <[email protected]> Date: Sun Nov 19 14:22:22 2023 +0000 Body comparison bug fixes. commit 170139b Author: Paul Woolcock <[email protected]> Date: Sat Nov 18 13:45:46 2023 +0000 GMeet checkbox added to Google tab. Only sync GMeet if option enabled. commit a5791df Author: Paul Woolcock <[email protected]> Date: Fri Nov 17 17:28:44 2023 +0000 Add, update and delete GMeet data from existing Event. New GoogleOgcs/GMeet class with GoogleMeet() method. commit 8e2de1c Author: Paul Woolcock <[email protected]> Date: Fri Nov 17 14:31:50 2023 +0000 Add GMeet URL to new Google items, using PatchEvent() commit a015c47 Author: Paul Woolcock <[email protected]> Date: Thu Nov 16 15:14:36 2023 +0000 Resync just description if GMeet is removed. commit 2df34b9 Author: Paul Woolcock <[email protected]> Date: Sun Nov 12 11:58:12 2023 +0000 String extension method RemoveLineBreaks() Added GMeet logo as a resource. Injection of HTML info block support added. commit 6fc1586 Author: Paul Woolcock <[email protected]> Date: Sun Nov 12 11:54:39 2023 +0000 Update RTF GMeet section. commit 2f81f65 Author: Paul Woolcock <[email protected]> Date: Fri Nov 10 10:16:31 2023 +0000 Hold GMeetUrl in CustomProperty. Update Outlook GMeet URL. Extend AppointmentItem to a) surface BodyFormat by reflection; b) return RTFBodyAsString. commit 290d6db Author: Paul Woolcock <[email protected]> Date: Sun Nov 5 18:29:28 2023 +0000 Create Outlook item adds RTF body. commit 32e0cbd Author: Paul Woolcock <[email protected]> Date: Sun Nov 5 16:28:53 2023 +0000 Updating Outlook item with hard-coded RTF body.
- Loading branch information
Showing
16 changed files
with
724 additions
and
28 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
using System; | ||
|
||
namespace OutlookGoogleCalendarSync { | ||
public static class StringExtensions { | ||
public static String RemoveLineBreaks(this String input) { | ||
return input?.Replace("\r", "").Replace("\n", ""); | ||
} | ||
} | ||
} |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,58 @@ | ||
using Google.Apis.Calendar.v3.Data; | ||
using log4net; | ||
using System; | ||
using System.Collections.Generic; | ||
using System.Linq; | ||
|
||
namespace OutlookGoogleCalendarSync.GoogleOgcs { | ||
static class GMeet { | ||
private static readonly ILog log = LogManager.GetLogger(typeof(GMeet)); | ||
|
||
/// <summary> | ||
/// Add/update/delete Google Meet conference data in Google event | ||
/// </summary> | ||
/// <param name="ev">The Event to update</param> | ||
/// <param name="outlookGMeetUrl">The GMeet URL detected in the Outlook appointment body</param> | ||
public static void GoogleMeet(this Event ev, String outlookGMeetUrl) { | ||
try { | ||
if (String.IsNullOrEmpty(ev.HangoutLink)) { | ||
log.Debug("Adding Google Meet conference data."); | ||
log.Debug("Conference ID: " + outlookGMeetUrl); | ||
ev.ConferenceData = new ConferenceData() { | ||
ConferenceSolution = new ConferenceSolution() { | ||
Key = new ConferenceSolutionKey { Type = "hangoutsMeet" } | ||
}, | ||
EntryPoints = new List<EntryPoint>() { new EntryPoint() { EntryPointType = "video", Uri = outlookGMeetUrl } } | ||
}; | ||
|
||
} else if (String.IsNullOrEmpty(outlookGMeetUrl)) { | ||
log.Debug("Removing Google Meet conference data."); | ||
if (ev.ConferenceData.ConferenceSolution.Key.Type != "hangoutsMeet") { | ||
log.Warn("Unexpected conference solution type '" + ev.ConferenceData.ConferenceSolution.Key.Type + "'. Remove abandoned."); | ||
} else { | ||
EntryPoint ep = ev.ConferenceData.EntryPoints.Where(ep => ep.EntryPointType == "video").FirstOrDefault(); | ||
log.Fine("Removing the 'video' conference entry point."); | ||
ev.ConferenceData.EntryPoints.Remove(ep); | ||
ev.ConferenceData.ConferenceSolution.Name = null; | ||
} | ||
|
||
} else { | ||
log.Debug("Updating Google Meet conference data."); | ||
if (ev.ConferenceData.ConferenceSolution.Key.Type != "hangoutsMeet") { | ||
log.Warn("Unexpected conference solution type '" + ev.ConferenceData.ConferenceSolution.Key.Type + "'. Update abandoned."); | ||
} else { | ||
EntryPoint ep = ev.ConferenceData.EntryPoints.Where(ep => ep.EntryPointType == "video").FirstOrDefault(); | ||
log.Fine("Replacing the 'video' conference entry point."); | ||
ev.ConferenceData.EntryPoints.Remove(ep); | ||
ep.Uri = outlookGMeetUrl; | ||
ev.ConferenceData.EntryPoints.Add(ep); | ||
ev.ConferenceData.ConferenceSolution.Name = null; | ||
} | ||
} | ||
|
||
} catch (System.Exception ex) { | ||
OGCSexception.Analyse("Could not alter Event conference data.", ex); | ||
} | ||
} | ||
} | ||
} |
Oops, something went wrong.