Open tjuwin1 opened 3 years ago
"https://www.google.com/url?q="
to the safelink? Can't you just take out the "safelinks..." prefix, then decode the rest of the url? I would suggest something like:function updateSafelinks(linkData){
var matcherUrl = new RegExp('https:\/\/.*?safelinks.protection.outlook.com\\/.*?\\\?url=','g');
linkData = decodeURIComponent(linkData.replace(matcherUrl,""));
return linkData;
}
Otherwise, it seems like an acceptable add to the script. Make this change and start a PR - I'll take a look at it.
E.g:
\nLearn More<https://aka.ms/JoinTeamsMeeting> | Meeting options<https://ap c01.safelinks.protection.outlook.com/?url=https%3A%2F%2Fteams.microsoft.co m%2FmeetingOptions%2F%3ForganizerId%3D86e02103-9c5b-4e5f-9
I used this additional function to replace safelinks server name with google.com
function updateSafelinks(linkData){
var matcherUrl = new RegExp('https:\/\/.*?safelinks.protection.outlook.com\\/.*?\\\?url=','g');
linkData = linkData.replace(matcherUrl,"https://www.google.com/url?q=");
return linkData;
}
This is called from
createEvent
if (descriptionAsTitles && event.hasProperty('description'))
var eventSummary = updateSafelinks(icalEvent.description);
else if (event.hasProperty('summary'))
eventSummary = updateSafelinks(icalEvent.summary);
createEvent
:if (valarms.length > 0){
....
}else{
var overrides = [];
overrides.push({'method' : 'popup', 'minutes' : 5});
newEvent.reminders = {
'useDefault' : false,
'overrides' : overrides
};
}
Please add these enhancements to the original scripts, if found useful.