use get_real_item (get_refresh_options): uncomment out (get_real_item):
2001-12-17 JP Rosevear <jpr@ximian.com> * gui/e-itip-control.c (send_item): use get_real_item (get_refresh_options): uncomment out (get_real_item): obtain the real object which has the uid of the item received (show_current_todo): use get_refresh_options for refresh method and provide the description and summary from the real component since its not in the reply (show_current_event): ditto (send_item): use get_real_item 2001-12-17 JP Rosevear <jpr@ximian.com> * gui/itip-utils.c (comp_limit_attendees): can't remove properties in an iteration loop, so remove them outside the loop (comp_minimal): don't set a recurid if there isn't one, add the x properties to the clone (comp_compliant): unref the clone for DECLINECOUNTER * gui/e-itip-control.c (get_refresh_options): make function available again (show_current_event): use it here (ok_clicked_cb): can't remove properties in an iteration loop, so remove them outside the loop * cal-util/cal-component.c (free_icalcomponent): properly free the attendee list (cal_component_rescan): don't destroy the alarm hash svn path=/trunk/; revision=15136
This commit is contained in:
@ -1,3 +1,33 @@
|
|||||||
|
2001-12-17 JP Rosevear <jpr@ximian.com>
|
||||||
|
|
||||||
|
* gui/e-itip-control.c (send_item): use get_real_item
|
||||||
|
(get_refresh_options): uncomment out
|
||||||
|
(get_real_item): obtain the real object which has the uid of the
|
||||||
|
item received
|
||||||
|
(show_current_todo): use get_refresh_options for refresh method
|
||||||
|
and provide the description and summary from the real component
|
||||||
|
since its not in the reply
|
||||||
|
(show_current_event): ditto
|
||||||
|
(send_item): use get_real_item
|
||||||
|
|
||||||
|
2001-12-17 JP Rosevear <jpr@ximian.com>
|
||||||
|
|
||||||
|
* gui/itip-utils.c (comp_limit_attendees): can't remove properties
|
||||||
|
in an iteration loop, so remove them outside the loop
|
||||||
|
(comp_minimal): don't set a recurid if there isn't one, add the x
|
||||||
|
properties to the clone
|
||||||
|
(comp_compliant): unref the clone for DECLINECOUNTER
|
||||||
|
|
||||||
|
* gui/e-itip-control.c (get_refresh_options): make function
|
||||||
|
available again
|
||||||
|
(show_current_event): use it here
|
||||||
|
(ok_clicked_cb): can't remove properties in an iteration loop, so
|
||||||
|
remove them outside the loop
|
||||||
|
|
||||||
|
* cal-util/cal-component.c (free_icalcomponent): properly free the
|
||||||
|
attendee list
|
||||||
|
(cal_component_rescan): don't destroy the alarm hash
|
||||||
|
|
||||||
2001-12-13 Damon Chaplin <damon@ximian.com>
|
2001-12-13 Damon Chaplin <damon@ximian.com>
|
||||||
|
|
||||||
* zones.h: new file to contain all timezone names for translation.
|
* zones.h: new file to contain all timezone names for translation.
|
||||||
|
@ -275,7 +275,8 @@ static void
|
|||||||
free_icalcomponent (CalComponent *comp, gboolean free)
|
free_icalcomponent (CalComponent *comp, gboolean free)
|
||||||
{
|
{
|
||||||
CalComponentPrivate *priv;
|
CalComponentPrivate *priv;
|
||||||
|
GSList *l;
|
||||||
|
|
||||||
priv = comp->priv;
|
priv = comp->priv;
|
||||||
|
|
||||||
if (!priv->icalcomp)
|
if (!priv->icalcomp)
|
||||||
@ -294,6 +295,11 @@ free_icalcomponent (CalComponent *comp, gboolean free)
|
|||||||
|
|
||||||
priv->status = NULL;
|
priv->status = NULL;
|
||||||
|
|
||||||
|
for (l = priv->attendee_list; l != NULL; l = l->next)
|
||||||
|
g_free (l->data);
|
||||||
|
g_slist_free (priv->attendee_list);
|
||||||
|
priv->attendee_list = NULL;
|
||||||
|
|
||||||
priv->categories = NULL;
|
priv->categories = NULL;
|
||||||
|
|
||||||
priv->classification = NULL;
|
priv->classification = NULL;
|
||||||
@ -1078,9 +1084,8 @@ cal_component_rescan (CalComponent *comp)
|
|||||||
|
|
||||||
/* Clear everything out */
|
/* Clear everything out */
|
||||||
free_icalcomponent (comp, FALSE);
|
free_icalcomponent (comp, FALSE);
|
||||||
g_hash_table_destroy (priv->alarm_uid_hash);
|
|
||||||
priv->alarm_uid_hash = NULL;
|
|
||||||
|
|
||||||
|
/* Rescan */
|
||||||
scan_icalcomponent (comp);
|
scan_icalcomponent (comp);
|
||||||
ensure_mandatory_properties (comp);
|
ensure_mandatory_properties (comp);
|
||||||
}
|
}
|
||||||
|
@ -833,7 +833,6 @@ get_reply_options ()
|
|||||||
U_("OK"));
|
U_("OK"));
|
||||||
}
|
}
|
||||||
|
|
||||||
#if 0
|
|
||||||
static char*
|
static char*
|
||||||
get_refresh_options ()
|
get_refresh_options ()
|
||||||
{
|
{
|
||||||
@ -846,7 +845,6 @@ get_refresh_options ()
|
|||||||
U_("Send Latest Information"),
|
U_("Send Latest Information"),
|
||||||
U_("OK"));
|
U_("OK"));
|
||||||
}
|
}
|
||||||
#endif
|
|
||||||
|
|
||||||
static char*
|
static char*
|
||||||
get_cancel_options ()
|
get_cancel_options ()
|
||||||
@ -861,10 +859,43 @@ get_cancel_options ()
|
|||||||
U_("OK"));
|
U_("OK"));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
static CalComponent *
|
||||||
|
get_real_item (EItipControl *itip)
|
||||||
|
{
|
||||||
|
EItipControlPrivate *priv;
|
||||||
|
CalComponent *comp;
|
||||||
|
CalComponentVType type;
|
||||||
|
CalClientGetStatus status;
|
||||||
|
const char *uid;
|
||||||
|
|
||||||
|
priv = itip->priv;
|
||||||
|
|
||||||
|
type = cal_component_get_vtype (priv->comp);
|
||||||
|
cal_component_get_uid (priv->comp, &uid);
|
||||||
|
|
||||||
|
switch (type) {
|
||||||
|
case CAL_COMPONENT_EVENT:
|
||||||
|
status = cal_client_get_object (priv->event_client, uid, &comp);
|
||||||
|
break;
|
||||||
|
case CAL_COMPONENT_TODO:
|
||||||
|
status = cal_client_get_object (priv->task_client, uid, &comp);
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
status = CAL_CLIENT_GET_NOT_FOUND;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (status != CAL_CLIENT_GET_SUCCESS)
|
||||||
|
return NULL;
|
||||||
|
|
||||||
|
return comp;
|
||||||
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
show_current_event (EItipControl *itip)
|
show_current_event (EItipControl *itip)
|
||||||
{
|
{
|
||||||
EItipControlPrivate *priv;
|
EItipControlPrivate *priv;
|
||||||
|
CalComponent *comp;
|
||||||
const gchar *itip_title, *itip_desc;
|
const gchar *itip_title, *itip_desc;
|
||||||
char *options;
|
char *options;
|
||||||
|
|
||||||
@ -889,7 +920,26 @@ show_current_event (EItipControl *itip)
|
|||||||
case ICAL_METHOD_REFRESH:
|
case ICAL_METHOD_REFRESH:
|
||||||
itip_desc = U_("<b>%s</b> wishes to receive the latest meeting information.");
|
itip_desc = U_("<b>%s</b> wishes to receive the latest meeting information.");
|
||||||
itip_title = U_("Meeting Update Request");
|
itip_title = U_("Meeting Update Request");
|
||||||
options = get_publish_options ();
|
options = get_refresh_options ();
|
||||||
|
|
||||||
|
/* Provide extra info, since its not in the component */
|
||||||
|
comp = get_real_item (itip);
|
||||||
|
if (comp != NULL) {
|
||||||
|
CalComponentText text;
|
||||||
|
GSList *l;
|
||||||
|
|
||||||
|
cal_component_get_summary (comp, &text);
|
||||||
|
cal_component_set_summary (priv->comp, &text);
|
||||||
|
cal_component_get_description_list (comp, &l);
|
||||||
|
cal_component_set_description_list (priv->comp, l);
|
||||||
|
cal_component_free_text_list (l);
|
||||||
|
|
||||||
|
gtk_object_unref (GTK_OBJECT (comp));
|
||||||
|
} else {
|
||||||
|
CalComponentText text = {_("Unknown"), NULL};
|
||||||
|
|
||||||
|
cal_component_set_summary (priv->comp, &text);
|
||||||
|
}
|
||||||
break;
|
break;
|
||||||
case ICAL_METHOD_REPLY:
|
case ICAL_METHOD_REPLY:
|
||||||
itip_desc = U_("<b>%s</b> has replied to a meeting request.");
|
itip_desc = U_("<b>%s</b> has replied to a meeting request.");
|
||||||
@ -915,6 +965,7 @@ static void
|
|||||||
show_current_todo (EItipControl *itip)
|
show_current_todo (EItipControl *itip)
|
||||||
{
|
{
|
||||||
EItipControlPrivate *priv;
|
EItipControlPrivate *priv;
|
||||||
|
CalComponent *comp;
|
||||||
const gchar *itip_title, *itip_desc;
|
const gchar *itip_title, *itip_desc;
|
||||||
char *options;
|
char *options;
|
||||||
|
|
||||||
@ -939,7 +990,27 @@ show_current_todo (EItipControl *itip)
|
|||||||
case ICAL_METHOD_REFRESH:
|
case ICAL_METHOD_REFRESH:
|
||||||
itip_desc = U_("<b>%s</b> wishes to receive the latest task information.");
|
itip_desc = U_("<b>%s</b> wishes to receive the latest task information.");
|
||||||
itip_title = U_("Task Update Request");
|
itip_title = U_("Task Update Request");
|
||||||
options = get_publish_options ();
|
options = get_refresh_options ();
|
||||||
|
|
||||||
|
|
||||||
|
/* Provide extra info, since its not in the component */
|
||||||
|
comp = get_real_item (itip);
|
||||||
|
if (comp != NULL) {
|
||||||
|
CalComponentText text;
|
||||||
|
GSList *l;
|
||||||
|
|
||||||
|
cal_component_get_summary (comp, &text);
|
||||||
|
cal_component_set_summary (priv->comp, &text);
|
||||||
|
cal_component_get_description_list (comp, &l);
|
||||||
|
cal_component_set_description_list (priv->comp, l);
|
||||||
|
cal_component_free_text_list (l);
|
||||||
|
|
||||||
|
gtk_object_unref (GTK_OBJECT (comp));
|
||||||
|
} else {
|
||||||
|
CalComponentText text = {_("Unknown"), NULL};
|
||||||
|
|
||||||
|
cal_component_set_summary (priv->comp, &text);
|
||||||
|
}
|
||||||
break;
|
break;
|
||||||
case ICAL_METHOD_REPLY:
|
case ICAL_METHOD_REPLY:
|
||||||
itip_desc = U_("<b>%s</b> has replied to a task assignment.");
|
itip_desc = U_("<b>%s</b> has replied to a task assignment.");
|
||||||
@ -1335,29 +1406,15 @@ send_item (EItipControl *itip)
|
|||||||
{
|
{
|
||||||
EItipControlPrivate *priv;
|
EItipControlPrivate *priv;
|
||||||
CalComponent *comp;
|
CalComponent *comp;
|
||||||
CalComponentVType type;
|
|
||||||
const char *uid;
|
|
||||||
CalClientGetStatus status;
|
|
||||||
GtkWidget *dialog;
|
GtkWidget *dialog;
|
||||||
|
|
||||||
priv = itip->priv;
|
priv = itip->priv;
|
||||||
|
|
||||||
type = cal_component_get_vtype (priv->comp);
|
comp = get_real_item (itip);
|
||||||
cal_component_get_uid (priv->comp, &uid);
|
|
||||||
|
|
||||||
switch (type) {
|
if (comp != NULL) {
|
||||||
case CAL_COMPONENT_EVENT:
|
itip_send_comp (CAL_COMPONENT_METHOD_REQUEST, comp);
|
||||||
status = cal_client_get_object (priv->event_client, uid, &comp);
|
gtk_object_unref (GTK_OBJECT (comp));
|
||||||
break;
|
|
||||||
case CAL_COMPONENT_TODO:
|
|
||||||
status = cal_client_get_object (priv->task_client, uid, &comp);
|
|
||||||
break;
|
|
||||||
default:
|
|
||||||
status = CAL_CLIENT_GET_NOT_FOUND;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (status == CAL_CLIENT_GET_SUCCESS) {
|
|
||||||
itip_send_comp (CAL_COMPONENT_METHOD_PUBLISH, comp);
|
|
||||||
dialog = gnome_ok_dialog (_("Item sent!\n"));
|
dialog = gnome_ok_dialog (_("Item sent!\n"));
|
||||||
} else {
|
} else {
|
||||||
dialog = gnome_warning_dialog (_("The item could not be sent!\n"));
|
dialog = gnome_warning_dialog (_("The item could not be sent!\n"));
|
||||||
@ -1552,9 +1609,10 @@ ok_clicked_cb (GtkHTML *html, const gchar *method, const gchar *url, const gchar
|
|||||||
if (priv->my_address != NULL) {
|
if (priv->my_address != NULL) {
|
||||||
icalcomponent *ical_comp;
|
icalcomponent *ical_comp;
|
||||||
icalproperty *prop;
|
icalproperty *prop;
|
||||||
const char *attendee, *text;
|
|
||||||
icalvalue *value;
|
icalvalue *value;
|
||||||
|
const char *attendee, *text;
|
||||||
|
GSList *l, *list = NULL;
|
||||||
|
|
||||||
ical_comp = cal_component_get_icalcomponent (comp);
|
ical_comp = cal_component_get_icalcomponent (comp);
|
||||||
|
|
||||||
for (prop = icalcomponent_get_first_property (ical_comp, ICAL_ATTENDEE_PROPERTY);
|
for (prop = icalcomponent_get_first_property (ical_comp, ICAL_ATTENDEE_PROPERTY);
|
||||||
@ -1568,11 +1626,17 @@ ok_clicked_cb (GtkHTML *html, const gchar *method, const gchar *url, const gchar
|
|||||||
attendee = icalvalue_get_string (value);
|
attendee = icalvalue_get_string (value);
|
||||||
text = itip_strip_mailto (attendee);
|
text = itip_strip_mailto (attendee);
|
||||||
|
|
||||||
if (!strstr (text, priv->my_address)) {
|
if (!strstr (text, priv->my_address))
|
||||||
icalcomponent_remove_property (ical_comp, prop);
|
list = g_slist_prepend (list, prop);
|
||||||
icalproperty_free (prop);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
for (l = list; l; l = l->next) {
|
||||||
|
prop = l->data;
|
||||||
|
icalcomponent_remove_property (ical_comp, prop);
|
||||||
|
icalproperty_free (prop);
|
||||||
|
}
|
||||||
|
g_slist_free (list);
|
||||||
|
|
||||||
cal_component_rescan (comp);
|
cal_component_rescan (comp);
|
||||||
itip_send_comp (CAL_COMPONENT_METHOD_REPLY, comp);
|
itip_send_comp (CAL_COMPONENT_METHOD_REPLY, comp);
|
||||||
} else {
|
} else {
|
||||||
|
@ -450,7 +450,8 @@ comp_limit_attendees (CalComponent *comp)
|
|||||||
GList *addresses;
|
GList *addresses;
|
||||||
icalproperty *prop;
|
icalproperty *prop;
|
||||||
gboolean found = FALSE, match = FALSE;
|
gboolean found = FALSE, match = FALSE;
|
||||||
|
GSList *l, *list = NULL;
|
||||||
|
|
||||||
icomp = cal_component_get_icalcomponent (comp);
|
icomp = cal_component_get_icalcomponent (comp);
|
||||||
addresses = itip_addresses_get ();
|
addresses = itip_addresses_get ();
|
||||||
|
|
||||||
@ -464,8 +465,7 @@ comp_limit_attendees (CalComponent *comp)
|
|||||||
|
|
||||||
/* If we've already found something, just erase the rest */
|
/* If we've already found something, just erase the rest */
|
||||||
if (found) {
|
if (found) {
|
||||||
icalcomponent_remove_property (icomp, prop);
|
list = g_slist_prepend (list, prop);
|
||||||
icalproperty_free (prop);
|
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -482,12 +482,20 @@ comp_limit_attendees (CalComponent *comp)
|
|||||||
if (strstr (text, a->address))
|
if (strstr (text, a->address))
|
||||||
found = match = TRUE;
|
found = match = TRUE;
|
||||||
}
|
}
|
||||||
if (!match) {
|
|
||||||
icalcomponent_remove_property (icomp, prop);
|
if (!match)
|
||||||
icalproperty_free (prop);
|
list = g_slist_prepend (list, prop);
|
||||||
}
|
|
||||||
match = FALSE;
|
match = FALSE;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
for (l = list; l != NULL; l = l->next) {
|
||||||
|
prop = l->data;
|
||||||
|
|
||||||
|
icalcomponent_remove_property (icomp, prop);
|
||||||
|
icalproperty_free (prop);
|
||||||
|
}
|
||||||
|
g_slist_free (list);
|
||||||
|
|
||||||
itip_addresses_free (addresses);
|
itip_addresses_free (addresses);
|
||||||
|
|
||||||
return found;
|
return found;
|
||||||
@ -551,7 +559,7 @@ static CalComponent *
|
|||||||
comp_minimal (CalComponent *comp, gboolean attendee)
|
comp_minimal (CalComponent *comp, gboolean attendee)
|
||||||
{
|
{
|
||||||
CalComponent *clone;
|
CalComponent *clone;
|
||||||
icalcomponent *icomp;
|
icalcomponent *icomp, *icomp_clone;
|
||||||
icalproperty *prop;
|
icalproperty *prop;
|
||||||
CalComponentOrganizer organizer;
|
CalComponentOrganizer organizer;
|
||||||
const char *uid;
|
const char *uid;
|
||||||
@ -600,9 +608,11 @@ comp_minimal (CalComponent *comp, gboolean attendee)
|
|||||||
cal_component_free_text_list (comments);
|
cal_component_free_text_list (comments);
|
||||||
|
|
||||||
cal_component_get_recurid (comp, &recur_id);
|
cal_component_get_recurid (comp, &recur_id);
|
||||||
cal_component_set_recurid (clone, recur_id);
|
if (recur_id->datetime->value != NULL)
|
||||||
|
cal_component_set_recurid (clone, recur_id);
|
||||||
|
|
||||||
icomp = cal_component_get_icalcomponent (comp);
|
icomp = cal_component_get_icalcomponent (comp);
|
||||||
|
icomp_clone = cal_component_get_icalcomponent (clone);
|
||||||
for (prop = icalcomponent_get_first_property (icomp, ICAL_X_PROPERTY);
|
for (prop = icalcomponent_get_first_property (icomp, ICAL_X_PROPERTY);
|
||||||
prop != NULL;
|
prop != NULL;
|
||||||
prop = icalcomponent_get_next_property (icomp, ICAL_X_PROPERTY))
|
prop = icalcomponent_get_next_property (icomp, ICAL_X_PROPERTY))
|
||||||
@ -610,7 +620,7 @@ comp_minimal (CalComponent *comp, gboolean attendee)
|
|||||||
icalproperty *p;
|
icalproperty *p;
|
||||||
|
|
||||||
p = icalproperty_new_clone (prop);
|
p = icalproperty_new_clone (prop);
|
||||||
icalcomponent_add_property (icomp, p);
|
icalcomponent_add_property (icomp_clone, p);
|
||||||
}
|
}
|
||||||
|
|
||||||
cal_component_rescan (clone);
|
cal_component_rescan (clone);
|
||||||
@ -659,6 +669,7 @@ comp_compliant (CalComponentItipMethod method, CalComponent *comp)
|
|||||||
case CAL_COMPONENT_METHOD_DECLINECOUNTER:
|
case CAL_COMPONENT_METHOD_DECLINECOUNTER:
|
||||||
/* Need to remove almost everything */
|
/* Need to remove almost everything */
|
||||||
temp_clone = comp_minimal (clone, FALSE);
|
temp_clone = comp_minimal (clone, FALSE);
|
||||||
|
gtk_object_unref (GTK_OBJECT (clone));
|
||||||
clone = temp_clone;
|
clone = temp_clone;
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
|
Reference in New Issue
Block a user