From ed6ca8476249d620542b652dd5dee8b5b2335465 Mon Sep 17 00:00:00 2001 From: Ludovic Marcotte Date: Mon, 28 Sep 2009 01:05:10 +0000 Subject: [PATCH] See ChangeLog Monotone-Parent: b60d547047a2529bf2428a9d602340aa1c4f7f9b Monotone-Revision: 1aaea249ad1360b144fa338a55f11cad2cf930d0 Monotone-Author: ludovic@Sophos.ca Monotone-Date: 2009-09-28T01:05:10 Monotone-Branch: ca.inverse.sogo --- ChangeLog | 4 ++++ UI/Scheduler/UIxCalMainActions.m | 7 ++++++- UI/WebServerResources/SchedulerUI.js | 2 +- 3 files changed, 11 insertions(+), 2 deletions(-) diff --git a/ChangeLog b/ChangeLog index d51c8b80b..bb687ed88 100644 --- a/ChangeLog +++ b/ChangeLog @@ -2,6 +2,10 @@ * Reworked the UIxMailPartSignedViewer to inherit from UIxMailPartMixedViewer. + * UI/WebServerResources/SchedulerUI.js + We allow empty calendar imports. + * Avoid assumptions for .ics presence on URL + subscriptions. 2009-09-25 Ludovic Marcotte diff --git a/UI/Scheduler/UIxCalMainActions.m b/UI/Scheduler/UIxCalMainActions.m index 357787fa9..6cee2a8f6 100644 --- a/UI/Scheduler/UIxCalMainActions.m +++ b/UI/Scheduler/UIxCalMainActions.m @@ -91,7 +91,12 @@ tmp = [calendarURL lastPathComponent]; if (tmp) - rc = [tmp stringByDeletingSuffix: @".ics"]; + { + if ([[tmp pathExtension] caseInsensitiveCompare: @"ics"] == NSOrderedSame) + rc = [tmp substringToIndex: [tmp length] - 4]; + else + rc = tmp; + } else rc = [self labelForKey: @"Web Calendar"]; diff --git a/UI/WebServerResources/SchedulerUI.js b/UI/WebServerResources/SchedulerUI.js index 4d6e6ba74..b3d3a8a57 100644 --- a/UI/WebServerResources/SchedulerUI.js +++ b/UI/WebServerResources/SchedulerUI.js @@ -1922,7 +1922,7 @@ function onCalendarWebAdd(event) { } function addWebCalendarCallback (http) { var data = http.responseText.evalJSON(true); - if (data.imported > 0) { + if (data.imported >= 0) { appendCalendar(data.displayname, "/" + data.name); refreshEvents(); refreshTasks();