aboutsummaryrefslogtreecommitdiffstats
path: root/calendar
diff options
context:
space:
mode:
authorSeth Alves <alves@src.gnome.org>2000-06-07 05:56:20 +0800
committerSeth Alves <alves@src.gnome.org>2000-06-07 05:56:20 +0800
commitc219c79496fca669af1ae093a660a1ce4d81a682 (patch)
treef93a2842d0914f396b5a2872ed48536cbfec1f91 /calendar
parenta8b296282e5f93562c85b00b11d006b0eb7f1653 (diff)
downloadgsoc2013-evolution-c219c79496fca669af1ae093a660a1ce4d81a682.tar
gsoc2013-evolution-c219c79496fca669af1ae093a660a1ce4d81a682.tar.gz
gsoc2013-evolution-c219c79496fca669af1ae093a660a1ce4d81a682.tar.bz2
gsoc2013-evolution-c219c79496fca669af1ae093a660a1ce4d81a682.tar.lz
gsoc2013-evolution-c219c79496fca669af1ae093a660a1ce4d81a682.tar.xz
gsoc2013-evolution-c219c79496fca669af1ae093a660a1ce4d81a682.tar.zst
gsoc2013-evolution-c219c79496fca669af1ae093a660a1ce4d81a682.zip
fixed a bunch of problems use libical instead of libversit
* cal-util/icalendar.c, icalendar-save.c: fixed a bunch of problems * cal-util/calobj.c (ical_object_find_in_string): use libical instead of libversit (ical_object_to_string): same (dump_icalobject): prints the contents of an icalobject for debugging * gui/Makefile.am (LINK_FLAGS): link libical.a instead of libical.la so we don't have to modify the build system of the released libical * cal-client/Makefile.am (client_test_LDADD): same * cal-util/Makefile.am (icalendar_test_LDADD): same svn path=/trunk/; revision=3446
Diffstat (limited to 'calendar')
-rw-r--r--calendar/ChangeLog13
-rw-r--r--calendar/cal-client/Makefile.am2
-rw-r--r--calendar/cal-util/Makefile.am25
-rw-r--r--calendar/cal-util/calobj.c183
-rw-r--r--calendar/cal-util/calobj.h2
-rw-r--r--calendar/cal-util/icalendar-save.c89
-rw-r--r--calendar/gui/Makefile.am2
-rw-r--r--calendar/pcs/Makefile.am18
-rw-r--r--calendar/pcs/cal-backend-imc.c2
-rw-r--r--calendar/pcs/icalendar-save.c89
10 files changed, 318 insertions, 107 deletions
diff --git a/calendar/ChangeLog b/calendar/ChangeLog
index 146ea65813..97302ab6c3 100644
--- a/calendar/ChangeLog
+++ b/calendar/ChangeLog
@@ -1,3 +1,16 @@
+2000-06-06 Seth Alves <alves@hungry.com>
+
+ * cal-util/icalendar.c, icalendar-save.c: fixed a bunch of problems
+ * cal-util/calobj.c (ical_object_find_in_string): use libical
+ instead of libversit
+ (ical_object_to_string): same
+ (dump_icalobject): prints the contents of an icalobject for debugging
+
+ * gui/Makefile.am (LINK_FLAGS): link libical.a instead of libical.la
+ so we don't have to modify the build system of the released libical
+ * cal-client/Makefile.am (client_test_LDADD): same
+ * cal-util/Makefile.am (icalendar_test_LDADD): same
+
2000-06-06 Federico Mena Quintero <federico@helixcode.com>
* cal-util/calobj.c (ical_object_destroy): Removed from the public
diff --git a/calendar/cal-client/Makefile.am b/calendar/cal-client/Makefile.am
index f7077ed88f..cdb6ce21e2 100644
--- a/calendar/cal-client/Makefile.am
+++ b/calendar/cal-client/Makefile.am
@@ -58,5 +58,5 @@ client_test_LDADD = \
$(BONOBO_VFS_GNOME_LIBS) \
$(top_builddir)/calendar/cal-util/libcal-util.la \
$(top_builddir)/libversit/libversit.la \
- $(top_builddir)/libical/src/libical/libical.la \
+ $(top_builddir)/libical/src/libical/libical.a \
libcal-client.la
diff --git a/calendar/cal-util/Makefile.am b/calendar/cal-util/Makefile.am
index d3517c2102..1bcab2b5ad 100644
--- a/calendar/cal-util/Makefile.am
+++ b/calendar/cal-util/Makefile.am
@@ -13,10 +13,14 @@ INCLUDES = \
lib_LTLIBRARIES = libcal-util.la
-libcal_util_la_SOURCES = \
- cal-recur.c \
- cal-util.c \
- calobj.c \
+libcal_util_la_SOURCES = \
+ cal-recur.c \
+ cal-util.c \
+ calobj.c \
+ icalendar.c \
+ icalendar.h \
+ icalendar-save.c \
+ icalendar-save.h \
timeutil.c
libcal_utilincludedir = $(includedir)/evolution/cal-util
@@ -27,6 +31,19 @@ libcal_utilinclude_HEADERS = \
calobj.h \
timeutil.h
+noinst_PROGRAMS = icalendar-test
+
+icalendar_test_SOURCES = \
+ icalendar-test.c \
+ icalendar.c \
+ icalendar-save.c
+
+icalendar_test_LDADD = \
+ $(EXTRA_GNOME_LIBS) \
+ $(top_builddir)/libversit/libversit.la \
+ $(top_builddir)/libical/src/libical/libical.a
+
+# $(top_builddir)/calendar/cal-util/libcal-util.la \
test_recur_SOURCES = \
test-recur.c
diff --git a/calendar/cal-util/calobj.c b/calendar/cal-util/calobj.c
index 9e86011d9f..3c1e10689b 100644
--- a/calendar/cal-util/calobj.c
+++ b/calendar/cal-util/calobj.c
@@ -12,9 +12,12 @@
#include <glib.h>
#include <ctype.h>
#include <unistd.h>
+#include <time.h>
#include "calobj.h"
#include "timeutil.h"
#include "libversit/vcc.h"
+#include "icalendar-save.h"
+#include "icalendar.h"
@@ -1565,6 +1568,56 @@ alarm_compute_offset (CalendarAlarm *a)
CalObjFindStatus
ical_object_find_in_string (const char *uid, const char *vcalobj, iCalObject **ico)
{
+#if 1
+ icalcomponent* comp = NULL;
+ icalcomponent *subcomp;
+ iCalObject *ical;
+
+ g_return_val_if_fail (vcalobj != NULL, CAL_OBJ_FIND_NOT_FOUND);
+
+ comp = icalparser_parse_string (vcalobj);
+
+ if (!comp) {
+ printf ("CAL_OBJ_FIND_SYNTAX_ERROR #1\n");
+ return CAL_OBJ_FIND_SYNTAX_ERROR;
+ }
+
+ subcomp = icalcomponent_get_first_component (comp,
+ ICAL_ANY_COMPONENT);
+ if (!subcomp) {
+ printf ("CAL_OBJ_FIND_SYNTAX_ERROR #2\n");
+ return CAL_OBJ_FIND_SYNTAX_ERROR;
+ }
+
+ while (subcomp) {
+ ical = ical_object_create_from_icalcomponent (subcomp);
+ if (ical->type != ICAL_EVENT &&
+ ical->type != ICAL_TODO &&
+ ical->type != ICAL_JOURNAL) {
+ g_warning ("Skipping unsupported iCalendar component");
+ } else {
+ if (strcasecmp (ical->uid, uid) == 0) {
+ (*ico) = ical;
+ (*ico)->ref_count = 1;
+ printf ("CAL_OBJ_FIND_SUCCESS\n");
+
+ printf ("ical_object_find_in_string:\n");
+ printf ("-----------------------------------------------------\n");
+ dump_icalobject (*ico);
+ printf ("-----------------------------------------------------\n");
+
+
+ return CAL_OBJ_FIND_SUCCESS;
+ }
+ }
+ subcomp = icalcomponent_get_next_component (comp,
+ ICAL_ANY_COMPONENT);
+ }
+
+ printf ("CAL_OBJ_FIND_NOT_FOUND\n");
+ return CAL_OBJ_FIND_NOT_FOUND;
+
+#else /* 0 */
VObject *vcal;
VObjectIterator i;
CalObjFindStatus status;
@@ -1619,6 +1672,7 @@ ical_object_find_in_string (const char *uid, const char *vcalobj, iCalObject **i
cleanStrTbl ();
return status;
+#endif /* 0 */
}
/* Creates a VObject with the base information of a calendar */
@@ -1663,6 +1717,22 @@ get_calendar_base_vobject (void)
char *
ical_object_to_string (iCalObject *ico)
{
+#if 1
+ icalcomponent *top = icalcomponent_new (ICAL_VCALENDAR_COMPONENT);
+ char *out_cal_string;
+ icalcomponent *comp;
+
+ printf ("ical_object_to_string:\n");
+ printf ("-----------------------------------------------------\n");
+ dump_icalobject (ico);
+ printf ("-----------------------------------------------------\n");
+
+ comp = icalcomponent_create_from_ical_object (ico);
+ icalcomponent_add_component (top, comp);
+ out_cal_string = icalcomponent_as_ical_string (top);
+ return g_strdup (out_cal_string);
+
+#else /* 0 */
VObject *vcalobj, *vobj;
char *buf, *gbuf;
@@ -1682,6 +1752,7 @@ ical_object_to_string (iCalObject *ico)
free (buf);
return gbuf;
+#endif /* 0 */
}
@@ -1808,3 +1879,115 @@ ical_object_normalize_summary (iCalObject *ico)
}
*dest = '\0';
}
+
+
+void dump_icalobject (iCalObject *ico)
+{
+ if (!ico) {
+ printf ("<<NULL>>\n");
+ return;
+ }
+
+ printf ("type ");
+ switch (ico->type) {
+ case ICAL_EVENT: printf ("event"); break;
+ case ICAL_TODO: printf ("todo"); break;
+ case ICAL_JOURNAL: printf ("journal"); break;
+ case ICAL_FBREQUEST: printf ("fbrequest"); break;
+ case ICAL_FBREPLY: printf ("fbreply"); break;
+ case ICAL_BUSYTIME: printf ("busytime"); break;
+ case ICAL_TIMEZONE: printf ("timezone"); break;
+ }
+ printf ("\n");
+
+ printf ("attach-length %d\n", g_list_length (ico->attach));
+
+ printf ("attendee-length %d\n", g_list_length (ico->attendee));
+
+ printf ("catagories-length %d\n", g_list_length (ico->categories));
+
+ printf ("class '%s'\n", ico->class ? ico->class : "NULL");
+
+ printf ("comment '%s'\n", ico->comment ? ico->comment : "NULL");
+
+ printf ("completed %ld=%s",
+ ico->completed, ctime (&ico->completed));
+
+ printf ("created %ld=%s", ico->created, ctime (&ico->created));
+
+ printf ("contact-length %d\n", g_list_length (ico->contact));
+
+ printf ("desc '%s'\n", ico->desc ? ico->desc : "NULL");
+
+ printf ("dtstamp %ld=%s", ico->dtstamp, ctime (&ico->dtstamp));
+
+ printf ("dtstart %ld=%s", ico->dtstart, ctime (&ico->dtstart));
+
+ printf ("dtend %ld=%s", ico->dtend, ctime (&ico->dtend));
+
+ printf ("date_only %d\n", ico->date_only);
+
+ printf ("exdate-length %d\n", g_list_length (ico->exdate));
+
+ printf ("exrule-length %d\n", g_list_length (ico->exrule));
+
+ printf ("iCalGeo %d %f %f\n",
+ ico->geo.valid, ico->geo.latitude, ico->geo.longitude);
+
+ printf ("last_mod %ld=%s", ico->last_mod, ctime (&ico->last_mod));
+
+ printf ("location '%s'\n", ico->location ? ico->location : "NULL");
+
+ printf ("organizer %p\n", ico->organizer);
+
+ printf ("percent %d\n", ico->percent);
+
+ printf ("priority %d\n", ico->priority);
+
+ printf ("rstatus '%s'\n", ico->rstatus ? ico->rstatus : "NULL");
+
+ printf ("related-length %d\n", g_list_length (ico->related));
+
+ printf ("resources-length %d\n", g_list_length (ico->resources));
+
+ printf ("rdate-length %d\n", g_list_length (ico->rdate));
+
+ printf ("rrule-length %d\n", g_list_length (ico->rrule));
+
+ printf ("seq %d\n", ico->seq);
+
+ printf ("status '%s'\n", ico->status ? ico->status : "NULL");
+
+ printf ("summary '%s'\n", ico->summary ? ico->summary : "NULL");
+
+ printf ("transp ");
+ switch (ico->transp) {
+ case ICAL_OPAQUE: printf ("opaque"); break;
+ case ICAL_TRANSPARENT: printf ("transparent"); break;
+ }
+ printf ("\n");
+
+ printf ("uid '%s'\n", ico->uid ? ico->uid : "NULL");
+
+ printf ("url '%s'\n", ico->url ? ico->url : "NULL");
+
+ printf ("recurid %ld=%s", ico->recurid, ctime (&ico->recurid));
+
+ printf ("dalarm %d\n", ico->dalarm.enabled);
+
+ printf ("aalarm %d\n", ico->aalarm.enabled);
+
+ printf ("palarm %d\n", ico->palarm.enabled);
+
+ printf ("malarm %d\n", ico->malarm.enabled);
+
+ printf ("alarms-length %d\n", g_list_length (ico->alarms));
+
+ printf ("recur %p\n", ico->recur);
+
+ printf ("new %d\n", ico->new);
+
+ printf ("user_data %p\n", ico->user_data);
+
+ printf ("ref_count %d\n", ico->ref_count);
+}
diff --git a/calendar/cal-util/calobj.h b/calendar/cal-util/calobj.h
index f2e5dbe00c..57514250e5 100644
--- a/calendar/cal-util/calobj.h
+++ b/calendar/cal-util/calobj.h
@@ -275,6 +275,8 @@ char *ical_gen_uid (void);
void ical_object_reset_recurrence (iCalObject *ico);
+void dump_icalobject (iCalObject *ico);
+
END_GNOME_DECLS
#endif
diff --git a/calendar/cal-util/icalendar-save.c b/calendar/cal-util/icalendar-save.c
index 8fae9a02f5..8f2335763f 100644
--- a/calendar/cal-util/icalendar-save.c
+++ b/calendar/cal-util/icalendar-save.c
@@ -311,7 +311,8 @@ struct icaltimetype timet_to_icaltime (time_t tt)
struct tm *t;
struct icaltimetype i;
- t = gmtime (&tt);
+ //t = gmtime (&tt);
+ t = localtime (&tt);
/*return tt - (i->is_utc ? timezone : 0); */
i.is_utc = 0;
@@ -351,52 +352,58 @@ void unparse_person (iCalPerson *person, icalproperty *person_prop)
icalproperty_add_parameter (person_prop, param);
}
- if (g_strcasecmp (person->role, "CHAIR") == 0)
- param = icalparameter_new_role (ICAL_ROLE_CHAIR);
- else if (g_strcasecmp (person->role, "REQPARTICIPANT") == 0)
- param = icalparameter_new_role (ICAL_ROLE_REQPARTICIPANT);
- else if (g_strcasecmp (person->role, "OPTPARTICIPANT") == 0)
- param = icalparameter_new_role (ICAL_ROLE_OPTPARTICIPANT);
- else if (g_strcasecmp (person->role, "NONPARTICIPANT") == 0)
- param = icalparameter_new_role (ICAL_ROLE_NONPARTICIPANT);
- else
- param = icalparameter_new_role (ICAL_ROLE_XNAME);
- icalproperty_add_parameter (person_prop, param);
-
- if (g_strcasecmp (person->partstat, "NEEDSACTION") == 0)
- param = icalparameter_new_partstat (ICAL_PARTSTAT_NEEDSACTION);
- else if (g_strcasecmp (person->partstat, "ACCEPTED") == 0)
- param = icalparameter_new_partstat (ICAL_PARTSTAT_ACCEPTED);
- else if (g_strcasecmp (person->partstat, "DECLINED") == 0)
- param = icalparameter_new_partstat (ICAL_PARTSTAT_DECLINED);
- else if (g_strcasecmp (person->partstat, "TENTATIVE") == 0)
- param = icalparameter_new_partstat (ICAL_PARTSTAT_TENTATIVE);
- else if (g_strcasecmp (person->partstat, "DELEGATED") == 0)
- param = icalparameter_new_partstat (ICAL_PARTSTAT_DELEGATED);
- else if (g_strcasecmp (person->partstat, "COMPLETED") == 0)
- param = icalparameter_new_partstat (ICAL_PARTSTAT_COMPLETED);
- else if (g_strcasecmp (person->partstat, "INPROCESS") == 0)
- param = icalparameter_new_partstat (ICAL_PARTSTAT_INPROCESS);
- else /* FIX ME, NEEDSACTION instead? */
- param = icalparameter_new_partstat (ICAL_PARTSTAT_XNAME);
- icalproperty_add_parameter (person_prop, param);
+ if (person->role) {
+ if (g_strcasecmp (person->role, "CHAIR") == 0)
+ param = icalparameter_new_role (ICAL_ROLE_CHAIR);
+ else if (g_strcasecmp (person->role, "REQPARTICIPANT") == 0)
+ param = icalparameter_new_role (ICAL_ROLE_REQPARTICIPANT);
+ else if (g_strcasecmp (person->role, "OPTPARTICIPANT") == 0)
+ param = icalparameter_new_role (ICAL_ROLE_OPTPARTICIPANT);
+ else if (g_strcasecmp (person->role, "NONPARTICIPANT") == 0)
+ param = icalparameter_new_role (ICAL_ROLE_NONPARTICIPANT);
+ else
+ param = icalparameter_new_role (ICAL_ROLE_XNAME);
+ icalproperty_add_parameter (person_prop, param);
+ }
+
+ if (person->partstat) {
+ if (g_strcasecmp (person->partstat, "NEEDSACTION") == 0)
+ param = icalparameter_new_partstat (ICAL_PARTSTAT_NEEDSACTION);
+ else if (g_strcasecmp (person->partstat, "ACCEPTED") == 0)
+ param = icalparameter_new_partstat (ICAL_PARTSTAT_ACCEPTED);
+ else if (g_strcasecmp (person->partstat, "DECLINED") == 0)
+ param = icalparameter_new_partstat (ICAL_PARTSTAT_DECLINED);
+ else if (g_strcasecmp (person->partstat, "TENTATIVE") == 0)
+ param = icalparameter_new_partstat (ICAL_PARTSTAT_TENTATIVE);
+ else if (g_strcasecmp (person->partstat, "DELEGATED") == 0)
+ param = icalparameter_new_partstat (ICAL_PARTSTAT_DELEGATED);
+ else if (g_strcasecmp (person->partstat, "COMPLETED") == 0)
+ param = icalparameter_new_partstat (ICAL_PARTSTAT_COMPLETED);
+ else if (g_strcasecmp (person->partstat, "INPROCESS") == 0)
+ param = icalparameter_new_partstat (ICAL_PARTSTAT_INPROCESS);
+ else /* FIX ME, NEEDSACTION instead? */
+ param = icalparameter_new_partstat (ICAL_PARTSTAT_XNAME);
+ icalproperty_add_parameter (person_prop, param);
+ }
if (person->rsvp != FALSE) {
param = icalparameter_new_rsvp (TRUE);
icalproperty_add_parameter (person_prop, param);
}
- if (g_strcasecmp (person->cutype, "INDIVIDUAL") == 0)
- param = icalparameter_new_cutype (ICAL_CUTYPE_INDIVIDUAL);
- else if (g_strcasecmp (person->cutype, "GROUP") == 0)
- param = icalparameter_new_cutype (ICAL_CUTYPE_GROUP);
- else if (g_strcasecmp (person->cutype, "RESOURCE") == 0)
- param = icalparameter_new_cutype (ICAL_CUTYPE_RESOURCE);
- else if (g_strcasecmp (person->cutype, "ROOM") == 0)
- param = icalparameter_new_cutype (ICAL_CUTYPE_ROOM);
- else /* FIX ME, INDIVIDUAL instead? */
- param = icalparameter_new_cutype (ICAL_CUTYPE_UNKNOWN);
- icalproperty_add_parameter (person_prop, param);
+ if (person->cutype) {
+ if (g_strcasecmp (person->cutype, "INDIVIDUAL") == 0)
+ param = icalparameter_new_cutype (ICAL_CUTYPE_INDIVIDUAL);
+ else if (g_strcasecmp (person->cutype, "GROUP") == 0)
+ param = icalparameter_new_cutype (ICAL_CUTYPE_GROUP);
+ else if (g_strcasecmp (person->cutype, "RESOURCE") == 0)
+ param = icalparameter_new_cutype (ICAL_CUTYPE_RESOURCE);
+ else if (g_strcasecmp (person->cutype, "ROOM") == 0)
+ param = icalparameter_new_cutype (ICAL_CUTYPE_ROOM);
+ else /* FIX ME, INDIVIDUAL instead? */
+ param = icalparameter_new_cutype (ICAL_CUTYPE_UNKNOWN);
+ icalproperty_add_parameter (person_prop, param);
+ }
/* person->member is a list of ICAL_MEMBER_PARAMETER */
for (cur = person->member; cur; cur = cur->next) {
diff --git a/calendar/gui/Makefile.am b/calendar/gui/Makefile.am
index c1e06b53ac..ed50ac64a1 100644
--- a/calendar/gui/Makefile.am
+++ b/calendar/gui/Makefile.am
@@ -29,7 +29,7 @@ LINK_FLAGS = \
$(top_builddir)/widgets/e-paned/libepaned.a \
$(top_builddir)/widgets/e-text/libetext.a \
$(top_builddir)/libversit/libversit.la \
- $(top_builddir)/libical/src/libical/libical.la
+ $(top_builddir)/libical/src/libical/libical.a
gladedir = $(datadir)/evolution/glade
diff --git a/calendar/pcs/Makefile.am b/calendar/pcs/Makefile.am
index 919630bb98..3299d15908 100644
--- a/calendar/pcs/Makefile.am
+++ b/calendar/pcs/Makefile.am
@@ -34,29 +34,11 @@ libpcs_a_SOURCES = \
cal-common.h \
cal-factory.c \
cal-factory.h \
- icalendar.c \
- icalendar.h \
- icalendar-save.c \
- icalendar-save.h \
job.c \
job.h
-noinst_PROGRAMS = icalendar-test
-
-icalendar_test_SOURCES = \
- icalendar-test.c \
- icalendar.c \
- icalendar-save.c
-
-icalendar_test_LDADD = \
- $(EXTRA_GNOME_LIBS) \
- $(top_builddir)/libversit/libversit.la \
- $(top_builddir)/libical/src/libical/libical.la
-
-# $(top_builddir)/calendar/cal-util/libcal-util.la \
-
diff --git a/calendar/pcs/cal-backend-imc.c b/calendar/pcs/cal-backend-imc.c
index 46c8f0dba0..a85c8ce535 100644
--- a/calendar/pcs/cal-backend-imc.c
+++ b/calendar/pcs/cal-backend-imc.c
@@ -24,7 +24,7 @@
#include <config.h>
#include <gtk/gtksignal.h>
#include "cal-backend-imc.h"
-#include "icalendar.h"
+#include "cal-util/icalendar.h"
diff --git a/calendar/pcs/icalendar-save.c b/calendar/pcs/icalendar-save.c
index 8fae9a02f5..8f2335763f 100644
--- a/calendar/pcs/icalendar-save.c
+++ b/calendar/pcs/icalendar-save.c
@@ -311,7 +311,8 @@ struct icaltimetype timet_to_icaltime (time_t tt)
struct tm *t;
struct icaltimetype i;
- t = gmtime (&tt);
+ //t = gmtime (&tt);
+ t = localtime (&tt);
/*return tt - (i->is_utc ? timezone : 0); */
i.is_utc = 0;
@@ -351,52 +352,58 @@ void unparse_person (iCalPerson *person, icalproperty *person_prop)
icalproperty_add_parameter (person_prop, param);
}
- if (g_strcasecmp (person->role, "CHAIR") == 0)
- param = icalparameter_new_role (ICAL_ROLE_CHAIR);
- else if (g_strcasecmp (person->role, "REQPARTICIPANT") == 0)
- param = icalparameter_new_role (ICAL_ROLE_REQPARTICIPANT);
- else if (g_strcasecmp (person->role, "OPTPARTICIPANT") == 0)
- param = icalparameter_new_role (ICAL_ROLE_OPTPARTICIPANT);
- else if (g_strcasecmp (person->role, "NONPARTICIPANT") == 0)
- param = icalparameter_new_role (ICAL_ROLE_NONPARTICIPANT);
- else
- param = icalparameter_new_role (ICAL_ROLE_XNAME);
- icalproperty_add_parameter (person_prop, param);
-
- if (g_strcasecmp (person->partstat, "NEEDSACTION") == 0)
- param = icalparameter_new_partstat (ICAL_PARTSTAT_NEEDSACTION);
- else if (g_strcasecmp (person->partstat, "ACCEPTED") == 0)
- param = icalparameter_new_partstat (ICAL_PARTSTAT_ACCEPTED);
- else if (g_strcasecmp (person->partstat, "DECLINED") == 0)
- param = icalparameter_new_partstat (ICAL_PARTSTAT_DECLINED);
- else if (g_strcasecmp (person->partstat, "TENTATIVE") == 0)
- param = icalparameter_new_partstat (ICAL_PARTSTAT_TENTATIVE);
- else if (g_strcasecmp (person->partstat, "DELEGATED") == 0)
- param = icalparameter_new_partstat (ICAL_PARTSTAT_DELEGATED);
- else if (g_strcasecmp (person->partstat, "COMPLETED") == 0)
- param = icalparameter_new_partstat (ICAL_PARTSTAT_COMPLETED);
- else if (g_strcasecmp (person->partstat, "INPROCESS") == 0)
- param = icalparameter_new_partstat (ICAL_PARTSTAT_INPROCESS);
- else /* FIX ME, NEEDSACTION instead? */
- param = icalparameter_new_partstat (ICAL_PARTSTAT_XNAME);
- icalproperty_add_parameter (person_prop, param);
+ if (person->role) {
+ if (g_strcasecmp (person->role, "CHAIR") == 0)
+ param = icalparameter_new_role (ICAL_ROLE_CHAIR);
+ else if (g_strcasecmp (person->role, "REQPARTICIPANT") == 0)
+ param = icalparameter_new_role (ICAL_ROLE_REQPARTICIPANT);
+ else if (g_strcasecmp (person->role, "OPTPARTICIPANT") == 0)
+ param = icalparameter_new_role (ICAL_ROLE_OPTPARTICIPANT);
+ else if (g_strcasecmp (person->role, "NONPARTICIPANT") == 0)
+ param = icalparameter_new_role (ICAL_ROLE_NONPARTICIPANT);
+ else
+ param = icalparameter_new_role (ICAL_ROLE_XNAME);
+ icalproperty_add_parameter (person_prop, param);
+ }
+
+ if (person->partstat) {
+ if (g_strcasecmp (person->partstat, "NEEDSACTION") == 0)
+ param = icalparameter_new_partstat (ICAL_PARTSTAT_NEEDSACTION);
+ else if (g_strcasecmp (person->partstat, "ACCEPTED") == 0)
+ param = icalparameter_new_partstat (ICAL_PARTSTAT_ACCEPTED);
+ else if (g_strcasecmp (person->partstat, "DECLINED") == 0)
+ param = icalparameter_new_partstat (ICAL_PARTSTAT_DECLINED);
+ else if (g_strcasecmp (person->partstat, "TENTATIVE") == 0)
+ param = icalparameter_new_partstat (ICAL_PARTSTAT_TENTATIVE);
+ else if (g_strcasecmp (person->partstat, "DELEGATED") == 0)
+ param = icalparameter_new_partstat (ICAL_PARTSTAT_DELEGATED);
+ else if (g_strcasecmp (person->partstat, "COMPLETED") == 0)
+ param = icalparameter_new_partstat (ICAL_PARTSTAT_COMPLETED);
+ else if (g_strcasecmp (person->partstat, "INPROCESS") == 0)
+ param = icalparameter_new_partstat (ICAL_PARTSTAT_INPROCESS);
+ else /* FIX ME, NEEDSACTION instead? */
+ param = icalparameter_new_partstat (ICAL_PARTSTAT_XNAME);
+ icalproperty_add_parameter (person_prop, param);
+ }
if (person->rsvp != FALSE) {
param = icalparameter_new_rsvp (TRUE);
icalproperty_add_parameter (person_prop, param);
}
- if (g_strcasecmp (person->cutype, "INDIVIDUAL") == 0)
- param = icalparameter_new_cutype (ICAL_CUTYPE_INDIVIDUAL);
- else if (g_strcasecmp (person->cutype, "GROUP") == 0)
- param = icalparameter_new_cutype (ICAL_CUTYPE_GROUP);
- else if (g_strcasecmp (person->cutype, "RESOURCE") == 0)
- param = icalparameter_new_cutype (ICAL_CUTYPE_RESOURCE);
- else if (g_strcasecmp (person->cutype, "ROOM") == 0)
- param = icalparameter_new_cutype (ICAL_CUTYPE_ROOM);
- else /* FIX ME, INDIVIDUAL instead? */
- param = icalparameter_new_cutype (ICAL_CUTYPE_UNKNOWN);
- icalproperty_add_parameter (person_prop, param);
+ if (person->cutype) {
+ if (g_strcasecmp (person->cutype, "INDIVIDUAL") == 0)
+ param = icalparameter_new_cutype (ICAL_CUTYPE_INDIVIDUAL);
+ else if (g_strcasecmp (person->cutype, "GROUP") == 0)
+ param = icalparameter_new_cutype (ICAL_CUTYPE_GROUP);
+ else if (g_strcasecmp (person->cutype, "RESOURCE") == 0)
+ param = icalparameter_new_cutype (ICAL_CUTYPE_RESOURCE);
+ else if (g_strcasecmp (person->cutype, "ROOM") == 0)
+ param = icalparameter_new_cutype (ICAL_CUTYPE_ROOM);
+ else /* FIX ME, INDIVIDUAL instead? */
+ param = icalparameter_new_cutype (ICAL_CUTYPE_UNKNOWN);
+ icalproperty_add_parameter (person_prop, param);
+ }
/* person->member is a list of ICAL_MEMBER_PARAMETER */
for (cur = person->member; cur; cur = cur->next) {