aboutsummaryrefslogtreecommitdiffstats
path: root/calendar/gui
diff options
context:
space:
mode:
authorMilan Crha <mcrha@redhat.com>2010-11-26 19:23:01 +0800
committerRodrigo Moya <rodrigo@gnome-db.org>2011-06-30 00:41:04 +0800
commitd9f7c420658903dfdb55888a670971e98669dead (patch)
treeef07fa1c2ce817034e3ad78432ebf7ab3ed89d96 /calendar/gui
parent9684c7da1120bc36599a27a018e86be7d55d4823 (diff)
downloadgsoc2013-evolution-d9f7c420658903dfdb55888a670971e98669dead.tar.gz
gsoc2013-evolution-d9f7c420658903dfdb55888a670971e98669dead.tar.zst
gsoc2013-evolution-d9f7c420658903dfdb55888a670971e98669dead.zip
Bug #635828 - Do not send meeting mails with no recipient
Diffstat (limited to 'calendar/gui')
-rw-r--r--calendar/gui/dialogs/send-comp.c33
1 files changed, 32 insertions, 1 deletions
diff --git a/calendar/gui/dialogs/send-comp.c b/calendar/gui/dialogs/send-comp.c
index 4a9f80ef21..a965c3d4da 100644
--- a/calendar/gui/dialogs/send-comp.c
+++ b/calendar/gui/dialogs/send-comp.c
@@ -43,6 +43,37 @@ component_has_new_attendees (ECalComponent *comp)
return g_object_get_data (G_OBJECT (comp), "new-attendees") != NULL;
}
+
+static gboolean
+component_has_recipients (ECalComponent *comp)
+{
+ GSList *attendees = NULL;
+ ECalComponentAttendee *attendee;
+ ECalComponentOrganizer organizer;
+ gboolean res = FALSE;
+
+ g_return_val_if_fail (comp != NULL, FALSE);
+
+ e_cal_component_get_attendee_list (comp, &attendees);
+
+ if (!attendees)
+ return FALSE;
+
+ if (g_slist_length (attendees) > 1 || !e_cal_component_has_organizer (comp)) {
+ e_cal_component_free_attendee_list (attendees);
+ return TRUE;
+ }
+
+ attendee = attendees->data;
+
+ e_cal_component_get_organizer (comp, &organizer);
+ res = organizer.value && attendee && attendee->value && g_ascii_strcasecmp (organizer.value, attendee->value) != 0;
+
+ e_cal_component_free_attendee_list (attendees);
+
+ return res;
+}
+
static gboolean
have_nonprocedural_alarm (ECalComponent *comp)
{
@@ -114,7 +145,7 @@ send_component_dialog (GtkWindow *parent, ECal *client, ECalComponent *comp, gbo
if (strip_alarms)
*strip_alarms = TRUE;
- if (e_cal_get_save_schedules (client))
+ if (e_cal_get_save_schedules (client) || !component_has_recipients (comp))
return FALSE;
vtype = e_cal_component_get_vtype (comp);