-
Notifications
You must be signed in to change notification settings - Fork 3
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add Microsoft calendar syncing #14
base: master
Are you sure you want to change the base?
Conversation
Tests all pass, need to add new tests Consider refactoring to avoid multiple provider `if` statements
Instead of multiple `if` statements, use Object-Oriented approach
}, | ||
start: event.start, | ||
end: event.end, | ||
attendees: GetAttendeeSelf(event, this.address), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Does GetAttendeeSelf
still work in Microsoft? It was finding a specific attendee object on the attendee array (self) which contained the key:value self: true
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ah, thanks for pointing this out - it doesn't look like the payload from MS provides any "self" indicator, but each attendee is a full object:
{
"type": "required",
"status": {
"response": "accepted",
"time": "0001-01-01T00:00:00Z"
},
"emailAddress": {
"name": "Jeremy Scherer",
"address": "[email protected]"
}
},
so maybe a new class function instead of a "static" function since it'll be implementation dependent
0849692
to
d1b770a
Compare
d1b770a
to
300b70a
Compare
reminderMinutesBeforeStart: 0, | ||
body: { | ||
contentType: 'text', | ||
content: this.obfuscateTo || !INCLUDE_DESC() ? DESC_NOT_COPIED_MSG : event, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
content: this.obfuscateTo || !INCLUDE_DESC() ? DESC_NOT_COPIED_MSG : event, | |
content: this.obfuscateTo || !INCLUDE_DESC() ? DESC_NOT_COPIED_MSG : event.description, |
useDefault: false, | ||
overrides: [], // No reminders | ||
}, | ||
description: this.obfuscateTo || !INCLUDE_DESC() ? DESC_NOT_COPIED_MSG : event, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
description: this.obfuscateTo || !INCLUDE_DESC() ? DESC_NOT_COPIED_MSG : event, | |
description: this.obfuscateTo || !INCLUDE_DESC() ? DESC_NOT_COPIED_MSG : event.description, |
This PR includes two primary features:
Adding Office365 support required changing the format of CALENDARS_TO_MERGE into an object-based structure to allow the clientID/Secret/Tenant details to be stored. Additionally, parsing the details and formatting events for different APIs made adding some classes (one for each calendar type) make sense as well.
The PR could have been made smaller by adding the obfuscation feature separately, but it would have required changing many of the same parts of code twice, so I opted to roll it into the same effort.
I am noticing that the oAuth access dies after some time right now, and I'm not sure why (I have to re-approve the app); I'll be investigating that, but for now I think this code is ready to review.