aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMilan Crha <mcrha@redhat.com>2010-11-26 19:23:01 +0800
committerMilan Crha <mcrha@redhat.com>2010-11-26 19:23:01 +0800
commitd5453070876d5992b93973250cb01a949e119828 (patch)
tree2111d0deff4f66836eb14ac13ce392aaff5c37d4
parentb0ec19555204c560d192258a99511f50b6da52bc (diff)
downloadgsoc2013-evolution-d5453070876d5992b93973250cb01a949e119828.tar
gsoc2013-evolution-d5453070876d5992b93973250cb01a949e119828.tar.gz
gsoc2013-evolution-d5453070876d5992b93973250cb01a949e119828.tar.bz2
gsoc2013-evolution-d5453070876d5992b93973250cb01a949e119828.tar.lz
gsoc2013-evolution-d5453070876d5992b93973250cb01a949e119828.tar.xz
gsoc2013-evolution-d5453070876d5992b93973250cb01a949e119828.tar.zst
gsoc2013-evolution-d5453070876d5992b93973250cb01a949e119828.zip
Bug #635828 - Do not send meeting mails with no recipient
-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);