~ubuntu-branches/ubuntu/natty/evolution-exchange/natty

« back to all changes in this revision

Viewing changes to calendar/e-cal-backend-exchange-calendar.c

  • Committer: Bazaar Package Importer
  • Author(s): Sebastien Bacher
  • Date: 2009-06-16 00:24:12 UTC
  • mfrom: (1.1.57 upstream)
  • Revision ID: james.westby@ubuntu.com-20090616002412-g7ucx327w7rpqhij
Tags: 2.27.3-0ubuntu1
* New upstream version 
* debian/control:
  - updated evolution requirement
* debian/patches/20_fix-crash-on-personal-calendar.patch:
  - the change is in the new version

Show diffs side-by-side

added added

removed removed

Lines of Context:
40
40
#include <mapi.h>
41
41
 
42
42
struct ECalBackendExchangeCalendarPrivate {
43
 
        int dummy;
 
43
        gint dummy;
44
44
        GMutex *mutex;
45
45
        gboolean is_loaded;
46
46
};
57
57
 
58
58
#define d(x)
59
59
 
60
 
static ECalBackendSyncStatus modify_object_with_href (ECalBackendSync *backend, EDataCal *cal, const char *calobj, CalObjModType mod, char **old_object, char **new_object, const char *href, const char *rid_to_remove);
 
60
static ECalBackendSyncStatus modify_object_with_href (ECalBackendSync *backend, EDataCal *cal, const gchar *calobj, CalObjModType mod, gchar **old_object, gchar **new_object, const gchar *href, const gchar *rid_to_remove);
61
61
 
62
 
static icalproperty *find_attendee_prop (icalcomponent *ical_comp, const char *address);
 
62
static icalproperty *find_attendee_prop (icalcomponent *ical_comp, const gchar *address);
63
63
static gboolean check_owner_partstatus_for_declined (ECalBackendSync *backend,
64
64
                                                     icalcomponent *icalcomp);
65
65
 
95
95
 
96
96
static gboolean
97
97
add_vevent (ECalBackendExchange *cbex,
98
 
            const char *href, const char *lastmod,
 
98
            const gchar *href, const gchar *lastmod,
99
99
            icalcomponent *icalcomp)
100
100
{
101
101
        icalproperty *prop, *transp;
109
109
        /* Check all X-MICROSOFT-CDO properties to fix any needed stuff */
110
110
        prop = icalcomponent_get_first_property (icalcomp, ICAL_X_PROPERTY);
111
111
        while (prop) {
112
 
                const char *x_name, *x_val;
 
112
                const gchar *x_name, *x_val;
113
113
                struct icaltimetype itt;
114
114
 
115
115
                x_name = icalproperty_get_x_name (prop);
188
188
 
189
189
/* Add the event to the cache, Notify the backend if it is sucessfully added */
190
190
static gboolean
191
 
add_ical (ECalBackendExchange *cbex, const char *href, const char *lastmod,
192
 
          const char *uid, const char *body, int len, int receipts)
 
191
add_ical (ECalBackendExchange *cbex, const gchar *href, const gchar *lastmod,
 
192
          const gchar *uid, const gchar *body, gint len, gint receipts)
193
193
{
194
 
        const char *start, *end;
195
 
        char *ical_body;
 
194
        const gchar *start, *end;
 
195
        gchar *ical_body;
196
196
        icalcomponent *icalcomp, *subcomp, *new_comp;
197
197
        icalcomponent_kind kind;
198
198
        icalproperty *icalprop;
246
246
                status = add_vevent (cbex, href, lastmod, icalcomp);
247
247
 
248
248
                if (status) {
249
 
                        char *object = icalcomponent_as_ical_string_r (icalcomp);
 
249
                        gchar *object = icalcomponent_as_ical_string_r (icalcomp);
250
250
                        e_cal_backend_notify_object_created (backend, object);
251
251
                        g_free (object);
252
252
                }
289
289
                        status = add_vevent (cbex, href, lastmod, new_comp);
290
290
 
291
291
                        if (status) {
292
 
                                char *object = icalcomponent_as_ical_string_r (new_comp);
 
292
                                gchar *object = icalcomponent_as_ical_string_r (new_comp);
293
293
                                e_cal_backend_notify_object_created (backend, object);
294
294
                                g_free (object);
295
295
                        }
310
310
        return retval;
311
311
}
312
312
 
313
 
static const char *event_properties[] = {
 
313
static const gchar *event_properties[] = {
314
314
        E2K_PR_CALENDAR_UID,
315
315
        PR_CAL_RECURRING_ID,
316
316
        E2K_PR_DAV_LAST_MODIFIED,
318
318
        PR_READ_RECEIPT_REQUESTED,
319
319
        PR_ORIGINATOR_DELIVERY_REPORT_REQUESTED
320
320
};
321
 
static const int n_event_properties = G_N_ELEMENTS (event_properties);
 
321
static const gint n_event_properties = G_N_ELEMENTS (event_properties);
322
322
 
323
 
static const char *new_event_properties[] = {
 
323
static const gchar *new_event_properties[] = {
324
324
        PR_INTERNET_CONTENT,
325
325
        PR_READ_RECEIPT_REQUESTED,
326
326
        PR_ORIGINATOR_DELIVERY_REPORT_REQUESTED
327
327
};
328
 
static const int n_new_event_properties = G_N_ELEMENTS (new_event_properties);
 
328
static const gint n_new_event_properties = G_N_ELEMENTS (new_event_properties);
329
329
 
330
330
static guint
331
331
get_changed_events (ECalBackendExchange *cbex)
336
336
        E2kRestriction *rn;
337
337
        E2kResultIter *iter;
338
338
        E2kResult *result;
339
 
        const char *prop, *uid, *modtime, *attach_prop, *receipts, *rid;
 
339
        const gchar *prop, *uid, *modtime, *attach_prop, *receipts, *rid;
340
340
        guint status;
341
341
        E2kContext *ctx;
342
 
        int i, status_tracking = EX_NO_RECEIPTS;
343
 
        const char *since = NULL;
 
342
        gint i, status_tracking = EX_NO_RECEIPTS;
 
343
        const gchar *since = NULL;
344
344
        ECalBackendExchangeCalendar *cbexc = E_CAL_BACKEND_EXCHANGE_CALENDAR (cbex);
345
345
 
346
346
        g_return_val_if_fail (E_IS_CAL_BACKEND_EXCHANGE (cbex), SOUP_STATUS_CANCELLED);
458
458
                PR_INTERNET_CONTENT property. Fetch events created from OWA */
459
459
        prop = PR_INTERNET_CONTENT;
460
460
        iter = e_folder_exchange_bpropfind_start (cbex->folder, NULL,
461
 
                                                  (const char **)hrefs->pdata,
 
461
                                                  (const gchar **)hrefs->pdata,
462
462
                                                  hrefs->len,
463
463
                                                  new_event_properties, n_new_event_properties);
464
464
        for (i = 0; i < hrefs->len; i++)
496
496
                /* The icaldata already has the attachment. So no need to
497
497
                        re-fetch it from the server. */
498
498
                add_ical (cbex, result->href, modtime, uid,
499
 
                          (char *) ical_data->data, ical_data->len, status_tracking);
 
499
                          (gchar *) ical_data->data, ical_data->len, status_tracking);
500
500
        }
501
501
        status = e2k_result_iter_free (iter);
502
502
 
554
554
 
555
555
/* folder subscription notify callback */
556
556
static void
557
 
notify_changes (E2kContext *ctx, const char *uri,
 
557
notify_changes (E2kContext *ctx, const gchar *uri,
558
558
                     E2kContextChangeType type, gpointer user_data)
559
559
{
560
560
 
570
570
static ECalBackendSyncStatus
571
571
open_calendar (ECalBackendSync *backend, EDataCal *cal,
572
572
               gboolean only_if_exists,
573
 
               const char *username, const char *password)
 
573
               const gchar *username, const gchar *password)
574
574
{
575
575
        ECalBackendSyncStatus status;
576
576
        GThread *thread = NULL;
613
613
};
614
614
 
615
615
static void
616
 
add_timezone_cb (icalparameter *param, void *data)
 
616
add_timezone_cb (icalparameter *param, gpointer data)
617
617
{
618
618
        struct _cb_data *cbdata = (struct _cb_data *) data;
619
619
        icalcomponent *vtzcomp;
620
 
        const char *tzid;
621
 
        char *izone = NULL;
 
620
        const gchar *tzid;
 
621
        gchar *izone = NULL;
622
622
 
623
623
        g_return_if_fail (cbdata != NULL);
624
624
 
642
642
{
643
643
        icalproperty *icalprop;
644
644
        gboolean exists = FALSE;
645
 
        const char *x_name, *x_val;
 
645
        const gchar *x_name, *x_val;
646
646
 
647
647
        icalprop = icalcomponent_get_first_property (icalcomp, ICAL_X_PROPERTY);
648
648
        while (icalprop && !exists) {
673
673
 
674
674
/* stolen from e-itip-control.c with some modifications */
675
675
static icalproperty *
676
 
find_attendee_prop (icalcomponent *ical_comp, const char *address)
 
676
find_attendee_prop (icalcomponent *ical_comp, const gchar *address)
677
677
{
678
678
        icalproperty *prop;
679
679
 
683
683
        for (prop = icalcomponent_get_first_property (ical_comp, ICAL_ATTENDEE_PROPERTY);
684
684
             prop != NULL;
685
685
             prop = icalcomponent_get_next_property (ical_comp, ICAL_ATTENDEE_PROPERTY)) {
686
 
                const char *attendee;
687
 
                char *text = NULL;
 
686
                const gchar *attendee;
 
687
                gchar *text = NULL;
688
688
 
689
689
                attendee = icalproperty_get_value_as_string_r (prop);
690
690
                if (!attendee)
728
728
 
729
729
static ECalBackendSyncStatus
730
730
create_object (ECalBackendSync *backend, EDataCal *cal,
731
 
               char **calobj, char **uid)
 
731
               gchar **calobj, gchar **uid)
732
732
{
733
733
        /* FIXME : Return some value in uid */
734
734
        ECalBackendExchangeCalendar *cbexc;
736
736
        icalcomponent *icalcomp, *real_icalcomp;
737
737
        icalcomponent_kind kind;
738
738
        icalproperty *icalprop;
739
 
        const char *temp_comp_uid;
740
 
        char *lastmod;
 
739
        const gchar *temp_comp_uid;
 
740
        gchar *lastmod;
741
741
        struct icaltimetype current;
742
 
        char *location = NULL, *ru_header = NULL;
 
742
        gchar *location = NULL, *ru_header = NULL;
743
743
        ECalComponent *comp;
744
 
        char *body_crlf, *msg;
745
 
        char *from, *date;
746
 
        const char *summary;
747
 
        char *attach_body = NULL;
748
 
        char *attach_body_crlf = NULL;
749
 
        char *boundary = NULL;
 
744
        gchar *body_crlf, *msg;
 
745
        gchar *from, *date;
 
746
        const gchar *summary;
 
747
        gchar *attach_body = NULL;
 
748
        gchar *attach_body_crlf = NULL;
 
749
        gchar *boundary = NULL;
750
750
        E2kHTTPStatus http_status;
751
751
        E2kProperties *props = e2k_properties_new ();
752
752
        E2kContext *e2kctx;
791
791
        if (lookup_component (E_CAL_BACKEND_EXCHANGE (cbexc), comp_uid))
792
792
        {
793
793
                icalcomponent_free (icalcomp);
794
 
                return ;
 
794
                return;
795
795
        }
796
796
        #endif
797
797
 
948
948
        return GNOME_Evolution_Calendar_Success;
949
949
}
950
950
 
951
 
#define BUSYSTATUS      0x01
 
951
#define BUSYSTATUS      0x01
952
952
#define INSTTYPE        0x02
953
953
#define ALLDAY          0x04
954
954
#define IMPORTANCE      0x08
958
958
{
959
959
        icalcomponent *icalcomp;
960
960
        icalproperty *icalprop;
961
 
        const char *x_name, *x_val;
 
961
        const gchar *x_name, *x_val;
962
962
        ECalComponentTransparency transp;
963
963
        ECalComponentDateTime dtstart;
964
 
        int *priority;
965
 
        const char *busystatus, *insttype, *allday, *importance;
966
 
        int prop_set = 0;
 
964
        gint *priority;
 
965
        const gchar *busystatus, *insttype, *allday, *importance;
 
966
        gint prop_set = 0;
967
967
        GSList *props = NULL, *l = NULL;
968
968
 
969
969
        e_cal_component_get_transparency (comp, &transp);
992
992
                importance = "1";
993
993
 
994
994
        /* Go through the existing X-MICROSOFT-CDO- properties first */
995
 
        icalcomp = e_cal_component_get_icalcomponent (comp);
 
995
        icalcomp = e_cal_component_get_icalcomponent (comp);
996
996
        icalprop = icalcomponent_get_first_property (icalcomp, ICAL_X_PROPERTY);
997
997
        while (icalprop) {
998
998
                x_name = icalproperty_get_x_name (icalprop);
1063
1063
 
1064
1064
static ECalBackendSyncStatus
1065
1065
modify_object (ECalBackendSync *backend, EDataCal *cal,
1066
 
               const char *calobj, CalObjModType mod,
1067
 
               char **old_object, char **new_object)
 
1066
               const gchar *calobj, CalObjModType mod,
 
1067
               gchar **old_object, gchar **new_object)
1068
1068
{
1069
1069
        ECalBackendSyncStatus status;
1070
1070
 
1077
1077
 
1078
1078
static ECalBackendSyncStatus
1079
1079
modify_object_with_href (ECalBackendSync *backend, EDataCal *cal,
1080
 
               const char *calobj, CalObjModType mod,
1081
 
               char **old_object, char **new_object, const char *href, const char *rid_to_remove)
 
1080
               const gchar *calobj, CalObjModType mod,
 
1081
               gchar **old_object, gchar **new_object, const gchar *href, const gchar *rid_to_remove)
1082
1082
{
1083
1083
        ECalBackendExchangeCalendar *cbexc;
1084
1084
        ECalBackendExchangeComponent *ecomp;
1085
1085
        ECalBackendExchange *cbex;
1086
1086
        icalcomponent *icalcomp, *real_icalcomp, *updated_icalcomp;
1087
1087
        ECalComponent *real_ecomp, *cached_ecomp = NULL, *updated_ecomp;
1088
 
        const char *comp_uid;
1089
 
        char *updated_ecomp_str, *real_comp_str;
1090
 
        char *body_crlf, *msg;
1091
 
        char *attach_body = NULL;
1092
 
        char *attach_body_crlf = NULL;
1093
 
        char *boundary = NULL;
 
1088
        const gchar *comp_uid;
 
1089
        gchar *updated_ecomp_str, *real_comp_str;
 
1090
        gchar *body_crlf, *msg;
 
1091
        gchar *attach_body = NULL;
 
1092
        gchar *attach_body_crlf = NULL;
 
1093
        gchar *boundary = NULL;
1094
1094
        struct icaltimetype last_modified, key_rid;
1095
1095
        icalcomponent_kind kind;
1096
1096
        ECalComponentDateTime dt;
1097
1097
        struct _cb_data *cbdata;
1098
1098
        icalproperty *icalprop;
1099
1099
        E2kHTTPStatus http_status;
1100
 
        char *from, *date;
1101
 
        const char *summary, *new_href;
 
1100
        gchar *from, *date;
 
1101
        const gchar *summary, *new_href;
1102
1102
        gboolean send_options;
1103
1103
        E2kContext *ctx;
1104
1104
        E2kProperties *props = e2k_properties_new ();
1262
1262
                dt.value->hour = dt.value->minute = dt.value->second = 0;
1263
1263
                dt.value->zone = zone;
1264
1264
 
1265
 
                g_free ((char *)dt.tzid);
 
1265
                g_free ((gchar *)dt.tzid);
1266
1266
                dt.tzid = g_strdup (icaltimezone_get_tzid (zone));
1267
1267
                e_cal_component_set_dtstart (real_ecomp, &dt);
1268
1268
                e_cal_component_free_datetime (&dt);
1273
1273
                dt.value->hour = dt.value->minute = dt.value->second = 0;
1274
1274
                dt.value->zone = zone;
1275
1275
 
1276
 
                g_free ((char *)dt.tzid);
 
1276
                g_free ((gchar *)dt.tzid);
1277
1277
                dt.tzid = g_strdup (icaltimezone_get_tzid (zone));
1278
1278
                e_cal_component_set_dtend (real_ecomp, &dt);
1279
1279
        }
1296
1296
                        if (dt.tzid == NULL)
1297
1297
                                from_zone = icaltimezone_get_utc_timezone ();
1298
1298
                        else {
1299
 
                                char *izone = NULL;
 
1299
                                gchar *izone = NULL;
1300
1300
                                get_timezone (backend, cal, dt.tzid, &izone);
1301
1301
                                from_zone = icalcomponent_get_timezone (icalcomponent_new_from_string (izone),
1302
1302
                                                                                        dt.tzid);
1456
1456
                new_href = ecomp->href;
1457
1457
 
1458
1458
        http_status = e2k_context_put (ctx, NULL, new_href, "message/rfc822",
1459
 
                                                msg, strlen (msg), NULL);
 
1459
                                                msg, strlen (msg), NULL);
1460
1460
 
1461
1461
        if ((E2K_HTTP_STATUS_IS_SUCCESSFUL (http_status)) && send_options)
1462
1462
                http_status = e2k_context_proppatch (ctx, NULL, new_href, props, FALSE, NULL);
1470
1470
                if (!remove)
1471
1471
                        *new_object = e_cal_component_get_as_string (real_ecomp);
1472
1472
        } else
1473
 
                status = GNOME_Evolution_Calendar_OtherError;
 
1473
                status = GNOME_Evolution_Calendar_OtherError;
1474
1474
 
1475
1475
        g_free (msg);
1476
1476
        g_object_unref (real_ecomp);
1488
1488
 
1489
1489
static ECalBackendSyncStatus
1490
1490
remove_object (ECalBackendSync *backend, EDataCal *cal,
1491
 
               const char *uid, const char *rid, CalObjModType mod,
1492
 
               char **old_object, char **object)
 
1491
               const gchar *uid, const gchar *rid, CalObjModType mod,
 
1492
               gchar **old_object, gchar **object)
1493
1493
{
1494
1494
        ECalBackendExchangeCalendar *cbexc;
1495
1495
        ECalBackendExchange *cbex;
1497
1497
        E2kHTTPStatus status;
1498
1498
        E2kContext *ctx;
1499
1499
        ECalComponent *comp;
1500
 
        char *calobj, *obj = NULL;
 
1500
        gchar *calobj, *obj = NULL;
1501
1501
        struct icaltimetype time_rid;
1502
1502
        ECalBackendSyncStatus ebs_status;
1503
1503
 
1532
1532
 
1533
1533
        /*TODO How handle multiple detached intances with no master object ?*/
1534
1534
        if (mod == CALOBJ_MOD_THIS && rid && *rid && ecomp->icomp) {
1535
 
                char *new_object = NULL;
 
1535
                gchar *new_object = NULL;
1536
1536
 
1537
1537
                /*remove a single instance of a recurring event and modify */
1538
1538
                time_rid = icaltime_from_string (rid);
1539
1539
                e_cal_util_remove_instances (ecomp->icomp, time_rid, mod);
1540
 
                calobj  = (char *) icalcomponent_as_ical_string_r (ecomp->icomp);
 
1540
                calobj  = (gchar *) icalcomponent_as_ical_string_r (ecomp->icomp);
1541
1541
 
1542
1542
                e_cal_backend_exchange_cache_unlock (cbex);
1543
1543
                ebs_status = modify_object_with_href (backend, cal, calobj, mod, &obj, &new_object, NULL, rid);
1577
1577
 
1578
1578
static ECalBackendSyncStatus
1579
1579
receive_objects (ECalBackendSync *backend, EDataCal *cal,
1580
 
                 const char *calobj)
 
1580
                 const gchar *calobj)
1581
1581
{
1582
1582
        ECalBackendExchangeCalendar *cbexc;
1583
1583
        ECalBackendExchange *cbex;
1626
1626
        icalcomponent_free (icalcomp);
1627
1627
 
1628
1628
        for (l = comps; l; l= l->next) {
1629
 
                const char *uid;
1630
 
                char *icalobj, *rid = NULL;
1631
 
                char *object = NULL;
 
1629
                const gchar *uid;
 
1630
                gchar *icalobj, *rid = NULL;
 
1631
                gchar *object = NULL;
1632
1632
 
1633
1633
                subcomp = l->data;
1634
1634
 
1649
1649
                case ICAL_METHOD_REPLY:
1650
1650
                        e_cal_backend_exchange_cache_lock (cbex);
1651
1651
                        if ((ecomp = get_exchange_comp (E_CAL_BACKEND_EXCHANGE (cbexc), uid)) != NULL ) {
1652
 
                                char *old_object = NULL;
 
1652
                                gchar *old_object = NULL;
1653
1653
 
1654
1654
                                d(printf ("uid : %s : found in the cache\n", uid));
1655
1655
 
1668
1668
                                                                             old_object, NULL);
1669
1669
                                        e_cal_component_free_id (id);
1670
1670
                                } else {
1671
 
                                        char *new_object = NULL;
 
1671
                                        gchar *new_object = NULL;
1672
1672
                                        CalObjModType mod = CALOBJ_MOD_ALL;
1673
1673
 
1674
1674
                                        if (e_cal_util_component_is_instance (subcomp))
1675
1675
                                                mod = CALOBJ_MOD_THIS;
1676
1676
 
1677
 
                                        icalobj = (char *) icalcomponent_as_ical_string_r (subcomp);
 
1677
                                        icalobj = (gchar *) icalcomponent_as_ical_string_r (subcomp);
1678
1678
                                        status = modify_object_with_href (backend, cal, icalobj,
1679
1679
                                                                          mod,
1680
1680
                                                                          &old_object, &new_object, NULL, NULL);
1693
1693
 
1694
1694
                                g_free (old_object);
1695
1695
                        } else if (!check_owner_partstatus_for_declined (backend, subcomp)) {
1696
 
                                char *returned_uid, *object;
 
1696
                                gchar *returned_uid, *object;
1697
1697
                                d(printf ("object : %s .. not found in the cache\n", uid));
1698
 
                                icalobj = (char *) icalcomponent_as_ical_string_r (subcomp);
 
1698
                                icalobj = (gchar *) icalcomponent_as_ical_string_r (subcomp);
1699
1699
                                d(printf ("Create a new object : %s\n", icalobj));
1700
1700
 
1701
1701
                                e_cal_backend_exchange_cache_unlock (cbex);
1720
1720
                        break;
1721
1721
 
1722
1722
                case ICAL_METHOD_CANCEL:
1723
 
                        icalobj = (char *) icalcomponent_as_ical_string_r (subcomp);
 
1723
                        icalobj = (gchar *) icalcomponent_as_ical_string_r (subcomp);
1724
1724
                        if (rid)
1725
1725
                                status = remove_object (backend, cal, uid, rid, CALOBJ_MOD_THIS, &icalobj, &object);
1726
1726
                        else
1767
1767
static ECalBackendExchangeBookingResult
1768
1768
book_resource (ECalBackendExchange *cbex,
1769
1769
               EDataCal *cal,
1770
 
               const char *resource_email,
 
1770
               const gchar *resource_email,
1771
1771
               ECalComponent *comp,
1772
1772
               icalproperty_method method,
1773
1773
               icalparameter *part_param)
1785
1785
        icaltimezone *izone;
1786
1786
        guint32 access = 0;
1787
1787
        time_t tt;
1788
 
        const char *uid, *prop_name = PR_ACCESS;
1789
 
        const char *access_prop = NULL, *meeting_prop = NULL, *cal_uid = NULL;
 
1788
        const gchar *uid, *prop_name = PR_ACCESS;
 
1789
        const gchar *access_prop = NULL, *meeting_prop = NULL, *cal_uid = NULL;
1790
1790
        gboolean bookable;
1791
 
        char *top_uri = NULL, *cal_uri = NULL, *returned_uid = NULL;
1792
 
        char *startz, *endz, *href = NULL, *old_object = NULL, *calobj = NULL, *new_object = NULL;
 
1791
        gchar *top_uri = NULL, *cal_uri = NULL, *returned_uid = NULL;
 
1792
        gchar *startz, *endz, *href = NULL, *old_object = NULL, *calobj = NULL, *new_object = NULL;
1793
1793
        E2kRestriction *rn;
1794
 
        int nresult;
 
1794
        gint nresult;
1795
1795
        ECalBackendExchangeBookingResult retval = E_CAL_BACKEND_EXCHANGE_BOOKING_ERROR;
1796
 
        const char *localfreebusy_path = "NON_IPM_SUBTREE/Freebusy%20Data/LocalFreebusy.EML";
 
1796
        const gchar *localfreebusy_path = "NON_IPM_SUBTREE/Freebusy%20Data/LocalFreebusy.EML";
1797
1797
 
1798
1798
        g_object_ref (comp);
1799
1799
 
1872
1872
        e_cal_backend_exchange_cache_unlock (cbex);
1873
1873
 
1874
1874
        if (method == ICAL_METHOD_CANCEL) {
1875
 
                char *object = NULL;
 
1875
                gchar *object = NULL;
1876
1876
 
1877
1877
                /* g_object_unref (comp); */
1878
1878
                /* If there is nothing to cancel, we're good */
1968
1968
        icalparameter_set_partstat (part_param, ICAL_PARTSTAT_ACCEPTED);
1969
1969
 
1970
1970
        e_cal_component_commit_sequence (comp);
1971
 
        calobj = (char *) e_cal_component_get_as_string (comp);
 
1971
        calobj = (gchar *) e_cal_component_get_as_string (comp);
1972
1972
 
1973
1973
        /* status = e_cal_component_update (comp, method, FALSE  ); */
1974
1974
        if (ecomp) {
2011
2011
 
2012
2012
static ECalBackendSyncStatus
2013
2013
send_objects (ECalBackendSync *backend, EDataCal *cal,
2014
 
              const char *calobj,
2015
 
              GList **users, char **modified_calobj)
 
2014
              const gchar *calobj,
 
2015
              GList **users, gchar **modified_calobj)
2016
2016
{
2017
2017
        ECalBackendExchange *cbex = (ECalBackendExchange *) backend;
2018
2018
        ECalBackendSyncStatus retval = GNOME_Evolution_Calendar_Success;
2071
2071
        {
2072
2072
                icalvalue *value;
2073
2073
                icalparameter *param;
2074
 
                const char *attendee;
 
2074
                const gchar *attendee;
2075
2075
 
2076
2076
                param = icalproperty_get_first_parameter (prop, ICAL_CUTYPE_PARAMETER);
2077
2077
                if (!param)
2104
2104
                result = book_resource (cbex, cal, attendee + 7, comp, method, param);
2105
2105
                switch (result) {
2106
2106
                case E_CAL_BACKEND_EXCHANGE_BOOKING_OK:
2107
 
                        *users = g_list_append (*users, g_strdup (attendee)) ;
 
2107
                        *users = g_list_append (*users, g_strdup (attendee));
2108
2108
                        break;
2109
2109
 
2110
2110
                case E_CAL_BACKEND_EXCHANGE_BOOKING_BUSY:
2179
2179
}
2180
2180
 
2181
2181
static void
2182
 
set_freebusy_info (icalcomponent *vfb, const char *data, time_t start)
 
2182
set_freebusy_info (icalcomponent *vfb, const gchar *data, time_t start)
2183
2183
{
2184
 
        const char *span_start, *span_end;
 
2184
        const gchar *span_start, *span_end;
2185
2185
        E2kBusyStatus busy;
2186
2186
        icalproperty *prop;
2187
2187
        time_t end;
2203
2203
 
2204
2204
static ECalBackendSyncStatus
2205
2205
discard_alarm (ECalBackendSync *backend, EDataCal *cal,
2206
 
                const char *uid, const char *auid)
 
2206
                const gchar *uid, const gchar *auid)
2207
2207
{
2208
2208
        ECalBackendSyncStatus result = GNOME_Evolution_Calendar_Success;
2209
2209
        ECalBackendExchange *cbex = NULL;
2210
2210
        ECalBackendExchangeComponent *ecbexcomp;
2211
2211
        ECalComponent *ecomp;
2212
 
        char *ecomp_str;
 
2212
        gchar *ecomp_str;
2213
2213
        icalcomponent *icalcomp = NULL;
2214
2214
 
2215
2215
        g_return_val_if_fail (E_IS_CAL_BACKEND_EXCHANGE_CALENDAR (backend),
2261
2261
               GList **freebusy)
2262
2262
{
2263
2263
        ECalBackendExchange *cbex = E_CAL_BACKEND_EXCHANGE (backend);
2264
 
        char *start_str, *end_str;
 
2264
        gchar *start_str, *end_str;
2265
2265
        GList *l;
2266
2266
        GString *uri;
2267
2267
        SoupBuffer *response;
2293
2293
        g_string_append (uri, "&interval=30");
2294
2294
        for (l = users; l; l = l->next) {
2295
2295
                g_string_append (uri, "&u=SMTP:");
2296
 
                g_string_append (uri, (char *) l->data);
 
2296
                g_string_append (uri, (gchar *) l->data);
2297
2297
        }
2298
2298
        g_free (start_str);
2299
2299
        g_free (end_str);
2323
2323
                icalcomponent *vfb;
2324
2324
                icalproperty *organizer;
2325
2325
                xmlNode *node, *fbdata;
2326
 
                char *org_uri, *calobj;
2327
 
                char *content;
 
2326
                gchar *org_uri, *calobj;
 
2327
                gchar *content;
2328
2328
 
2329
2329
                fbdata = e2k_xml_find_in (item, item, "fbdata");
2330
2330
                if (!fbdata || !fbdata->children || !fbdata->children->content)
2341
2341
                if (node && node->children && node->children->content) {
2342
2342
                        icalparameter *cn;
2343
2343
 
2344
 
                        content = (char *) node->children->content;
 
2344
                        content = (gchar *) node->children->content;
2345
2345
                        cn = icalparameter_new_cn (content);
2346
2346
                        icalproperty_add_parameter (organizer, cn);
2347
2347
                }
2351
2351
                icalcomponent_set_dtend (vfb, icaltime_from_timet_with_zone (end, 0, utc));
2352
2352
                icalcomponent_add_property (vfb, organizer);
2353
2353
 
2354
 
                content = (char *) fbdata->children->content;
 
2354
                content = (gchar *) fbdata->children->content;
2355
2355
                set_freebusy_info (vfb, content, start);
2356
2356
 
2357
2357
                calobj = icalcomponent_as_ical_string_r (vfb);
2407
2407
        sync_class->remove_object_sync = remove_object;
2408
2408
        sync_class->receive_objects_sync = receive_objects;
2409
2409
        sync_class->send_objects_sync = send_objects;
2410
 
        sync_class->get_freebusy_sync = get_free_busy;
 
2410
        sync_class->get_freebusy_sync = get_free_busy;
2411
2411
        sync_class->discard_alarm_sync = discard_alarm;
2412
2412
 
2413
2413
        object_class->dispose = dispose;