Skip to content

Commit

Permalink
Merge pull request #319 from derekantrican/Organizer-Fix
Browse files Browse the repository at this point in the history
Fix organizer handling
  • Loading branch information
jonas0b1011001 authored Mar 1, 2023
2 parents 4f5d0bf + 28ccbcf commit 514c294
Showing 1 changed file with 14 additions and 4 deletions.
18 changes: 14 additions & 4 deletions Helpers.gs
Original file line number Diff line number Diff line change
Expand Up @@ -359,10 +359,20 @@ function createEvent(event, calendarTz){
else if (event.hasProperty('summary'))
newEvent.summary = icalEvent.summary;

if (addOrganizerToTitle && event.hasProperty('organizer')){
var organizer = event.getFirstProperty('organizer').getParameter('cn').toString();
if (organizer != null)
newEvent.summary = organizer + ": " + newEvent.summary;
if (event.hasProperty('organizer')){
var organizerName = event.getFirstProperty('organizer').getParameter('cn');
var organizerMail = event.getFirstProperty('organizer').getParameter('mailto');
newEvent.organizer = callWithBackoff(function() {
return Calendar.newEventOrganizer();
}, defaultMaxRetries);
if (organizerName)
newEvent.organizer.displayName = organizerName.toString();
if (organizerMail)
newEvent.organizer.email = organizerMail.toString();

if (addOrganizerToTitle && organizerName){
newEvent.summary = organizerName + ": " + newEvent.summary;
}
}

if (addCalToTitle && event.hasProperty('parentCal')){
Expand Down

0 comments on commit 514c294

Please sign in to comment.