Commit ca304474 authored by Mechtilde's avatar Mechtilde

Imported upstream version 3.5.0

parent 410c9278
......@@ -78,7 +78,7 @@ dump(" WHAT is this:"+this._argument.calendar.type+"\n");
let listbox = this._document.getElementById("reminder-listbox");
let reminder = cal.createAlarm();
let alarmlen = Preferences.get("calendar.alarms." + itemType + "alarmlen", 15);
let alarmlen = getPrefSafe("calendar.alarms." + itemType + "alarmlen", 15);
// Default is an absolute DISPLAY alarm, |alarmlen| minutes before the event.
// If DISPLAY is not supported by the provider, then pick the provider's
......@@ -110,7 +110,7 @@ dump(" WHAT is this:"+this._argument.calendar.type+"\n");
}
else {
if ((this._document.getElementById("reminder-listbox").itemCount == 0) || (this._argument.calendar.type != "exchangecalendar")) {
this.onNewReminder();
onNewReminder();
}
}
......
......@@ -71,7 +71,7 @@ exchWebService.invitationResponse = {
document.getElementById("exchWebService_itemResponse").value = window.arguments[0].response;
if (item.organizer) {
document.getElementById("exchWebService_meetingOrganiser").value = item.organizer.commonName+" ("+item.organizer.id.replace(/^mailto:/, '')+")";
document.getElementById("exchWebService_meetingOrganiser").value = item.organizer.commonName+" ("+item.organizer.id.replace(/^mailto:/i, '')+")";
}
else {
// Should never happen.
......
......@@ -70,7 +70,7 @@ exchWebService.preInvitationResponse = {
document.getElementById("exchWebService_itemResponse").value = window.arguments[0].response;
if (item.organizer) {
document.getElementById("exchWebService_meetingOrganiser").value = item.organizer.commonName+" ("+item.organizer.id.replace(/^mailto:/, '')+")";
document.getElementById("exchWebService_meetingOrganiser").value = item.organizer.commonName+" ("+item.organizer.id.replace(/^mailto:/i, '')+")";
}
else {
// Should never happen.
......
......@@ -1095,9 +1095,12 @@ function getAllAccounts(){
"prefs" : calAccount ,
};
}
if( details.enabled == true){
_accounts.push(details);
}
if ( details != null ){
if( details.enabled == true){
_accounts.push(details);
}
}
}
}
var _newaccounts = removeDuplicateAccount(_accounts);
......@@ -1133,9 +1136,11 @@ function getAllAccounts(){
"prefs" : calAccount ,
};
}
if( details.enabled == true ){
_accounts.push(details);
}
if (details != null ){
if( details.enabled == true ){
_accounts.push(details);
}
}
}
}
......
......@@ -1217,7 +1217,7 @@ ecnsIAuthPrompt2.prototype = {
return Cr.NS_NOINTERFACE; // We do not support this.
}
this.globalFunctions.LOG(" >>>>>>>>>>> MAIL THIS LINE TO exchangecalendar@extensions.1st-setup.nl: ecnsIAuthPrompt2.getInterface("+iid+")");
this.globalFunctions.LOG(" >>>>>>>>>>> SUBMIT THIS LINE TO https://github.com/Ericsson/exchangecalendar/issues: ecnsIAuthPrompt2.getInterface("+iid+")");
throw Cr.NS_NOINTERFACE;
},
......
......@@ -134,7 +134,7 @@ erBrowseFolderRequest.prototype = {
}
else {
// We do not know how to handle this yet. Do not know if it ever happens. We did not restrict MaxEntriesReturned.
exchWebService.commonFunctions.LOG("PLEASE MAIL THIS LINE TO exchangecalendar@extensions.1st-setup.nl: IncludesLastItemInRange == false in FindFolderResponse.");
exchWebService.commonFunctions.LOG("SUBMIT THIS LINE TO https://github.com/Ericsson/exchangecalendar/issues: IncludesLastItemInRange == false in FindFolderResponse.");
}
}
else {
......
......@@ -5,7 +5,7 @@
<Description about="urn:mozilla:install-manifest">
<em:id>exchangecalendar@extensions.1st-setup.nl</em:id>
<em:version>3.4.0</em:version>
<em:version>3.5.0</em:version>
<em:targetApplication>
<Description>
......
......@@ -64,7 +64,7 @@ mivExchangeAuthPromptProvider.prototype = {
}
this.logInfo(" --- mivExchangeAuthPromptProvider.getAuthPrompt:aPromptReason:"+aPromptReason+", iid:"+iid);
this.globalFunctions.LOG(" >>>>>>>>>>> MAIL THIS LINE TO exchangecalendar@extensions.1st-setup.nl: ecnsIAuthPrompt2.getAuthPrompt("+iid+")");
this.globalFunctions.LOG(" >>>>>>>>>>> SUBMIT THIS LINE TO https://github.com/Ericsson/exchangecalendar/issues: ecnsIAuthPrompt2.getAuthPrompt("+iid+")");
return Cr.NS_ERROR_NOT_AVAILABLE;
},
......
......@@ -967,7 +967,7 @@ calExchangeCalendar.prototype = {
var attendees = newItem.getAttendees({});
newItem.removeAllAttendees(); // Need to have this. When we add attendees when we create a new calendaritem we become organizer.
for each (var attendee in attendees) {
if ((attendee.id.replace(/^mailto:/, '').toLowerCase() == this.mailbox.toLowerCase()) ||
if ((attendee.id.replace(/^mailto:/i, '').toLowerCase() == this.mailbox.toLowerCase()) ||
(attendee.id.replace(/^exchangecalendar:/, '').toLowerCase() == this.mailbox.toLowerCase()) ) {
if (this.debug) this.logInfo("addItem: FOUND myself as an attendee and we are going to remove myself:"+newItem.title);
newItem.removeAttendee(attendee);
......@@ -1628,7 +1628,7 @@ calExchangeCalendar.prototype = {
var weHaveChanges = (changes || (attachmentsUpdates.create.length > 0) || (attachmentsUpdates.delete.length > 0));
// var weHaveChanges = (this.makeUpdateOneItem(aNewItem, aOldItem, null, null, null, aOldItem.isInvitation) || (attachmentsUpdates.create.length > 0) || (attachmentsUpdates.delete.length > 0));
var iAmOrganizer = ((aNewItem.organizer) && (aNewItem.organizer.id.replace(/^mailto:/, '').toLowerCase() == this.mailbox.toLowerCase()));
var iAmOrganizer = ((aNewItem.organizer) && (aNewItem.organizer.id.replace(/^mailto:/i, '').toLowerCase() == this.mailbox.toLowerCase()));
if (iAmOrganizer) {
if (((changes) && ((changesObj) && (!changesObj.onlySnoozeChanged))) || (attachmentsUpdates.create.length > 0) || (attachmentsUpdates.delete.length > 0)) {
......@@ -1900,7 +1900,7 @@ calExchangeCalendar.prototype = {
if (isEvent(aItem)) {
if (this.debug) this.logInfo("deleteItem is calIEvent");
var iAmOrganizer = ((aItem.organizer) && (aItem.organizer.id.replace(/^mailto:/, '').toLowerCase() == this.mailbox.toLowerCase()));
var iAmOrganizer = ((aItem.organizer) && (aItem.organizer.id.replace(/^mailto:/i, '').toLowerCase() == this.mailbox.toLowerCase()));
var isCancelled = aItem.isCancelled;
var isInvitation = this.isInvitation(aItem, true);
......@@ -2950,7 +2950,7 @@ calExchangeCalendar.prototype = {
var attendees = aItem.getAttendees({});
for each (var attendee in attendees) {
if (this.debug) this.logInfo("getInvitedAttendee 2:"+attendee.id);
if ((attendee.id.replace(/^mailto:/, '').toLowerCase() == this.mailbox.toLowerCase()) ||
if ((attendee.id.replace(/^mailto:/i, '').toLowerCase() == this.mailbox.toLowerCase()) ||
(attendee.id.replace(/^exchangecalendar:/, '').toLowerCase() == this.mailbox.toLowerCase()) ) {
if (this.debug) this.logInfo("getInvitedAttendee FOUND myself:"+aItem.title+", attendee.participationStatus:"+attendee.participationStatus+", aItem.myResponseType:"+aItem.myResponseType);
// attendee.participationStatus = participationMap[aItem.myResponseType];
......@@ -3009,7 +3009,7 @@ calExchangeCalendar.prototype = {
mailbox: this.mailbox,
folderBase: this.folderBase,
serverUrl: this.serverUrl,
email: aCalId.replace(/^MAILTO:/, ""),
email: aCalId.replace(/^mailto:/i, ""),
attendeeType: 'Required',
start: cal.toRFC3339(tmpStartDate.getInTimezone(this.globalFunctions.ecUTC())),
end: cal.toRFC3339(tmpEndDate.getInTimezone(this.globalFunctions.ecUTC())),
......@@ -3899,7 +3899,7 @@ calExchangeCalendar.prototype = {
if (inCalendar) {
// Check if we are the organiser of this item.
var iAmOrganizer = ((inCalendar.organizer) && (inCalendar.organizer.id.replace(/^mailto:/, '').toLowerCase() == this.mailbox.toLowerCase()));
var iAmOrganizer = ((inCalendar.organizer) && (inCalendar.organizer.id.replace(/^mailto:/i, '').toLowerCase() == this.mailbox.toLowerCase()));
if (!iAmOrganizer) {
// Remove the response in the inbox. Do not update calendar.
this.removeResponseItem(response);
......@@ -4894,7 +4894,7 @@ if (this.debug) this.logInfo(" ;;;; rrule:"+rrule.icalProperty.icalString);
var mailbox = ae.addChildTag("Mailbox", "nsTypes", null);
mailbox.addChildTag("Name", "nsTypes", attendee.commonName);
var tmpEmailAddress = attendee.id.replace(/^mailto:/, '');
var tmpEmailAddress = attendee.id.replace(/^mailto:/i, '');
if (tmpEmailAddress.indexOf("@") > 0) {
mailbox.addChildTag("EmailAddress", "nsTypes", tmpEmailAddress);
}
......@@ -4937,11 +4937,11 @@ if (this.debug) this.logInfo(" ;;;; rrule:"+rrule.icalProperty.icalString);
// Set if the item is from the user itself or not.
if (aItem.organizer) {
if (aItem.organizer.id.replace(/^mailto:/, '').toLowerCase() == this.mailbox.toLowerCase()) {
if (aItem.organizer.id.replace(/^mailto:/i, '').toLowerCase() == this.mailbox.toLowerCase()) {
if (this.debug) this.logInfo(" ## I am the organizer of this meeting.");
}
else {
if (this.debug) this.logInfo(" ## I am NOT the organizer of this meeting.'"+aItem.organizer.id.replace(/^mailto:/, '')+"' is the organizer.");
if (this.debug) this.logInfo(" ## I am NOT the organizer of this meeting.'"+aItem.organizer.id.replace(/^mailto:/i, '')+"' is the organizer.");
}
}
else {
......@@ -5377,7 +5377,7 @@ if (this.debug) this.logInfo(" ;;;; rrule:"+rrule.icalProperty.icalString);
{
// Check if I'm the organiser. Do not send to myself.
if (aItem.organizer) {
if (aItem.organizer.id.replace(/^mailto:/, '').toLowerCase() == this.mailbox.toLowerCase()) {
if (aItem.organizer.id.replace(/^mailto:/i, '').toLowerCase() == this.mailbox.toLowerCase()) {
return true;
}
}
......@@ -7664,7 +7664,7 @@ dump("\n== removed ==:"+aCalendarEvent.toString()+"\n");
var weHaveChanges = (changes || (attachmentsUpdates.create.length > 0) || (attachmentsUpdates.delete.length > 0));
// var weHaveChanges = (this.makeUpdateOneItem(aNewItem, aOldItem, null, null, null, aOldItem.isInvitation) || (attachmentsUpdates.create.length > 0) || (attachmentsUpdates.delete.length > 0));
var iAmOrganizer = ((aNewItem.organizer) && (aNewItem.organizer.id.replace(/^mailto:/, '').toLowerCase() == this.mailbox.toLowerCase()));
var iAmOrganizer = ((aNewItem.organizer) && (aNewItem.organizer.id.replace(/^mailto:/i, '').toLowerCase() == this.mailbox.toLowerCase()));
//if (iAmOrganizer) {}
if (this.debug) this.logInfo("modifyEventImmediate: it is a event. aOldItem.CalendarItemType=:"+aOldItem.calendarItemType);
......@@ -7781,7 +7781,7 @@ dump("\n== removed ==:"+aCalendarEvent.toString()+"\n");
// Check if I'm the organiser. Do not send to myself.
if (aItem.organizer) {
if (aItem.organizer.id.replace(/^mailto:/, '').toLowerCase() == this.mailbox.toLowerCase()) {
if (aItem.organizer.id.replace(/^mailto:/i, '').toLowerCase() == this.mailbox.toLowerCase()) {
return true;
}
}
......@@ -8458,7 +8458,7 @@ dump("\n== removed ==:"+aCalendarEvent.toString()+"\n");
{user: this.user,
folderBase: "calendar",
serverUrl: this.serverUrl,
email: this.mailbox.replace(/^MAILTO:/, ""),
email: this.mailbox.replace(/^mailto:/i, ""),
attendeeType: 'Required',
start: cal.toRFC3339(tmpStartDate.getInTimezone(this.globalFunctions.ecUTC())),
end: cal.toRFC3339(tmpEndDate.getInTimezone(this.globalFunctions.ecUTC())),
......@@ -8578,7 +8578,7 @@ else {
while (!doStop) {
if ((startYear == endYear) && (startYearDay == endYearDay)) {
if ((startYear >= endYear) && (startYearDay >= endYearDay)) {
doStop= true;
}
......@@ -9437,8 +9437,8 @@ else {
handleResult: function _handleResult(aResultSet) {
if (self.debug) self.logInfo("Found item in offline Cache.");
var row;
while ( row = aResultSet.getNextRow() ) {
var row = aResultSet.getNextRow();
while (row) {
if (row) {
if (row.getResultByName('itemcount') > 0) {
......@@ -9459,6 +9459,7 @@ else {
this.toBeInserted.push(this.list[row.getResultByName('realid')]);
}
}
row = aResultSet.getNextRow();
}
}
});
......
......@@ -528,7 +528,7 @@ catch(err){
var mailbox = ae.addChildTag("Mailbox", "t", null);
mailbox.addChildTag("Name", "t", attendee.commonName);
var tmpEmailAddress = attendee.id.replace(/^mailto:/, '');
var tmpEmailAddress = attendee.id.replace(/^mailto:/i, '');
if (tmpEmailAddress.indexOf("@") > 0) {
mailbox.addChildTag("EmailAddress", "t", tmpEmailAddress);
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment