Index: src/java/ca/inverse/sogo/engine/source/SOGoUtilities.java
===================================================================
--- src/java/ca/inverse/sogo/engine/source/SOGoUtilities.java	(revision 31)
+++ src/java/ca/inverse/sogo/engine/source/SOGoUtilities.java	Thu Apr 22 21:16:25 CEST 2010
@@ -899,6 +899,24 @@
 			// The boolean parameter triggers v1 vs. v2 conversion (v1 == true)
 			calendar = converter.calendar2vcalendar(cal, true);
             copyCustomProperties(v2.getVCalendarContent(), calendar.getVCalendarContent());
+
+            // Funambol loses alarm settings when converting to a Calendar object, see
+            // http://forge.ow2.org/tracker/index.php?func=detail&aid=314860&group_id=96&atid=100096
+            // Try to convert any valarm from v2 to aalarm.
+            // This is implementation will probably fix 95% of the cases, but doesn't cover
+            // multiple alarms or alarm times set relative to the end of the event
+            // Also note that at least Symbian devices does not seem to support relative alarms
+            VAlarm valarm = (VAlarm)v2.getVCalendarContent().getComponent("VALARM");
+            log.info("VALARM is: " + valarm);
+            if (valarm != null)
+            {
+                com.funambol.common.pim.model.Property trigger;
+
+                trigger = valarm.getProperty("TRIGGER");
+                calendar.getVCalendarContent().addProperty("AALARM", trigger.getValue());
+            }
+
+            // Write result
             writer = new VComponentWriter(VComponentWriter.NO_FOLDING);
 			s = writer.toString(calendar);
 			log.info(s);
