Blame SOURCES/evolution-3.8.5-custom-msg-in-reminder.patch

c72ca9
diff -up evolution-3.8.5/calendar/alarm-notify/alarm-queue.c.evo evolution-3.8.5/calendar/alarm-notify/alarm-queue.c
c72ca9
--- evolution-3.8.5/calendar/alarm-notify/alarm-queue.c.evo	2013-08-01 14:12:40.000000000 +0200
c72ca9
+++ evolution-3.8.5/calendar/alarm-notify/alarm-queue.c	2013-10-09 08:37:59.488015698 +0200
c72ca9
@@ -1593,37 +1593,51 @@ tray_list_add_new (TrayIconData *data)
c72ca9
 	message_push ((Message *) msg);
c72ca9
 }
c72ca9
 
c72ca9
-static void
c72ca9
+static gchar *
c72ca9
 alarm_queue_get_alarm_summary (ECalClient *cal_client,
c72ca9
 			       ECalComponent *comp,
c72ca9
-                               const ECalComponentAlarmInstance *instance,
c72ca9
-                               ECalComponentText *text,
c72ca9
-                               ECalComponentAlarm **palarm)
c72ca9
+                               const ECalComponentAlarmInstance *instance)
c72ca9
 {
c72ca9
-	g_return_if_fail (comp != NULL);
c72ca9
-	g_return_if_fail (instance != NULL);
c72ca9
-	g_return_if_fail (instance->auid != NULL);
c72ca9
-	g_return_if_fail (text != NULL);
c72ca9
-	g_return_if_fail (palarm != NULL);
c72ca9
+	ECalComponentAlarm *alarm = NULL;
c72ca9
+	ECalComponentText summary_text, alarm_text;
c72ca9
+	gchar *alarm_summary;
c72ca9
+
c72ca9
+	g_return_val_if_fail (comp != NULL, NULL);
c72ca9
+	g_return_val_if_fail (instance != NULL, NULL);
c72ca9
+	g_return_val_if_fail (instance->auid != NULL, NULL);
c72ca9
+
c72ca9
+	summary_text.value = NULL;
c72ca9
+	alarm_text.value = NULL;
c72ca9
 
c72ca9
-	text->value = NULL;
c72ca9
+	e_cal_component_get_summary (comp, &summary_text);
c72ca9
 
c72ca9
 	if (e_client_check_capability (E_CLIENT (cal_client), "alarm-description")) {
c72ca9
-		*palarm = e_cal_component_get_alarm (comp, instance->auid);
c72ca9
-		if (*palarm) {
c72ca9
-			e_cal_component_alarm_get_description (*palarm, text);
c72ca9
-			if (!text->value || !*text->value) {
c72ca9
-				text->value = NULL;
c72ca9
-				e_cal_component_alarm_free (*palarm);
c72ca9
-				*palarm = NULL;
c72ca9
-			}
c72ca9
-		} else {
c72ca9
-			*palarm = NULL;
c72ca9
+		alarm = e_cal_component_get_alarm (comp, instance->auid);
c72ca9
+		if (alarm) {
c72ca9
+			e_cal_component_alarm_get_description (alarm, &alarm_text);
c72ca9
+			if (!alarm_text.value || !*alarm_text.value)
c72ca9
+				alarm_text.value = NULL;
c72ca9
 		}
c72ca9
 	}
c72ca9
 
c72ca9
-	if (!text->value)
c72ca9
-		e_cal_component_get_summary (comp, text);
c72ca9
+	if (alarm_text.value && summary_text.value &&
c72ca9
+	    e_util_utf8_strcasecmp (alarm_text.value, summary_text.value) == 0)
c72ca9
+		alarm_text.value = NULL;
c72ca9
+
c72ca9
+	if (summary_text.value && *summary_text.value &&
c72ca9
+	    alarm_text.value && *alarm_text.value)
c72ca9
+		alarm_summary = g_strconcat (summary_text.value, "\n", alarm_text.value, NULL);
c72ca9
+	else if (summary_text.value && *summary_text.value)
c72ca9
+		alarm_summary = g_strdup (summary_text.value);
c72ca9
+	else if (alarm_text.value && *alarm_text.value)
c72ca9
+		alarm_summary = g_strdup (alarm_text.value);
c72ca9
+	else
c72ca9
+		alarm_summary = NULL;
c72ca9
+
c72ca9
+	if (alarm)
c72ca9
+		e_cal_component_alarm_free (alarm);
c72ca9
+
c72ca9
+	return alarm_summary;
c72ca9
 }
c72ca9
 
c72ca9
 /* Performs notification of a display alarm */
c72ca9
@@ -1635,8 +1649,8 @@ display_notification (time_t trigger,
c72ca9
 {
c72ca9
 	QueuedAlarm *qa;
c72ca9
 	ECalComponent *comp;
c72ca9
-	ECalComponentAlarm *comp_alarm = NULL;
c72ca9
 	const gchar *summary, *description, *location;
c72ca9
+	gchar *alarm_summary;
c72ca9
 	TrayIconData *tray_data;
c72ca9
 	ECalComponentText text;
c72ca9
 	GSList *text_list;
c72ca9
@@ -1652,11 +1666,11 @@ display_notification (time_t trigger,
c72ca9
 		return;
c72ca9
 
c72ca9
 	/* get a sensible description for the event */
c72ca9
-	alarm_queue_get_alarm_summary (cqa->parent_client->cal_client, comp, qa->instance, &text, &comp_alarm);
c72ca9
+	alarm_summary = alarm_queue_get_alarm_summary (cqa->parent_client->cal_client, comp, qa->instance);
c72ca9
 	e_cal_component_get_organizer (comp, &organiser);
c72ca9
 
c72ca9
-	if (text.value)
c72ca9
-		summary = text.value;
c72ca9
+	if (alarm_summary && *alarm_summary)
c72ca9
+		summary = alarm_summary;
c72ca9
 	else
c72ca9
 		summary = _("No summary available.");
c72ca9
 
c72ca9
@@ -1735,8 +1749,7 @@ display_notification (time_t trigger,
c72ca9
 		gtk_status_icon_set_tooltip_text (tray_icon, str);
c72ca9
 	}
c72ca9
 
c72ca9
-	if (comp_alarm)
c72ca9
-		e_cal_component_alarm_free (comp_alarm);
c72ca9
+	g_free (alarm_summary);
c72ca9
 	g_free (start_str);
c72ca9
 	g_free (end_str);
c72ca9
 	g_free (alarm_str);
c72ca9
@@ -1771,9 +1784,8 @@ popup_notification (time_t trigger,
c72ca9
 {
c72ca9
 	QueuedAlarm *qa;
c72ca9
 	ECalComponent *comp;
c72ca9
-	ECalComponentAlarm *comp_alarm = NULL;
c72ca9
 	const gchar *summary, *location;
c72ca9
-	ECalComponentText text;
c72ca9
+	gchar *alarm_summary;
c72ca9
 	gchar *str, *start_str, *end_str, *alarm_str, *time_str;
c72ca9
 	icaltimezone *current_zone;
c72ca9
 	ECalComponentOrganizer organiser;
c72ca9
@@ -1790,11 +1802,11 @@ popup_notification (time_t trigger,
c72ca9
 		notify_init (_("Evolution Reminders"));
c72ca9
 
c72ca9
 	/* get a sensible description for the event */
c72ca9
-	alarm_queue_get_alarm_summary (cqa->parent_client->cal_client, comp, qa->instance, &text, &comp_alarm);
c72ca9
+	alarm_summary = alarm_queue_get_alarm_summary (cqa->parent_client->cal_client, comp, qa->instance);
c72ca9
 	e_cal_component_get_organizer (comp, &organiser);
c72ca9
 
c72ca9
-	if (text.value)
c72ca9
-		summary = text.value;
c72ca9
+	if (alarm_summary && *alarm_summary)
c72ca9
+		summary = alarm_summary;
c72ca9
 	else
c72ca9
 		summary = _("No summary available.");
c72ca9
 
c72ca9
@@ -1845,9 +1857,7 @@ popup_notification (time_t trigger,
c72ca9
 	if (!notify_notification_show (notify, NULL))
c72ca9
 		g_warning ("Could not send notification to daemon\n");
c72ca9
 
c72ca9
-	if (comp_alarm)
c72ca9
-		e_cal_component_alarm_free (comp_alarm);
c72ca9
-	/* create the private structure */
c72ca9
+	g_free (alarm_summary);
c72ca9
 	g_free (start_str);
c72ca9
 	g_free (end_str);
c72ca9
 	g_free (alarm_str);