From 3a76b6dfce07a5e8044e367cedb8f9c01b4a88b2 Mon Sep 17 00:00:00 2001 From: Daniel Kolesa Date: Thu, 17 Jun 2021 14:35:27 +0200 Subject: remove deprecated contacts service --- HACKING | 2 - docs/reference/gdata-docs.xml | 8 - docs/reference/gdata-sections.txt.in | 204 -- gdata/GData-0.0.metadata | 4 - gdata/gdata-core.symbols | 127 - gdata/gdata-goa-authorizer.c | 7 - gdata/gdata.h | 6 - gdata/services/contacts/gdata-contacts-contact.c | 3611 -------------------- gdata/services/contacts/gdata-contacts-contact.h | 402 --- gdata/services/contacts/gdata-contacts-group.c | 612 ---- gdata/services/contacts/gdata-contacts-group.h | 126 - gdata/services/contacts/gdata-contacts-query.c | 505 --- gdata/services/contacts/gdata-contacts-query.h | 96 - gdata/services/contacts/gdata-contacts-service.c | 589 ---- gdata/services/contacts/gdata-contacts-service.h | 121 - gdata/services/contacts/meson.build | 20 - gdata/services/meson.build | 1 - gdata/symbol.map | 127 - gdata/tests/contacts.c | 2705 --------------- gdata/tests/meson.build | 1 - gdata/tests/traces/contacts/authentication | 35 - gdata/tests/traces/contacts/authentication-async | 27 - .../contacts/authentication-async-cancellation | 27 - gdata/tests/traces/contacts/batch | 242 -- gdata/tests/traces/contacts/batch-async | 57 - .../tests/traces/contacts/batch-async-cancellation | 0 gdata/tests/traces/contacts/contact-insert | 90 - gdata/tests/traces/contacts/contact-update | 63 - gdata/tests/traces/contacts/global-authentication | 35 - gdata/tests/traces/contacts/group-insert | 45 - gdata/tests/traces/contacts/group_insert-async | 45 - .../contacts/group_insert-async-cancellation | 45 - gdata/tests/traces/contacts/photo-add | 33 - gdata/tests/traces/contacts/photo-delete | 27 - gdata/tests/traces/contacts/photo-get | 29 - gdata/tests/traces/contacts/photo_add-async | 33 - .../traces/contacts/photo_add-async-cancellation | 31 - gdata/tests/traces/contacts/photo_delete-async | 27 - .../contacts/photo_delete-async-cancellation | 34 - gdata/tests/traces/contacts/photo_get-async | 29 - .../traces/contacts/photo_get-async-cancellation | 29 - gdata/tests/traces/contacts/query-all-contacts | 373 -- .../query-all-contacts-async-progress-closure | 373 -- gdata/tests/traces/contacts/query-all-groups | 166 - .../query-all-groups-async-progress-closure | 166 - .../tests/traces/contacts/query_all_contacts-async | 373 -- .../contacts/query_all_contacts-async-cancellation | 373 -- gdata/tests/traces/contacts/query_all_groups-async | 166 - .../contacts/query_all_groups-async-cancellation | 166 - gdata/tests/traces/contacts/setup-batch-async | 49 - .../tests/traces/contacts/setup-query-all-contacts | 135 - gdata/tests/traces/contacts/setup-query-all-groups | 132 - gdata/tests/traces/contacts/setup-temp-contact | 45 - .../traces/contacts/setup-temp-contact-with-photo | 75 - gdata/tests/traces/contacts/teardown-batch-async | 30 - gdata/tests/traces/contacts/teardown-insert | 30 - gdata/tests/traces/contacts/teardown-insert-group | 30 - .../traces/contacts/teardown-query-all-contacts | 90 - .../traces/contacts/teardown-query-all-groups | 90 - gdata/tests/traces/contacts/teardown-temp-contact | 72 - po/POTFILES.in | 1 - 61 files changed, 13192 deletions(-) delete mode 100644 gdata/services/contacts/gdata-contacts-contact.c delete mode 100644 gdata/services/contacts/gdata-contacts-contact.h delete mode 100644 gdata/services/contacts/gdata-contacts-group.c delete mode 100644 gdata/services/contacts/gdata-contacts-group.h delete mode 100644 gdata/services/contacts/gdata-contacts-query.c delete mode 100644 gdata/services/contacts/gdata-contacts-query.h delete mode 100644 gdata/services/contacts/gdata-contacts-service.c delete mode 100644 gdata/services/contacts/gdata-contacts-service.h delete mode 100644 gdata/services/contacts/meson.build delete mode 100644 gdata/tests/contacts.c delete mode 100644 gdata/tests/traces/contacts/authentication delete mode 100644 gdata/tests/traces/contacts/authentication-async delete mode 100644 gdata/tests/traces/contacts/authentication-async-cancellation delete mode 100644 gdata/tests/traces/contacts/batch delete mode 100644 gdata/tests/traces/contacts/batch-async delete mode 100644 gdata/tests/traces/contacts/batch-async-cancellation delete mode 100644 gdata/tests/traces/contacts/contact-insert delete mode 100644 gdata/tests/traces/contacts/contact-update delete mode 100644 gdata/tests/traces/contacts/global-authentication delete mode 100644 gdata/tests/traces/contacts/group-insert delete mode 100644 gdata/tests/traces/contacts/group_insert-async delete mode 100644 gdata/tests/traces/contacts/group_insert-async-cancellation delete mode 100644 gdata/tests/traces/contacts/photo-add delete mode 100644 gdata/tests/traces/contacts/photo-delete delete mode 100644 gdata/tests/traces/contacts/photo-get delete mode 100644 gdata/tests/traces/contacts/photo_add-async delete mode 100644 gdata/tests/traces/contacts/photo_add-async-cancellation delete mode 100644 gdata/tests/traces/contacts/photo_delete-async delete mode 100644 gdata/tests/traces/contacts/photo_delete-async-cancellation delete mode 100644 gdata/tests/traces/contacts/photo_get-async delete mode 100644 gdata/tests/traces/contacts/photo_get-async-cancellation delete mode 100644 gdata/tests/traces/contacts/query-all-contacts delete mode 100644 gdata/tests/traces/contacts/query-all-contacts-async-progress-closure delete mode 100644 gdata/tests/traces/contacts/query-all-groups delete mode 100644 gdata/tests/traces/contacts/query-all-groups-async-progress-closure delete mode 100644 gdata/tests/traces/contacts/query_all_contacts-async delete mode 100644 gdata/tests/traces/contacts/query_all_contacts-async-cancellation delete mode 100644 gdata/tests/traces/contacts/query_all_groups-async delete mode 100644 gdata/tests/traces/contacts/query_all_groups-async-cancellation delete mode 100644 gdata/tests/traces/contacts/setup-batch-async delete mode 100644 gdata/tests/traces/contacts/setup-query-all-contacts delete mode 100644 gdata/tests/traces/contacts/setup-query-all-groups delete mode 100644 gdata/tests/traces/contacts/setup-temp-contact delete mode 100644 gdata/tests/traces/contacts/setup-temp-contact-with-photo delete mode 100644 gdata/tests/traces/contacts/teardown-batch-async delete mode 100644 gdata/tests/traces/contacts/teardown-insert delete mode 100644 gdata/tests/traces/contacts/teardown-insert-group delete mode 100644 gdata/tests/traces/contacts/teardown-query-all-contacts delete mode 100644 gdata/tests/traces/contacts/teardown-query-all-groups delete mode 100644 gdata/tests/traces/contacts/teardown-temp-contact diff --git a/HACKING b/HACKING index 32917c7b..19cb326a 100644 --- a/HACKING +++ b/HACKING @@ -194,8 +194,6 @@ the following format "tag: Short explanation". The following tags are valid: - calendar: for the Google Calendar code in gdata/services/calendar. - - contacts: for the Google Contacts code in gdata/services/contacts. - - documents: for the Google Documents code in gdata/services/documents. - picasaweb: for the PicasaWeb code in gdata/services/picasaweb. diff --git a/docs/reference/gdata-docs.xml b/docs/reference/gdata-docs.xml index 7d25b3f2..653e05d3 100644 --- a/docs/reference/gdata-docs.xml +++ b/docs/reference/gdata-docs.xml @@ -144,14 +144,6 @@ - - Google Contacts API - - - - - - Google Documents/Drive API diff --git a/docs/reference/gdata-sections.txt.in b/docs/reference/gdata-sections.txt.in index 99df4afd..c5deabf0 100644 --- a/docs/reference/gdata-sections.txt.in +++ b/docs/reference/gdata-sections.txt.in @@ -280,182 +280,6 @@ gdata_youtube_video_get_type GDataYouTubeVideoPrivate -
-gdata-contacts-service -GDataContactsService -GDataContactsService -GDataContactsServiceClass -gdata_contacts_service_new -gdata_contacts_service_get_primary_authorization_domain -gdata_contacts_service_query_contacts -gdata_contacts_service_query_contacts_async -gdata_contacts_service_insert_contact -gdata_contacts_service_insert_contact_async -gdata_contacts_service_query_groups -gdata_contacts_service_query_groups_async -gdata_contacts_service_insert_group -gdata_contacts_service_insert_group_async - -gdata_contacts_service_get_type -GDATA_CONTACTS_SERVICE -GDATA_CONTACTS_SERVICE_CLASS -GDATA_CONTACTS_SERVICE_GET_CLASS -GDATA_IS_CONTACTS_SERVICE -GDATA_IS_CONTACTS_SERVICE_CLASS -GDATA_TYPE_CONTACTS_SERVICE - -GDataContactsServicePrivate -
- -
-gdata-contacts-query -GDataContactsQuery -GDataContactsQuery -GDataContactsQueryClass -gdata_contacts_query_new -gdata_contacts_query_new_with_limits -gdata_contacts_query_get_order_by -gdata_contacts_query_set_order_by -gdata_contacts_query_get_sort_order -gdata_contacts_query_set_sort_order -gdata_contacts_query_show_deleted -gdata_contacts_query_set_show_deleted -gdata_contacts_query_get_group -gdata_contacts_query_set_group - -gdata_contacts_query_get_type -GDATA_CONTACTS_QUERY -GDATA_CONTACTS_QUERY_CLASS -GDATA_CONTACTS_QUERY_GET_CLASS -GDATA_IS_CONTACTS_QUERY -GDATA_IS_CONTACTS_QUERY_CLASS -GDATA_TYPE_CONTACTS_QUERY - -GDataContactsQueryPrivate -
- -
-gdata-contacts-contact -GDataContactsContact -GDATA_CONTACTS_GENDER_MALE -GDATA_CONTACTS_GENDER_FEMALE -GDATA_CONTACTS_PRIORITY_LOW -GDATA_CONTACTS_PRIORITY_NORMAL -GDATA_CONTACTS_PRIORITY_HIGH -GDATA_CONTACTS_SENSITIVITY_CONFIDENTIAL -GDATA_CONTACTS_SENSITIVITY_NORMAL -GDATA_CONTACTS_SENSITIVITY_PERSONAL -GDATA_CONTACTS_SENSITIVITY_PRIVATE -GDataContactsContact -GDataContactsContactClass -gdata_contacts_contact_new -gdata_contacts_contact_get_name -gdata_contacts_contact_set_name -gdata_contacts_contact_get_short_name -gdata_contacts_contact_set_short_name -gdata_contacts_contact_get_initials -gdata_contacts_contact_set_initials -gdata_contacts_contact_get_maiden_name -gdata_contacts_contact_set_maiden_name -gdata_contacts_contact_get_nickname -gdata_contacts_contact_set_nickname -gdata_contacts_contact_get_file_as -gdata_contacts_contact_set_file_as -gdata_contacts_contact_get_birthday -gdata_contacts_contact_set_birthday -gdata_contacts_contact_get_gender -gdata_contacts_contact_set_gender -gdata_contacts_contact_get_mileage -gdata_contacts_contact_set_mileage -gdata_contacts_contact_get_occupation -gdata_contacts_contact_set_occupation -gdata_contacts_contact_get_subject -gdata_contacts_contact_set_subject -gdata_contacts_contact_get_priority -gdata_contacts_contact_set_priority -gdata_contacts_contact_get_sensitivity -gdata_contacts_contact_set_sensitivity -gdata_contacts_contact_get_directory_server -gdata_contacts_contact_set_directory_server -gdata_contacts_contact_get_billing_information -gdata_contacts_contact_set_billing_information -gdata_contacts_contact_get_email_addresses -gdata_contacts_contact_get_primary_email_address -gdata_contacts_contact_add_email_address -gdata_contacts_contact_remove_all_email_addresses -gdata_contacts_contact_get_im_addresses -gdata_contacts_contact_get_primary_im_address -gdata_contacts_contact_add_im_address -gdata_contacts_contact_remove_all_im_addresses -gdata_contacts_contact_get_postal_addresses -gdata_contacts_contact_get_primary_postal_address -gdata_contacts_contact_add_postal_address -gdata_contacts_contact_remove_all_postal_addresses -gdata_contacts_contact_get_phone_numbers -gdata_contacts_contact_get_primary_phone_number -gdata_contacts_contact_add_phone_number -gdata_contacts_contact_remove_all_phone_numbers -gdata_contacts_contact_get_organizations -gdata_contacts_contact_get_primary_organization -gdata_contacts_contact_add_organization -gdata_contacts_contact_remove_all_organizations -gdata_contacts_contact_add_jot -gdata_contacts_contact_get_jots -gdata_contacts_contact_remove_all_jots -gdata_contacts_contact_add_relation -gdata_contacts_contact_get_relations -gdata_contacts_contact_remove_all_relations -gdata_contacts_contact_add_website -gdata_contacts_contact_get_websites -gdata_contacts_contact_get_primary_website -gdata_contacts_contact_remove_all_websites -gdata_contacts_contact_add_event -gdata_contacts_contact_get_events -gdata_contacts_contact_remove_all_events -gdata_contacts_contact_add_calendar -gdata_contacts_contact_get_calendars -gdata_contacts_contact_get_primary_calendar -gdata_contacts_contact_remove_all_calendars -gdata_contacts_contact_add_external_id -gdata_contacts_contact_get_external_ids -gdata_contacts_contact_remove_all_external_ids -gdata_contacts_contact_add_hobby -gdata_contacts_contact_get_hobbies -gdata_contacts_contact_remove_all_hobbies -gdata_contacts_contact_add_language -gdata_contacts_contact_get_languages -gdata_contacts_contact_remove_all_languages -gdata_contacts_contact_get_groups -gdata_contacts_contact_add_group -gdata_contacts_contact_remove_group -gdata_contacts_contact_is_group_deleted -gdata_contacts_contact_get_extended_property -gdata_contacts_contact_get_extended_properties -gdata_contacts_contact_set_extended_property -gdata_contacts_contact_get_user_defined_field -gdata_contacts_contact_get_user_defined_fields -gdata_contacts_contact_set_user_defined_field -gdata_contacts_contact_get_edited -gdata_contacts_contact_is_deleted -gdata_contacts_contact_get_photo_etag -gdata_contacts_contact_get_photo -gdata_contacts_contact_get_photo_async -gdata_contacts_contact_get_photo_finish -gdata_contacts_contact_set_photo -gdata_contacts_contact_set_photo_async -gdata_contacts_contact_set_photo_finish - -gdata_contacts_contact_get_type -GDATA_CONTACTS_CONTACT -GDATA_CONTACTS_CONTACT_CLASS -GDATA_CONTACTS_CONTACT_GET_CLASS -GDATA_IS_CONTACTS_CONTACT -GDATA_IS_CONTACTS_CONTACT_CLASS -GDATA_TYPE_CONTACTS_CONTACT - -GDataContactsContactPrivate -
-
gdata-calendar-service GDataCalendarService @@ -2277,34 +2101,6 @@ GDATA_IS_BATCHABLE GDATA_TYPE_BATCHABLE
-
-gdata-contacts-group -GDataContactsGroup -GDATA_CONTACTS_GROUP_CONTACTS -GDATA_CONTACTS_GROUP_FRIENDS -GDATA_CONTACTS_GROUP_FAMILY -GDATA_CONTACTS_GROUP_COWORKERS -GDataContactsGroup -GDataContactsGroupClass -gdata_contacts_group_new -gdata_contacts_group_get_edited -gdata_contacts_group_is_deleted -gdata_contacts_group_get_system_group_id -gdata_contacts_group_get_extended_property -gdata_contacts_group_get_extended_properties -gdata_contacts_group_set_extended_property - -GDATA_CONTACTS_GROUP -GDATA_IS_CONTACTS_GROUP -GDATA_TYPE_CONTACTS_GROUP -gdata_contacts_group_get_type -GDATA_CONTACTS_GROUP_GET_CLASS -GDATA_CONTACTS_GROUP_CLASS -GDATA_IS_CONTACTS_GROUP_CLASS - -GDataContactsGroupPrivate -
-
gdata-authorizer GDataAuthorizer diff --git a/gdata/GData-0.0.metadata b/gdata/GData-0.0.metadata index 9b5009a4..72457859 100644 --- a/gdata/GData-0.0.metadata +++ b/gdata/GData-0.0.metadata @@ -6,7 +6,3 @@ Query.get_query_uri#method skip DOCUMENTS_PRESENTATION_* name="DOCUMENTS_PRESENTATION_(.+)" parent="GData.DocumentsPresentationFormat" DOCUMENTS_TEXT_* name="DOCUMENTS_TEXT_(.+)" parent="GData.DocumentsTextFormat" DOCUMENTS_SPREADSHEET_* name="DOCUMENTS_SPREADSHEET_(.+)" parent="GData.DocumentsSpreadsheetFormat" -CONTACTS_GENDER_* name="CONTACTS_GENDER_(.+)" parent="GData.ContactsGender" -CONTACTS_GROUP_* name="CONTACTS_GROUP_(.+)" parent="GData.ContactsGroupType" -CONTACTS_PRIORITY_* name="CONTACTS_PRIORITY_(.+)" parent="GData.ContactsPriority" -CONTACTS_SENSITIVITY_* name="CONTACTS_SENSITIVITY_(.+)" parent="GData.ContactsSensitivity" diff --git a/gdata/gdata-core.symbols b/gdata/gdata-core.symbols index 5581495f..03a8c0b5 100644 --- a/gdata/gdata-core.symbols +++ b/gdata/gdata-core.symbols @@ -238,59 +238,6 @@ gdata_media_expression_get_type gdata_media_medium_get_type gdata_parser_error_get_type gdata_parser_error_quark -gdata_contacts_service_get_type -gdata_contacts_service_new -gdata_contacts_service_query_contacts -gdata_contacts_service_query_contacts_async -gdata_contacts_service_insert_contact -gdata_contacts_service_insert_contact_async -gdata_contacts_query_get_type -gdata_contacts_query_new -gdata_contacts_query_new_with_limits -gdata_contacts_query_get_order_by -gdata_contacts_query_set_order_by -gdata_contacts_query_show_deleted -gdata_contacts_query_set_show_deleted -gdata_contacts_query_get_sort_order -gdata_contacts_query_set_sort_order -gdata_contacts_query_get_group -gdata_contacts_query_set_group -gdata_contacts_contact_get_type -gdata_contacts_contact_new -gdata_contacts_contact_get_edited -gdata_contacts_contact_get_name -gdata_contacts_contact_set_name -gdata_contacts_contact_add_email_address -gdata_contacts_contact_get_email_addresses -gdata_contacts_contact_get_primary_email_address -gdata_contacts_contact_remove_all_email_addresses -gdata_contacts_contact_add_im_address -gdata_contacts_contact_get_im_addresses -gdata_contacts_contact_get_primary_im_address -gdata_contacts_contact_remove_all_im_addresses -gdata_contacts_contact_add_phone_number -gdata_contacts_contact_get_phone_numbers -gdata_contacts_contact_get_primary_phone_number -gdata_contacts_contact_remove_all_phone_numbers -gdata_contacts_contact_add_postal_address -gdata_contacts_contact_get_postal_addresses -gdata_contacts_contact_get_primary_postal_address -gdata_contacts_contact_remove_all_postal_addresses -gdata_contacts_contact_add_organization -gdata_contacts_contact_get_organizations -gdata_contacts_contact_get_primary_organization -gdata_contacts_contact_remove_all_organizations -gdata_contacts_contact_get_extended_property -gdata_contacts_contact_get_extended_properties -gdata_contacts_contact_set_extended_property -gdata_contacts_contact_add_group -gdata_contacts_contact_remove_group -gdata_contacts_contact_is_group_deleted -gdata_contacts_contact_get_groups -gdata_contacts_contact_is_deleted -gdata_contacts_contact_get_photo_etag -gdata_contacts_contact_get_photo -gdata_contacts_contact_set_photo gdata_access_handler_get_type gdata_access_handler_get_rules gdata_access_handler_get_rules_async @@ -698,13 +645,6 @@ gdata_gcontact_jot_get_content gdata_gcontact_jot_set_content gdata_gcontact_jot_get_relation_type gdata_gcontact_jot_set_relation_type -gdata_contacts_contact_add_jot -gdata_contacts_contact_get_jots -gdata_contacts_contact_remove_all_jots -gdata_contacts_contact_get_nickname -gdata_contacts_contact_set_nickname -gdata_contacts_contact_get_birthday -gdata_contacts_contact_set_birthday gdata_gcontact_relation_get_type gdata_gcontact_relation_new gdata_gcontact_relation_get_name @@ -713,9 +653,6 @@ gdata_gcontact_relation_get_relation_type gdata_gcontact_relation_set_relation_type gdata_gcontact_relation_get_label gdata_gcontact_relation_set_label -gdata_contacts_contact_add_relation -gdata_contacts_contact_get_relations -gdata_contacts_contact_remove_all_relations gdata_gcontact_website_get_type gdata_gcontact_website_new gdata_gcontact_website_get_uri @@ -726,10 +663,6 @@ gdata_gcontact_website_get_label gdata_gcontact_website_set_label gdata_gcontact_website_is_primary gdata_gcontact_website_set_is_primary -gdata_contacts_contact_add_website -gdata_contacts_contact_get_websites -gdata_contacts_contact_get_primary_website -gdata_contacts_contact_remove_all_websites gdata_gcontact_event_get_type gdata_gcontact_event_new gdata_gcontact_event_get_date @@ -738,9 +671,6 @@ gdata_gcontact_event_get_relation_type gdata_gcontact_event_set_relation_type gdata_gcontact_event_get_label gdata_gcontact_event_set_label -gdata_contacts_contact_add_event -gdata_contacts_contact_get_events -gdata_contacts_contact_remove_all_events gdata_gcontact_calendar_get_type gdata_gcontact_calendar_new gdata_gcontact_calendar_get_uri @@ -751,35 +681,6 @@ gdata_gcontact_calendar_get_label gdata_gcontact_calendar_set_label gdata_gcontact_calendar_is_primary gdata_gcontact_calendar_set_is_primary -gdata_contacts_contact_add_calendar -gdata_contacts_contact_get_calendars -gdata_contacts_contact_get_primary_calendar -gdata_contacts_contact_remove_all_calendars -gdata_contacts_contact_get_directory_server -gdata_contacts_contact_set_directory_server -gdata_contacts_contact_get_gender -gdata_contacts_contact_set_gender -gdata_contacts_contact_get_initials -gdata_contacts_contact_set_initials -gdata_contacts_contact_get_maiden_name -gdata_contacts_contact_set_maiden_name -gdata_contacts_contact_get_mileage -gdata_contacts_contact_set_mileage -gdata_contacts_contact_get_occupation -gdata_contacts_contact_set_occupation -gdata_contacts_contact_get_priority -gdata_contacts_contact_set_priority -gdata_contacts_contact_get_sensitivity -gdata_contacts_contact_set_sensitivity -gdata_contacts_contact_get_short_name -gdata_contacts_contact_set_short_name -gdata_contacts_contact_get_subject -gdata_contacts_contact_set_subject -gdata_contacts_contact_get_billing_information -gdata_contacts_contact_set_billing_information -gdata_contacts_contact_get_user_defined_field -gdata_contacts_contact_get_user_defined_fields -gdata_contacts_contact_set_user_defined_field gdata_gcontact_external_id_get_type gdata_gcontact_external_id_new gdata_gcontact_external_id_get_value @@ -788,21 +689,12 @@ gdata_gcontact_external_id_get_relation_type gdata_gcontact_external_id_set_relation_type gdata_gcontact_external_id_get_label gdata_gcontact_external_id_set_label -gdata_contacts_contact_add_external_id -gdata_contacts_contact_get_external_ids -gdata_contacts_contact_remove_all_external_ids -gdata_contacts_contact_add_hobby -gdata_contacts_contact_get_hobbies -gdata_contacts_contact_remove_all_hobbies gdata_gcontact_language_get_type gdata_gcontact_language_new gdata_gcontact_language_get_code gdata_gcontact_language_set_code gdata_gcontact_language_get_label gdata_gcontact_language_set_label -gdata_contacts_contact_add_language -gdata_contacts_contact_get_languages -gdata_contacts_contact_remove_all_languages gdata_service_get_timeout gdata_service_set_timeout gdata_service_get_locale @@ -836,18 +728,6 @@ gdata_upload_stream_get_method gdata_documents_document_get_type gdata_documents_document_download gdata_documents_document_get_download_uri -gdata_contacts_group_get_type -gdata_contacts_group_new -gdata_contacts_group_get_edited -gdata_contacts_group_is_deleted -gdata_contacts_group_get_system_group_id -gdata_contacts_group_get_extended_property -gdata_contacts_group_get_extended_properties -gdata_contacts_group_set_extended_property -gdata_contacts_service_query_groups -gdata_contacts_service_query_groups_async -gdata_contacts_service_insert_group -gdata_contacts_service_insert_group_async gdata_picasaweb_service_insert_album_async gdata_picasaweb_service_query_files_async gdata_documents_service_finish_upload @@ -863,10 +743,6 @@ gdata_youtube_service_upload_video gdata_youtube_service_finish_video_upload gdata_calendar_service_query_events_async gdata_calendar_service_insert_calendar_event_async -gdata_contacts_contact_get_photo_async -gdata_contacts_contact_get_photo_finish -gdata_contacts_contact_set_photo_async -gdata_contacts_contact_set_photo_finish gdata_youtube_video_get_coordinates gdata_youtube_video_set_coordinates gdata_upload_stream_get_cancellable @@ -903,7 +779,6 @@ gdata_client_login_authorizer_error_get_type gdata_download_stream_get_authorization_domain gdata_upload_stream_get_authorization_domain gdata_batch_operation_get_authorization_domain -gdata_contacts_service_get_primary_authorization_domain gdata_calendar_service_get_primary_authorization_domain gdata_documents_service_get_primary_authorization_domain gdata_documents_service_get_spreadsheet_authorization_domain @@ -937,8 +812,6 @@ gdata_youtube_video_get_media_rating gdata_documents_entry_get_resource_id gdata_youtube_query_get_license gdata_youtube_query_set_license -gdata_contacts_contact_get_file_as -gdata_contacts_contact_set_file_as gdata_upload_stream_new_resumable gdata_upload_stream_get_content_length gdata_documents_service_upload_document_resumable diff --git a/gdata/gdata-goa-authorizer.c b/gdata/gdata-goa-authorizer.c index b7ae12a0..e71f6145 100644 --- a/gdata/gdata-goa-authorizer.c +++ b/gdata/gdata-goa-authorizer.c @@ -70,7 +70,6 @@ #include "gdata-service.h" #include "services/calendar/gdata-calendar-service.h" -#include "services/contacts/gdata-contacts-service.h" #include "services/documents/gdata-documents-service.h" #include "services/picasaweb/gdata-picasaweb-service.h" @@ -181,12 +180,6 @@ gdata_goa_authorizer_set_goa_object (GDataGoaAuthorizer *self, GoaObject *goa_ob add_authorization_domains (self, GDATA_TYPE_CALENDAR_SERVICE); } - G_GNUC_BEGIN_IGNORE_DEPRECATIONS - if (goa_object_peek_contacts (goa_object) != NULL) { - add_authorization_domains (self, GDATA_TYPE_CONTACTS_SERVICE); - } - G_GNUC_END_IGNORE_DEPRECATIONS - if (goa_object_peek_documents (goa_object) != NULL || goa_object_peek_files (goa_object) != NULL) { add_authorization_domains (self, GDATA_TYPE_DOCUMENTS_SERVICE); } diff --git a/gdata/gdata.h b/gdata/gdata.h index b285e806..c39bf871 100644 --- a/gdata/gdata.h +++ b/gdata/gdata.h @@ -118,12 +118,6 @@ #include #include -/* Google Contacts */ -#include -#include -#include -#include - /* Google Documents*/ #include #include diff --git a/gdata/services/contacts/gdata-contacts-contact.c b/gdata/services/contacts/gdata-contacts-contact.c deleted file mode 100644 index 43a773c1..00000000 --- a/gdata/services/contacts/gdata-contacts-contact.c +++ /dev/null @@ -1,3611 +0,0 @@ -/* -*- Mode: C; indent-tabs-mode: t; c-basic-offset: 8; tab-width: 8 -*- */ -/* - * GData Client - * Copyright (C) Philip Withnall 2009, 2010, 2011 - * - * GData Client is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2.1 of the License, or (at your option) any later version. - * - * GData Client is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with GData Client. If not, see . - */ - -/** - * SECTION:gdata-contacts-contact - * @short_description: GData Contacts contact object - * @stability: Stable - * @include: gdata/services/contacts/gdata-contacts-contact.h - * - * #GDataContactsContact is a subclass of #GDataEntry to represent a contact from a Google address book. - * - * For more details of Google Contacts' GData API, see the - * online documentation. - * - * In addition to all the standard properties available for a contact, #GDataContactsContact supports two kinds of additional property: extended - * properties and user-defined fields. Extended properties, set with gdata_contacts_contact_set_extended_property() and retrieved with - * gdata_contacts_contact_get_extended_property(), are provided as a method of storing client-specific data which shouldn't be seen or be editable - * by the user, such as IDs and cache times. User-defined fields, set with gdata_contacts_contact_set_user_defined_field() and retrieved with - * gdata_contacts_contact_get_user_defined_field(), store fields defined by the user, and editable by them in the interface (both the interface of - * the appliation using libgdata, and the Google Contacts web interface). - * - * - * Getting a Contact's Photo - * - * GDataContactsService *service; - * GDataContactsContact *contact; - * guint8 *data; - * gchar *content_type = NULL; - * gsize length = 0; - * GError *error = NULL; - * - * /* Create a service and return the contact whose photo we're getting. */ - * service = create_contacts_service (); - * contact = query_user_for_contact (service); - * - * /* Get the photo. This should almost always be done asynchronously. */ - * data = gdata_contacts_contact_get_photo (contact, service, &length, &content_type, NULL, &error); - * - * g_object_unref (contact); - * g_object_unref (service); - * - * if (error != NULL) { - * g_error ("Error getting a contact's photo: %s", error->message); - * g_error_free (error); - * return; - * } - * - * /* Do something with the photo, stored in data, length and content_type. */ - * - * g_free (content_type); - * g_free (data); - * - * - * - * - * Setting a Contact's Photo - * - * GDataContactsService *service; - * GDataContactsContact *contact; - * guint8 *data; - * gchar *content_type = NULL; - * gsize length = 0; - * GError *error = NULL; - * - * /* Create a service and return the contact whose photo we're getting, as well as the details of the new photo. */ - * service = create_contacts_service (); - * contact = query_user_for_contact (service); - * data = query_user_for_new_photo (contact, &content_type, &length); - * - * /* Set the photo. This should almost always be done asynchronously. To delete the photo, just pass NULL as the photo data. */ - * gdata_contacts_contact_set_photo (contact, service, data, length, content_type, NULL, &error); - * - * g_free (data); - * g_free (content_type); - * g_object_unref (contact); - * g_object_unref (service); - * - * if (error != NULL) { - * g_error ("Error setting a contact's photo: %s", error->message); - * g_error_free (error); - * return; - * } - * - * - * - * - * Updating a Contact's Details - * - * GDataContactsService *service; - * GDataContactsContact *contact, *updated_contact; - * GDataGDEmailAddress *email_address; - * GDataGDIMAddress *im_address; - * GError *error = NULL; - * - * /* Create a service and return the contact whose details we're updating. */ - * service = create_contacts_service (); - * contact = query_user_for_contact (service); - * - * /* Update the contact's details. We set their nickname to "Fat Tony", add a new e-mail address, and replace all their existing IM - * * addresses with a single new one. */ - * gdata_contacts_contact_set_nickname (contact, "Fat Tony"); - * - * email_address = gdata_gd_email_address_new ("tony@gmail.com", GDATA_GD_EMAIL_ADDRESS_HOME, NULL, FALSE); - * gdata_contacts_contact_add_email_address (contact, email_address); - * g_object_unref (email_address); - * - * gdata_contacts_contact_remove_all_im_addresses (contact); - * im_address = gdata_gd_im_address_new ("tony.work@gmail.com", GDATA_GD_IM_PROTOCOL_GOOGLE_TALK, GDATA_GD_IM_ADDRESS_WORK, NULL, TRUE); - * gdata_contacts_contact_add_im_address (contact, im_address); - * g_object_unref (im_address); - * - * /* Send the updated contact to the server */ - * updated_contact = GDATA_CONTACTS_CONTACT (gdata_service_update_entry (GDATA_SERVICE (service), GDATA_ENTRY (contact), NULL, &error)); - * - * g_object_unref (contact); - * g_object_unref (service); - * - * if (error != NULL) { - * g_error ("Error updating a contact's details: %s", error->message); - * g_error_free (error); - * return; - * } - * - * /* Do something with the updated contact, such as update them in the UI, or store their ID for future use. */ - * - * g_object_unref (updated_contact); - * - * - * - * Since: 0.2.0 - * Deprecated: 0.18.2: The Google Contacts service is deprecated. Use Google’s CardDAV interface instead. - */ - -#include -#include -#include -#include -#include - -#include "gdata-contacts-contact.h" -#include "gdata-parser.h" -#include "gdata-types.h" -#include "gdata-private.h" -#include "gdata-comparable.h" - -G_GNUC_BEGIN_IGNORE_DEPRECATIONS - -/* The maximum number of extended properties the server allows us. See - * http://code.google.com/apis/contacts/docs/2.0/reference.html#ProjectionsAndExtended. - * When updating this, make sure to update the API documentation for gdata_contacts_contact_get_extended_property() - * and gdata_contacts_contact_set_extended_property(). */ -#define MAX_N_EXTENDED_PROPERTIES 10 - -static GObject *gdata_contacts_contact_constructor (GType type, guint n_construct_params, GObjectConstructParam *construct_params); -static void gdata_contacts_contact_dispose (GObject *object); -static void gdata_contacts_contact_finalize (GObject *object); -static void gdata_contacts_contact_get_property (GObject *object, guint property_id, GValue *value, GParamSpec *pspec); -static void gdata_contacts_contact_set_property (GObject *object, guint property_id, const GValue *value, GParamSpec *pspec); -static void get_xml (GDataParsable *parsable, GString *xml_string); -static gboolean parse_xml (GDataParsable *parsable, xmlDoc *doc, xmlNode *node, gpointer user_data, GError **error); -static void get_namespaces (GDataParsable *parsable, GHashTable *namespaces); -static gchar *get_entry_uri (const gchar *id) G_GNUC_WARN_UNUSED_RESULT; - -struct _GDataContactsContactPrivate { - gint64 edited; - GDataGDName *name; - GList *email_addresses; /* GDataGDEmailAddress */ - GList *im_addresses; /* GDataGDIMAddress */ - GList *phone_numbers; /* GDataGDPhoneNumber */ - GList *postal_addresses; /* GDataGDPostalAddress */ - GList *organizations; /* GDataGDOrganization */ - GHashTable *extended_properties; - GHashTable *user_defined_fields; - GHashTable *groups; - gboolean deleted; - gchar *photo_etag; - GList *jots; /* GDataGContactJot */ - gchar *nickname; - gchar *file_as; - GDate birthday; - gboolean birthday_has_year; /* contacts can choose to just give the month and day of their birth */ - GList *relations; /* GDataGContactRelation */ - GList *websites; /* GDataGContactWebsite */ - GList *events; /* GDataGContactEvent */ - GList *calendars; /* GDataGContactCalendar */ - GList *external_ids; /* GDataGContactExternalID */ - gchar *billing_information; - gchar *directory_server; - gchar *gender; - gchar *initials; - gchar *maiden_name; - gchar *mileage; - gchar *occupation; - gchar *priority; - gchar *sensitivity; - gchar *short_name; - gchar *subject; - GList *hobbies; /* gchar* */ - GList *languages; /* GDataGContactLanguage */ -}; - -enum { - PROP_EDITED = 1, - PROP_DELETED, - PROP_NAME, - PROP_NICKNAME, - PROP_BIRTHDAY, - PROP_BIRTHDAY_HAS_YEAR, - PROP_BILLING_INFORMATION, - PROP_DIRECTORY_SERVER, - PROP_GENDER, - PROP_INITIALS, - PROP_MAIDEN_NAME, - PROP_MILEAGE, - PROP_OCCUPATION, - PROP_PRIORITY, - PROP_SENSITIVITY, - PROP_SHORT_NAME, - PROP_SUBJECT, - PROP_PHOTO_ETAG, - PROP_FILE_AS, -}; - -G_DEFINE_TYPE_WITH_PRIVATE (GDataContactsContact, gdata_contacts_contact, GDATA_TYPE_ENTRY) - -static void -gdata_contacts_contact_class_init (GDataContactsContactClass *klass) -{ - GObjectClass *gobject_class = G_OBJECT_CLASS (klass); - GDataParsableClass *parsable_class = GDATA_PARSABLE_CLASS (klass); - GDataEntryClass *entry_class = GDATA_ENTRY_CLASS (klass); - - gobject_class->constructor = gdata_contacts_contact_constructor; - gobject_class->get_property = gdata_contacts_contact_get_property; - gobject_class->set_property = gdata_contacts_contact_set_property; - gobject_class->dispose = gdata_contacts_contact_dispose; - gobject_class->finalize = gdata_contacts_contact_finalize; - - parsable_class->parse_xml = parse_xml; - parsable_class->get_xml = get_xml; - parsable_class->get_namespaces = get_namespaces; - - entry_class->get_entry_uri = get_entry_uri; - entry_class->kind_term = "http://schemas.google.com/contact/2008#contact"; - - /** - * GDataContactsContact:edited: - * - * The last time the contact was edited. If the contact has not been edited yet, the content indicates the time it was created. - * - * For more information, see the - * Atom Publishing Protocol specification. - * - * Since: 0.2.0 - * Deprecated: 0.18.2: The Google Contacts service is deprecated. Use Google’s CardDAV interface instead. - */ - g_object_class_install_property (gobject_class, PROP_EDITED, - g_param_spec_int64 ("edited", - "Edited", "The last time the contact was edited.", - -1, G_MAXINT64, -1, - G_PARAM_READABLE | G_PARAM_STATIC_STRINGS)); - - /** - * GDataContactsContact:deleted: - * - * Whether the entry has been deleted. - * - * Since: 0.2.0 - * Deprecated: 0.18.2: The Google Contacts service is deprecated. Use Google’s CardDAV interface instead. - */ - g_object_class_install_property (gobject_class, PROP_DELETED, - g_param_spec_boolean ("deleted", - "Deleted", "Whether the entry has been deleted.", - FALSE, - G_PARAM_READABLE | G_PARAM_STATIC_STRINGS)); - - /** - * GDataContactsContact:photo-etag: - * - * The ETag of the contact's photo, if the contact has a photo; %NULL otherwise. - * - * Since: 0.9.0 - * Deprecated: 0.18.2: The Google Contacts service is deprecated. Use Google’s CardDAV interface instead. - */ - g_object_class_install_property (gobject_class, PROP_PHOTO_ETAG, - g_param_spec_string ("photo-etag", - "Photo ETag", "The ETag of the contact's photo.", - NULL, - G_PARAM_READABLE | G_PARAM_STATIC_STRINGS)); - - /** - * GDataContactsContact:name: - * - * The contact's name in a structured representation. - * - * Since: 0.5.0 - * Deprecated: 0.18.2: The Google Contacts service is deprecated. Use Google’s CardDAV interface instead. - */ - g_object_class_install_property (gobject_class, PROP_NAME, - g_param_spec_object ("name", - "Name", "The contact's name in a structured representation.", - GDATA_TYPE_GD_NAME, - G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS)); - - /** - * GDataContactsContact:nickname: - * - * The contact's chosen nickname. - * - * Since: 0.7.0 - * Deprecated: 0.18.2: The Google Contacts service is deprecated. Use Google’s CardDAV interface instead. - */ - g_object_class_install_property (gobject_class, PROP_NICKNAME, - g_param_spec_string ("nickname", - "Nickname", "The contact's chosen nickname.", - NULL, - G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS)); - - /** - * GDataContactsContact:file-as: - * - * The name to file the contact under for sorting purposes. - * - * Since: 0.11.0 - * Deprecated: 0.18.2: The Google Contacts service is deprecated. Use Google’s CardDAV interface instead. - */ - g_object_class_install_property (gobject_class, PROP_FILE_AS, - g_param_spec_string ("file-as", - "File As", "The name to file the contact under for sorting purposes.", - NULL, - G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS)); - - /** - * GDataContactsContact:birthday: - * - * The contact's birthday. - * - * Since: 0.7.0 - * Deprecated: 0.18.2: The Google Contacts service is deprecated. Use Google’s CardDAV interface instead. - */ - g_object_class_install_property (gobject_class, PROP_BIRTHDAY, - g_param_spec_boxed ("birthday", - "Birthday", "The contact's birthday.", - G_TYPE_DATE, - G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS)); - - /** - * GDataContactsContact:birthday-has-year: - * - * Whether the contact's birthday includes their year of birth. - * - * Since: 0.7.0 - * Deprecated: 0.18.2: The Google Contacts service is deprecated. Use Google’s CardDAV interface instead. - */ - g_object_class_install_property (gobject_class, PROP_BIRTHDAY_HAS_YEAR, - g_param_spec_boolean ("birthday-has-year", - "Birthday has year?", "Whether the contact's birthday includes their year of birth.", - FALSE, - G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS)); - - /** - * GDataContactsContact:billing-information: - * - * Billing information for the contact, such as their billing name and address. - * - * Since: 0.7.0 - * Deprecated: 0.18.2: The Google Contacts service is deprecated. Use Google’s CardDAV interface instead. - */ - g_object_class_install_property (gobject_class, PROP_BILLING_INFORMATION, - g_param_spec_string ("billing-information", - "Billing information", "Billing information for the contact.", - NULL, - G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS)); - - /** - * GDataContactsContact:directory-server: - * - * The name or address of a directory server associated with the contact. - * - * Since: 0.7.0 - * Deprecated: 0.18.2: The Google Contacts service is deprecated. Use Google’s CardDAV interface instead. - */ - g_object_class_install_property (gobject_class, PROP_DIRECTORY_SERVER, - g_param_spec_string ("directory-server", - "Directory server", "The name or address of an associated directory server.", - NULL, - G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS)); - - /** - * GDataContactsContact:gender: - * - * The gender of the contact. For example: %GDATA_CONTACTS_GENDER_MALE or %GDATA_CONTACTS_GENDER_FEMALE. - * - * Since: 0.7.0 - * Deprecated: 0.18.2: The Google Contacts service is deprecated. Use Google’s CardDAV interface instead. - */ - g_object_class_install_property (gobject_class, PROP_GENDER, - g_param_spec_string ("gender", - "Gender", "The gender of the contact.", - NULL, - G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS)); - - /** - * GDataContactsContact:initials: - * - * The initials of the contact. - * - * Since: 0.7.0 - * Deprecated: 0.18.2: The Google Contacts service is deprecated. Use Google’s CardDAV interface instead. - */ - g_object_class_install_property (gobject_class, PROP_INITIALS, - g_param_spec_string ("initials", - "Initials", "The initials of the contact.", - NULL, - G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS)); - - /** - * GDataContactsContact:maiden-name: - * - * The maiden name of the contact. - * - * Since: 0.7.0 - * Deprecated: 0.18.2: The Google Contacts service is deprecated. Use Google’s CardDAV interface instead. - */ - g_object_class_install_property (gobject_class, PROP_MAIDEN_NAME, - g_param_spec_string ("maiden-name", - "Maiden name", "The maiden name of the contact.", - NULL, - G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS)); - - /** - * GDataContactsContact:mileage: - * - * A mileage associated with the contact, such as one for reimbursement purposes. It can be in any format. - * - * Since: 0.7.0 - * Deprecated: 0.18.2: The Google Contacts service is deprecated. Use Google’s CardDAV interface instead. - */ - g_object_class_install_property (gobject_class, PROP_MILEAGE, - g_param_spec_string ("mileage", - "Mileage", "A mileage associated with the contact.", - NULL, - G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS)); - - /** - * GDataContactsContact:occupation: - * - * The contact's occupation. - * - * Since: 0.7.0 - * Deprecated: 0.18.2: The Google Contacts service is deprecated. Use Google’s CardDAV interface instead. - */ - g_object_class_install_property (gobject_class, PROP_OCCUPATION, - g_param_spec_string ("occupation", - "Occupation", "The contact's occupation.", - NULL, - G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS)); - - /** - * GDataContactsContact:priority: - * - * The contact's importance. For example: %GDATA_CONTACTS_PRIORITY_NORMAL or %GDATA_CONTACTS_PRIORITY_HIGH. - * - * Since: 0.7.0 - * Deprecated: 0.18.2: The Google Contacts service is deprecated. Use Google’s CardDAV interface instead. - */ - g_object_class_install_property (gobject_class, PROP_PRIORITY, - g_param_spec_string ("priority", - "Priority", "The contact's importance.", - NULL, - G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS)); - - /** - * GDataContactsContact:sensitivity: - * - * The sensitivity of the contact's data. For example: %GDATA_CONTACTS_SENSITIVITY_NORMAL or %GDATA_CONTACTS_SENSITIVITY_PRIVATE. - * - * Since: 0.7.0 - * Deprecated: 0.18.2: The Google Contacts service is deprecated. Use Google’s CardDAV interface instead. - */ - g_object_class_install_property (gobject_class, PROP_SENSITIVITY, - g_param_spec_string ("sensitivity", - "Sensitivity", "The sensitivity of the contact's data.", - NULL, - G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS)); - - /** - * GDataContactsContact:short-name: - * - * A short name for the contact. This should be used for contracted versions of the contact's actual name, - * whereas #GDataContactsContact:nickname should be used for nicknames. - * - * Since: 0.7.0 - * Deprecated: 0.18.2: The Google Contacts service is deprecated. Use Google’s CardDAV interface instead. - */ - g_object_class_install_property (gobject_class, PROP_SHORT_NAME, - g_param_spec_string ("short-name", - "Short name", "A short name for the contact.", - NULL, - G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS)); - - /** - * GDataContactsContact:subject: - * - * The subject of the contact. (i.e. The contact's relevance to the address book.) - * - * Since: 0.7.0 - * Deprecated: 0.18.2: The Google Contacts service is deprecated. Use Google’s CardDAV interface instead. - */ - g_object_class_install_property (gobject_class, PROP_SUBJECT, - g_param_spec_string ("subject", - "Subject", "The subject of the contact.", - NULL, - G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS)); -} - -static void notify_full_name_cb (GObject *gobject, GParamSpec *pspec, GDataContactsContact *self); - -static void -notify_title_cb (GObject *gobject, GParamSpec *pspec, GDataContactsContact *self) -{ - /* Update GDataGDName:full-name */ - g_signal_handlers_block_by_func (self->priv->name, notify_full_name_cb, self); - gdata_gd_name_set_full_name (self->priv->name, gdata_entry_get_title (GDATA_ENTRY (self))); - g_signal_handlers_unblock_by_func (self->priv->name, notify_full_name_cb, self); -} - -static void -notify_full_name_cb (GObject *gobject, GParamSpec *pspec, GDataContactsContact *self) -{ - /* Update GDataEntry:title */ - g_signal_handlers_block_by_func (self, notify_title_cb, self); - gdata_entry_set_title (GDATA_ENTRY (self), gdata_gd_name_get_full_name (self->priv->name)); - g_signal_handlers_unblock_by_func (self, notify_title_cb, self); -} - -static void -gdata_contacts_contact_init (GDataContactsContact *self) -{ - self->priv = gdata_contacts_contact_get_instance_private (self); - self->priv->extended_properties = g_hash_table_new_full (g_str_hash, g_str_equal, g_free, g_free); - self->priv->user_defined_fields = g_hash_table_new_full (g_str_hash, g_str_equal, g_free, g_free); - self->priv->groups = g_hash_table_new_full (g_str_hash, g_str_equal, g_free, NULL); - self->priv->edited = -1; - - /* Create a default name, so the name's properties can be set for a blank contact */ - self->priv->name = gdata_gd_name_new (NULL, NULL); - - /* Listen to change notifications for the entry's title, since it's linked to GDataGDName:full-name */ - g_signal_connect (self, "notify::title", (GCallback) notify_title_cb, self); - g_signal_connect (self->priv->name, "notify::full-name", (GCallback) notify_full_name_cb, self); - - /* Initialise the contact's birthday to a sane but invalid date */ - g_date_clear (&(self->priv->birthday), 1); -} - -static GObject * -gdata_contacts_contact_constructor (GType type, guint n_construct_params, GObjectConstructParam *construct_params) -{ - GObject *object; - guint i; - - /* Find the "id" property and ensure it's sane */ - for (i = 0; i < n_construct_params; i++) { - GParamSpec *pspec = construct_params[i].pspec; - GValue *value = construct_params[i].value; - - if (strcmp (g_param_spec_get_name (pspec), "id") == 0) { - gchar *base, *id; - - id = g_value_dup_string (value); - - /* Fix the ID to refer to the full projection, rather than the base projection. */ - if (id != NULL) { - base = strstr (id, "/base/"); - if (base != NULL) - memcpy (base, "/full/", 6); - } - - g_value_take_string (value, id); - - break; - } - } - - /* Chain up to the parent class */ - object = G_OBJECT_CLASS (gdata_contacts_contact_parent_class)->constructor (type, n_construct_params, construct_params); - - if (_gdata_parsable_is_constructed_from_xml (GDATA_PARSABLE (object)) == FALSE) { - GDataContactsContactPrivate *priv = GDATA_CONTACTS_CONTACT (object)->priv; - - /* Set the edited property to the current time (creation time). We don't do this in *_init() since that would cause - * setting it from parse_xml() to fail (duplicate element). */ - priv->edited = g_get_real_time () / G_USEC_PER_SEC; - } - - return object; -} - -static void -gdata_contacts_contact_dispose (GObject *object) -{ - GDataContactsContact *self = GDATA_CONTACTS_CONTACT (object); - - if (self->priv->name != NULL) - g_object_unref (self->priv->name); - self->priv->name = NULL; - - gdata_contacts_contact_remove_all_organizations (self); - gdata_contacts_contact_remove_all_email_addresses (self); - gdata_contacts_contact_remove_all_im_addresses (self); - gdata_contacts_contact_remove_all_postal_addresses (self); - gdata_contacts_contact_remove_all_phone_numbers (self); - gdata_contacts_contact_remove_all_jots (self); - gdata_contacts_contact_remove_all_relations (self); - gdata_contacts_contact_remove_all_websites (self); - gdata_contacts_contact_remove_all_events (self); - gdata_contacts_contact_remove_all_calendars (self); - gdata_contacts_contact_remove_all_external_ids (self); - gdata_contacts_contact_remove_all_languages (self); - - /* Chain up to the parent class */ - G_OBJECT_CLASS (gdata_contacts_contact_parent_class)->dispose (object); -} - -static void -gdata_contacts_contact_finalize (GObject *object) -{ - GDataContactsContactPrivate *priv = GDATA_CONTACTS_CONTACT (object)->priv; - - g_hash_table_destroy (priv->extended_properties); - g_hash_table_destroy (priv->user_defined_fields); - g_hash_table_destroy (priv->groups); - g_free (priv->photo_etag); - g_free (priv->nickname); - g_free (priv->file_as); - g_free (priv->billing_information); - g_free (priv->directory_server); - g_free (priv->gender); - g_free (priv->initials); - g_free (priv->maiden_name); - g_free (priv->mileage); - g_free (priv->occupation); - g_free (priv->priority); - g_free (priv->sensitivity); - g_free (priv->short_name); - g_free (priv->subject); - - g_list_free_full (priv->hobbies, g_free); - - /* Chain up to the parent class */ - G_OBJECT_CLASS (gdata_contacts_contact_parent_class)->finalize (object); -} - -static void -gdata_contacts_contact_get_property (GObject *object, guint property_id, GValue *value, GParamSpec *pspec) -{ - GDataContactsContactPrivate *priv = GDATA_CONTACTS_CONTACT (object)->priv; - - switch (property_id) { - case PROP_EDITED: - g_value_set_int64 (value, priv->edited); - break; - case PROP_DELETED: - g_value_set_boolean (value, priv->deleted); - break; - case PROP_PHOTO_ETAG: - g_value_set_string (value, priv->photo_etag); - break; - case PROP_NAME: - g_value_set_object (value, priv->name); - break; - case PROP_NICKNAME: - g_value_set_string (value, priv->nickname); - break; - case PROP_FILE_AS: - g_value_set_string (value, priv->file_as); - break; - case PROP_BIRTHDAY: - g_value_set_boxed (value, &(priv->birthday)); - break; - case PROP_BIRTHDAY_HAS_YEAR: - g_value_set_boolean (value, priv->birthday_has_year); - break; - case PROP_BILLING_INFORMATION: - g_value_set_string (value, priv->billing_information); - break; - case PROP_DIRECTORY_SERVER: - g_value_set_string (value, priv->directory_server); - break; - case PROP_GENDER: - g_value_set_string (value, priv->gender); - break; - case PROP_INITIALS: - g_value_set_string (value, priv->initials); - break; - case PROP_MAIDEN_NAME: - g_value_set_string (value, priv->maiden_name); - break; - case PROP_MILEAGE: - g_value_set_string (value, priv->mileage); - break; - case PROP_OCCUPATION: - g_value_set_string (value, priv->occupation); - break; - case PROP_PRIORITY: - g_value_set_string (value, priv->priority); - break; - case PROP_SENSITIVITY: - g_value_set_string (value, priv->sensitivity); - break; - case PROP_SHORT_NAME: - g_value_set_string (value, priv->short_name); - break; - case PROP_SUBJECT: - g_value_set_string (value, priv->subject); - break; - default: - /* We don't have any other property... */ - G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec); - break; - } -} - -static void -gdata_contacts_contact_set_property (GObject *object, guint property_id, const GValue *value, GParamSpec *pspec) -{ - GDataContactsContact *self = GDATA_CONTACTS_CONTACT (object); - - switch (property_id) { - case PROP_NAME: - gdata_contacts_contact_set_name (self, g_value_get_object (value)); - break; - case PROP_NICKNAME: - gdata_contacts_contact_set_nickname (self, g_value_get_string (value)); - break; - case PROP_FILE_AS: - gdata_contacts_contact_set_file_as (self, g_value_get_string (value)); - break; - case PROP_BIRTHDAY: - gdata_contacts_contact_set_birthday (self, g_value_get_boxed (value), self->priv->birthday_has_year); - break; - case PROP_BIRTHDAY_HAS_YEAR: - gdata_contacts_contact_set_birthday (self, &(self->priv->birthday), g_value_get_boolean (value)); - break; - case PROP_BILLING_INFORMATION: - gdata_contacts_contact_set_billing_information (self, g_value_get_string (value)); - break; - case PROP_DIRECTORY_SERVER: - gdata_contacts_contact_set_directory_server (self, g_value_get_string (value)); - break; - case PROP_GENDER: - gdata_contacts_contact_set_gender (self, g_value_get_string (value)); - break; - case PROP_INITIALS: - gdata_contacts_contact_set_initials (self, g_value_get_string (value)); - break; - case PROP_MAIDEN_NAME: - gdata_contacts_contact_set_maiden_name (self, g_value_get_string (value)); - break; - case PROP_MILEAGE: - gdata_contacts_contact_set_mileage (self, g_value_get_string (value)); - break; - case PROP_OCCUPATION: - gdata_contacts_contact_set_occupation (self, g_value_get_string (value)); - break; - case PROP_PRIORITY: - gdata_contacts_contact_set_priority (self, g_value_get_string (value)); - break; - case PROP_SENSITIVITY: - gdata_contacts_contact_set_sensitivity (self, g_value_get_string (value)); - break; - case PROP_SHORT_NAME: - gdata_contacts_contact_set_short_name (self, g_value_get_string (value)); - break; - case PROP_SUBJECT: - gdata_contacts_contact_set_subject (self, g_value_get_string (value)); - break; - default: - /* We don't have any other property... */ - G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec); - break; - } -} - -static gboolean -parse_xml (GDataParsable *parsable, xmlDoc *doc, xmlNode *node, gpointer user_data, GError **error) -{ - gboolean success; - GDataContactsContact *self = GDATA_CONTACTS_CONTACT (parsable); - - if (gdata_parser_is_namespace (node, "http://www.w3.org/2007/app") == TRUE && - gdata_parser_int64_time_from_element (node, "edited", P_REQUIRED | P_NO_DUPES, &(self->priv->edited), &success, error) == TRUE) { - return success; - } else if (gdata_parser_is_namespace (node, "http://www.w3.org/2005/Atom") == TRUE && xmlStrcmp (node->name, (xmlChar*) "id") == 0) { - /* We have to override parsing to fix the projection. Modify it in-place so that the parser in GDataEntry will pick up - * the changes. This fixes bugs caused by referring to contacts by the base projection, rather than the full projection; - * such as http://code.google.com/p/gdata-issues/issues/detail?id=2129. */ - gchar *base; - gchar *id = (gchar*) xmlNodeListGetString (doc, node->children, TRUE); - - if (id != NULL) { - base = strstr (id, "/base/"); - if (base != NULL) { - memcpy (base, "/full/", 6); - xmlNodeSetContent (node, (xmlChar*) id); - } - } - - xmlFree (id); - - return GDATA_PARSABLE_CLASS (gdata_contacts_contact_parent_class)->parse_xml (parsable, doc, node, user_data, error); - } else if (gdata_parser_is_namespace (node, "http://schemas.google.com/g/2005") == TRUE) { - if (gdata_parser_object_from_element_setter (node, "im", P_REQUIRED, GDATA_TYPE_GD_IM_ADDRESS, - gdata_contacts_contact_add_im_address, self, &success, error) == TRUE || - gdata_parser_object_from_element_setter (node, "phoneNumber", P_REQUIRED, GDATA_TYPE_GD_PHONE_NUMBER, - gdata_contacts_contact_add_phone_number, self, &success, error) == TRUE || - gdata_parser_object_from_element_setter (node, "structuredPostalAddress", P_REQUIRED, GDATA_TYPE_GD_POSTAL_ADDRESS, - gdata_contacts_contact_add_postal_address, self, &success, error) == TRUE || - gdata_parser_object_from_element_setter (node, "organization", P_REQUIRED, GDATA_TYPE_GD_ORGANIZATION, - gdata_contacts_contact_add_organization, self, &success, error) == TRUE || - gdata_parser_object_from_element (node, "name", P_REQUIRED, GDATA_TYPE_GD_NAME, &(self->priv->name), &success, error) == TRUE) { - return success; - } else if (xmlStrcmp (node->name, (xmlChar*) "email") == 0) { - /* gd:email */ - GDataParsable *_parsable; - xmlChar *address; - - /* Check its address attribute is non-empty. Empty address attributes are apparently allowed, and make the - * gd:email element a no-op. See: https://bugzilla.gnome.org/show_bug.cgi?id=734863 */ - address = xmlGetProp (node, (xmlChar *) "address"); - if (address == NULL) { - return gdata_parser_error_required_property_missing (node, "address", error); - } else if (*address == '\0') { - xmlFree (address); - success = TRUE; - return TRUE; - } - - xmlFree (address); - - /* Parse the e-mail address. */ - _parsable = _gdata_parsable_new_from_xml_node (GDATA_TYPE_GD_EMAIL_ADDRESS, node->doc, node, NULL, error); - if (_parsable == NULL) { - /* The error has already been set by _gdata_parsable_new_from_xml_node() */ - success = FALSE; - return TRUE; - } - - /* Success! */ - gdata_contacts_contact_add_email_address (self, GDATA_GD_EMAIL_ADDRESS (_parsable)); - g_object_unref (_parsable); - success = TRUE; - - return TRUE; - } else if (xmlStrcmp (node->name, (xmlChar*) "extendedProperty") == 0) { - /* gd:extendedProperty */ - xmlChar *name, *value; - xmlBuffer *buffer = NULL; - - name = xmlGetProp (node, (xmlChar*) "name"); - if (name == NULL) - return gdata_parser_error_required_property_missing (node, "name", error); - - /* Get either the value property, or the element's content */ - value = xmlGetProp (node, (xmlChar*) "value"); - if (value == NULL) { - xmlNode *child_node; - - /* Use the element's content instead (arbitrary XML) */ - buffer = xmlBufferCreate (); - for (child_node = node->children; child_node != NULL; child_node = child_node->next) - xmlNodeDump (buffer, doc, child_node, 0, 0); - value = (xmlChar*) xmlBufferContent (buffer); - } - - gdata_contacts_contact_set_extended_property (self, (gchar*) name, (gchar*) value); - - xmlFree (name); - if (buffer != NULL) - xmlBufferFree (buffer); - else - xmlFree (value); - } else if (xmlStrcmp (node->name, (xmlChar*) "deleted") == 0) { - /* gd:deleted */ - self->priv->deleted = TRUE; - } else { - return GDATA_PARSABLE_CLASS (gdata_contacts_contact_parent_class)->parse_xml (parsable, doc, node, user_data, error); - } - } else if (gdata_parser_is_namespace (node, "http://schemas.google.com/contact/2008") == TRUE) { - if (gdata_parser_object_from_element_setter (node, "jot", P_REQUIRED, GDATA_TYPE_GCONTACT_JOT, - gdata_contacts_contact_add_jot, self, &success, error) == TRUE || - gdata_parser_object_from_element_setter (node, "relation", P_REQUIRED, GDATA_TYPE_GCONTACT_RELATION, - gdata_contacts_contact_add_relation, self, &success, error) == TRUE || - gdata_parser_object_from_element_setter (node, "event", P_REQUIRED, GDATA_TYPE_GCONTACT_EVENT, - gdata_contacts_contact_add_event, self, &success, error) == TRUE || - gdata_parser_object_from_element_setter (node, "website", P_IGNORE_ERROR, GDATA_TYPE_GCONTACT_WEBSITE, - gdata_contacts_contact_add_website, self, &success, error) == TRUE || - gdata_parser_object_from_element_setter (node, "calendarLink", P_REQUIRED, GDATA_TYPE_GCONTACT_CALENDAR, - gdata_contacts_contact_add_calendar, self, &success, error) == TRUE || - gdata_parser_object_from_element_setter (node, "externalId", P_REQUIRED, GDATA_TYPE_GCONTACT_EXTERNAL_ID, - gdata_contacts_contact_add_external_id, self, &success, error) == TRUE || - gdata_parser_object_from_element_setter (node, "language", P_REQUIRED, GDATA_TYPE_GCONTACT_LANGUAGE, - gdata_contacts_contact_add_language, self, &success, error) == TRUE || - gdata_parser_string_from_element (node, "nickname", P_REQUIRED | P_NO_DUPES, &(self->priv->nickname), &success, error) == TRUE || - gdata_parser_string_from_element (node, "fileAs", P_REQUIRED | P_NO_DUPES, &(self->priv->file_as), &success, error) == TRUE || - gdata_parser_string_from_element (node, "billingInformation", P_REQUIRED | P_NO_DUPES | P_NON_EMPTY, - &(self->priv->billing_information), &success, error) == TRUE || - gdata_parser_string_from_element (node, "directoryServer", P_REQUIRED | P_NO_DUPES | P_NON_EMPTY, - &(self->priv->directory_server), &success, error) == TRUE || - gdata_parser_string_from_element (node, "initials", P_REQUIRED | P_NO_DUPES, &(self->priv->initials), &success, error) == TRUE || - gdata_parser_string_from_element (node, "maidenName", P_REQUIRED | P_NO_DUPES, - &(self->priv->maiden_name), &success, error) == TRUE || - gdata_parser_string_from_element (node, "mileage", P_REQUIRED | P_NO_DUPES, &(self->priv->mileage), &success, error) == TRUE || - gdata_parser_string_from_element (node, "occupation", P_REQUIRED | P_NO_DUPES, - &(self->priv->occupation), &success, error) == TRUE || - gdata_parser_string_from_element (node, "shortName", P_REQUIRED | P_NO_DUPES, - &(self->priv->short_name), &success, error) == TRUE || - gdata_parser_string_from_element (node, "subject", P_REQUIRED | P_NO_DUPES, &(self->priv->subject), &success, error) == TRUE) { - return success; - } else if (xmlStrcmp (node->name, (xmlChar*) "gender") == 0) { - /* gContact:gender */ - xmlChar *value; - - if (self->priv->gender != NULL) - return gdata_parser_error_duplicate_element (node, error); - - value = xmlGetProp (node, (xmlChar*) "value"); - if (value == NULL || *value == '\0') { - xmlFree (value); - return gdata_parser_error_required_content_missing (node, error); - } - - self->priv->gender = (gchar*) value; - } else if (xmlStrcmp (node->name, (xmlChar*) "hobby") == 0) { - /* gContact:hobby */ - xmlChar *hobby; - - hobby = xmlNodeListGetString (doc, node->children, TRUE); - if (hobby == NULL || *hobby == '\0') { - xmlFree (hobby); - return gdata_parser_error_required_content_missing (node, error); - } - - gdata_contacts_contact_add_hobby (self, (gchar*) hobby); - xmlFree (hobby); - } else if (xmlStrcmp (node->name, (xmlChar*) "userDefinedField") == 0) { - /* gContact:userDefinedField */ - xmlChar *name, *value; - - /* Note that while we require the property to be present, we don't require it to be non-empty. See bgo#648058 */ - name = xmlGetProp (node, (xmlChar*) "key"); - if (name == NULL) { - return gdata_parser_error_required_property_missing (node, "key", error); - } - - /* Get either the value property, or the element's content */ - value = xmlGetProp (node, (xmlChar*) "value"); - if (value == NULL) { - xmlFree (name); - return gdata_parser_error_required_property_missing (node, "value", error); - } - - gdata_contacts_contact_set_user_defined_field (self, (gchar*) name, (gchar*) value); - - xmlFree (name); - xmlFree (value); - } else if (xmlStrcmp (node->name, (xmlChar*) "priority") == 0) { - /* gContact:priority */ - xmlChar *rel; - - if (self->priv->priority != NULL) - return gdata_parser_error_duplicate_element (node, error); - - rel = xmlGetProp (node, (xmlChar*) "rel"); - if (rel == NULL || *rel == '\0') { - xmlFree (rel); - return gdata_parser_error_required_content_missing (node, error); - } - - self->priv->priority = (gchar*) rel; - } else if (xmlStrcmp (node->name, (xmlChar*) "sensitivity") == 0) { - /* gContact:sensitivity */ - xmlChar *rel; - - if (self->priv->sensitivity != NULL) - return gdata_parser_error_duplicate_element (node, error); - - rel = xmlGetProp (node, (xmlChar*) "rel"); - if (rel == NULL || *rel == '\0') { - xmlFree (rel); - return gdata_parser_error_required_content_missing (node, error); - } - - self->priv->sensitivity = (gchar*) rel; - } else if (xmlStrcmp (node->name, (xmlChar*) "groupMembershipInfo") == 0) { - /* gContact:groupMembershipInfo */ - xmlChar *href; - gboolean deleted_bool; - - href = xmlGetProp (node, (xmlChar*) "href"); - if (href == NULL) - return gdata_parser_error_required_property_missing (node, "href", error); - - /* Has it been deleted? */ - if (gdata_parser_boolean_from_property (node, "deleted", &deleted_bool, 0, error) == FALSE) { - xmlFree (href); - return FALSE; - } - - /* Insert it into the hash table */ - g_hash_table_insert (self->priv->groups, (gchar*) href, GUINT_TO_POINTER (deleted_bool)); - } else if (xmlStrcmp (node->name, (xmlChar*) "birthday") == 0) { - /* gContact:birthday */ - xmlChar *birthday; - guint length = 0, year = 666, month, day; - - if (g_date_valid (&(self->priv->birthday)) == TRUE) - return gdata_parser_error_duplicate_element (node, error); - - birthday = xmlGetProp (node, (xmlChar*) "when"); - if (birthday == NULL) - return gdata_parser_error_required_property_missing (node, "when", error); - length = strlen ((char*) birthday); - - /* Try parsing the two possible formats: YYYY-MM-DD and --MM-DD */ - if (((length == 10 && sscanf ((char*) birthday, "%4u-%2u-%2u", &year, &month, &day) == 3) || - (length == 7 && sscanf ((char*) birthday, "--%2u-%2u", &month, &day) == 2)) && - g_date_valid_dmy (day, month, year) == TRUE) { - /* Store the values in the GDate */ - g_date_set_dmy (&(self->priv->birthday), day, month, year); - self->priv->birthday_has_year = (length == 10) ? TRUE : FALSE; - xmlFree (birthday); - } else { - /* Parsing failed */ - gdata_parser_error_not_iso8601_format (node, (gchar*) birthday, error); - xmlFree (birthday); - return FALSE; - } - } else { - return GDATA_PARSABLE_CLASS (gdata_contacts_contact_parent_class)->parse_xml (parsable, doc, node, user_data, error); - } - } else { - /* If we haven't yet found a photo, check to see if it's a photo element */ - if (self->priv->photo_etag == NULL && xmlStrcmp (node->name, (xmlChar*) "link") == 0) { - xmlChar *rel = xmlGetProp (node, (xmlChar*) "rel"); - if (xmlStrcmp (rel, (xmlChar*) "http://schemas.google.com/contacts/2008/rel#photo") == 0) { - /* It's the photo link (http://code.google.com/apis/contacts/docs/2.0/reference.html#Photos), whose ETag we should - * note down, then pass onto the parent class to parse properly */ - self->priv->photo_etag = (gchar*) xmlGetProp (node, (xmlChar*) "etag"); - } - xmlFree (rel); - } - - return GDATA_PARSABLE_CLASS (gdata_contacts_contact_parent_class)->parse_xml (parsable, doc, node, user_data, error); - } - - return TRUE; -} - -static void -get_child_xml (GList *list, GString *xml_string) -{ - GList *i; - - for (i = list; i != NULL; i = i->next) - _gdata_parsable_get_xml (GDATA_PARSABLE (i->data), xml_string, FALSE); -} - -static void -get_extended_property_xml_cb (const gchar *name, const gchar *value, GString *xml_string) -{ - /* Note that the value *isn't* escaped (see http://code.google.com/apis/gdata/docs/2.0/elements.html#gdExtendedProperty) */ - gdata_parser_string_append_escaped (xml_string, ""); - g_string_append_printf (xml_string, "%s", value); -} - -static void -get_user_defined_field_xml_cb (const gchar *name, const gchar *value, GString *xml_string) -{ - gdata_parser_string_append_escaped (xml_string, ""); -} - -static void -get_group_xml_cb (const gchar *href, gpointer deleted, GString *xml_string) -{ - gchar *full_pos, *uri = g_strdup (href); - - /* The service API sometimes stubbornly insists on using the "full" view instead of the "base" view, which we have - * to fix, or it complains about an invalid group ID. */ - full_pos = strstr (uri, "/full/"); - if (full_pos != NULL) - memcpy ((char*) full_pos, "/base/", 6); - - gdata_parser_string_append_escaped (xml_string, ""); - - g_free (uri); -} - -static void -get_hobby_xml_cb (const gchar *hobby, GString *xml_string) -{ - gdata_parser_string_append_escaped (xml_string, "", hobby, ""); -} - -static void -get_xml (GDataParsable *parsable, GString *xml_string) -{ - GDataContactsContactPrivate *priv = GDATA_CONTACTS_CONTACT (parsable)->priv; - - /* Chain up to the parent class */ - GDATA_PARSABLE_CLASS (gdata_contacts_contact_parent_class)->get_xml (parsable, xml_string); - - /* Name */ - _gdata_parsable_get_xml (GDATA_PARSABLE (priv->name), xml_string, FALSE); - - /* Lists of stuff */ - get_child_xml (priv->email_addresses, xml_string); - get_child_xml (priv->im_addresses, xml_string); - get_child_xml (priv->phone_numbers, xml_string); - get_child_xml (priv->postal_addresses, xml_string); - get_child_xml (priv->organizations, xml_string); - get_child_xml (priv->jots, xml_string); - get_child_xml (priv->relations, xml_string); - get_child_xml (priv->websites, xml_string); - get_child_xml (priv->events, xml_string); - get_child_xml (priv->calendars, xml_string); - get_child_xml (priv->external_ids, xml_string); - get_child_xml (priv->languages, xml_string); - - /* Extended properties */ - g_hash_table_foreach (priv->extended_properties, (GHFunc) get_extended_property_xml_cb, xml_string); - - /* User defined fields */ - g_hash_table_foreach (priv->user_defined_fields, (GHFunc) get_user_defined_field_xml_cb, xml_string); - - /* Group membership info */ - g_hash_table_foreach (priv->groups, (GHFunc) get_group_xml_cb, xml_string); - - /* Hobbies */ - g_list_foreach (priv->hobbies, (GFunc) get_hobby_xml_cb, xml_string); - - /* gContact:nickname */ - if (priv->nickname != NULL) - gdata_parser_string_append_escaped (xml_string, "", priv->nickname, ""); - - /* gContact:fileAs */ - if (priv->file_as != NULL) { - gdata_parser_string_append_escaped (xml_string, "", priv->file_as, ""); - } - - /* gContact:birthday */ - if (g_date_valid (&(priv->birthday)) == TRUE) { - if (priv->birthday_has_year == TRUE) { - g_string_append_printf (xml_string, "", - g_date_get_year (&(priv->birthday)), - g_date_get_month (&(priv->birthday)), - g_date_get_day (&(priv->birthday))); - } else { - g_string_append_printf (xml_string, "", - g_date_get_month (&(priv->birthday)), - g_date_get_day (&(priv->birthday))); - } - } - - /* gContact:billingInformation */ - if (priv->billing_information != NULL) { - gdata_parser_string_append_escaped (xml_string, - "", priv->billing_information, ""); - } - - /* gContact:directoryServer */ - if (priv->directory_server != NULL) - gdata_parser_string_append_escaped (xml_string, "", priv->directory_server, ""); - - /* gContact:gender */ - if (priv->gender != NULL) - gdata_parser_string_append_escaped (xml_string, ""); - - /* gContact:initials */ - if (priv->initials != NULL) - gdata_parser_string_append_escaped (xml_string, "", priv->initials, ""); - - /* gContact:maidenName */ - if (priv->maiden_name != NULL) - gdata_parser_string_append_escaped (xml_string, "", priv->maiden_name, ""); - - /* gContact:mileage */ - if (priv->mileage != NULL) - gdata_parser_string_append_escaped (xml_string, "", priv->mileage, ""); - - /* gContact:occupation */ - if (priv->occupation != NULL) - gdata_parser_string_append_escaped (xml_string, "", priv->occupation, ""); - - /* gContact:priority */ - if (priv->priority != NULL) - gdata_parser_string_append_escaped (xml_string, ""); - - /* gContact:sensitivity */ - if (priv->sensitivity != NULL) - gdata_parser_string_append_escaped (xml_string, ""); - - /* gContact:shortName */ - if (priv->short_name != NULL) - gdata_parser_string_append_escaped (xml_string, "", priv->short_name, ""); - - /* gContact:subject */ - if (priv->subject != NULL) - gdata_parser_string_append_escaped (xml_string, "", priv->subject, ""); - - /* TODO: - * - Finish supporting all tags - */ -} - -static void -get_namespaces (GDataParsable *parsable, GHashTable *namespaces) -{ - /* Chain up to the parent class */ - GDATA_PARSABLE_CLASS (gdata_contacts_contact_parent_class)->get_namespaces (parsable, namespaces); - - g_hash_table_insert (namespaces, (gchar*) "gd", (gchar*) "http://schemas.google.com/g/2005"); - g_hash_table_insert (namespaces, (gchar*) "gContact", (gchar*) "http://schemas.google.com/contact/2008"); - g_hash_table_insert (namespaces, (gchar*) "app", (gchar*) "http://www.w3.org/2007/app"); -} - -static gchar * -get_entry_uri (const gchar *id) -{ - const gchar *base_pos; - gchar *uri; - - /* Ensure it uses the HTTPS protocol */ - if (g_str_has_prefix (id, "http://") == TRUE) { - guint id_length = strlen (id); - - uri = g_malloc (id_length + 2); - strcpy (uri, "https://"); - strcpy (uri + strlen ("https://"), id + strlen ("http://")); - } else { - uri = g_strdup (id); - } - - /* The service API sometimes stubbornly insists on using the "base" view instead of the "full" view, which we have - * to fix, or our extended attributes are never visible */ - base_pos = strstr (uri, "/base/"); - if (base_pos != NULL) - memcpy ((char*) base_pos, "/full/", 6); - - return uri; -} - -/** - * gdata_contacts_contact_new: - * @id: (allow-none): the contact's ID, or %NULL - * - * Creates a new #GDataContactsContact with the given ID and default properties. - * - * Return value: a new #GDataContactsContact; unref with g_object_unref() - * - * Since: 0.2.0 - * Deprecated: 0.18.2: The Google Contacts service is deprecated. Use Google’s CardDAV interface instead. - */ -GDataContactsContact * -gdata_contacts_contact_new (const gchar *id) -{ - return GDATA_CONTACTS_CONTACT (g_object_new (GDATA_TYPE_CONTACTS_CONTACT, "id", id, NULL)); -} - -/** - * gdata_contacts_contact_get_edited: - * @self: a #GDataContactsContact - * - * Gets the #GDataContactsContact:edited property. If the property is unset, -1 will be returned. - * - * Return value: the UNIX timestamp for the time the contact was last edited, or -1 - * - * Since: 0.2.0 - * Deprecated: 0.18.2: The Google Contacts service is deprecated. Use Google’s CardDAV interface instead. - */ -gint64 -gdata_contacts_contact_get_edited (GDataContactsContact *self) -{ - g_return_val_if_fail (GDATA_IS_CONTACTS_CONTACT (self), -1); - return self->priv->edited; -} - -/** - * gdata_contacts_contact_get_name: - * @self: a #GDataContactsContact - * - * Gets the #GDataContactsContact:name property. - * - * Return value: (transfer none): the contact's name, or %NULL - * - * Since: 0.5.0 - * Deprecated: 0.18.2: The Google Contacts service is deprecated. Use Google’s CardDAV interface instead. - */ -GDataGDName * -gdata_contacts_contact_get_name (GDataContactsContact *self) -{ - g_return_val_if_fail (GDATA_IS_CONTACTS_CONTACT (self), NULL); - return self->priv->name; -} - -/** - * gdata_contacts_contact_set_name: - * @self: a #GDataContactsContact - * @name: the new #GDataGDName - * - * Sets the #GDataContactsContact:name property to @name, and increments its reference count. - * - * @name must not be %NULL, though all its properties may be %NULL. - * - * Since: 0.7.0 - * Deprecated: 0.18.2: The Google Contacts service is deprecated. Use Google’s CardDAV interface instead. - */ -void -gdata_contacts_contact_set_name (GDataContactsContact *self, GDataGDName *name) -{ - g_return_if_fail (GDATA_IS_CONTACTS_CONTACT (self)); - g_return_if_fail (GDATA_IS_GD_NAME (name)); - - if (self->priv->name != NULL) - g_object_unref (self->priv->name); - self->priv->name = g_object_ref (name); - g_object_notify (G_OBJECT (self), "name"); - - /* Notify the change in #GDataGDName:full-name explicitly, so that our #GDataEntry:title gets updated */ - notify_full_name_cb (G_OBJECT (name), NULL, self); -} - -/** - * gdata_contacts_contact_get_nickname: - * @self: a #GDataContactsContact - * - * Gets the #GDataContactsContact:nickname property. - * - * Return value: the contact's nickname, or %NULL - * - * Since: 0.7.0 - * Deprecated: 0.18.2: The Google Contacts service is deprecated. Use Google’s CardDAV interface instead. - */ -const gchar * -gdata_contacts_contact_get_nickname (GDataContactsContact *self) -{ - g_return_val_if_fail (GDATA_IS_CONTACTS_CONTACT (self), NULL); - return self->priv->nickname; -} - -/** - * gdata_contacts_contact_set_nickname: - * @self: a #GDataContactsContact - * @nickname: (allow-none): the new nickname, or %NULL - * - * Sets the #GDataContactsContact:nickname property to @nickname. - * - * If @nickname is %NULL, the contact's nickname will be removed. - * - * Since: 0.7.0 - * Deprecated: 0.18.2: The Google Contacts service is deprecated. Use Google’s CardDAV interface instead. - */ -void -gdata_contacts_contact_set_nickname (GDataContactsContact *self, const gchar *nickname) -{ - g_return_if_fail (GDATA_IS_CONTACTS_CONTACT (self)); - - g_free (self->priv->nickname); - self->priv->nickname = g_strdup (nickname); - g_object_notify (G_OBJECT (self), "nickname"); -} - -/** - * gdata_contacts_contact_get_file_as: - * @self: a #GDataContactsContact - * - * Gets the #GDataContactsContact:file-as property. - * - * Return value: the name the contact's filed under, or %NULL - * - * Since: 0.11.0 - * Deprecated: 0.18.2: The Google Contacts service is deprecated. Use Google’s CardDAV interface instead. - */ -const gchar * -gdata_contacts_contact_get_file_as (GDataContactsContact *self) -{ - g_return_val_if_fail (GDATA_IS_CONTACTS_CONTACT (self), NULL); - return self->priv->file_as; -} - -/** - * gdata_contacts_contact_set_file_as: - * @self: a #GDataContactsContact - * @file_as: (allow-none): the new name to file the contact under, or %NULL - * - * Sets the #GDataContactsContact:file-as property to @file_as. - * - * If @file_as is %NULL, the contact will be filed under their full name. - * - * Since: 0.7.0 - * Deprecated: 0.18.2: The Google Contacts service is deprecated. Use Google’s CardDAV interface instead. - */ -void -gdata_contacts_contact_set_file_as (GDataContactsContact *self, const gchar *file_as) -{ - g_return_if_fail (GDATA_IS_CONTACTS_CONTACT (self)); - - g_free (self->priv->file_as); - self->priv->file_as = g_strdup (file_as); - g_object_notify (G_OBJECT (self), "file-as"); -} - -/** - * gdata_contacts_contact_get_birthday: - * @self: a #GDataContactsContact - * @birthday: (allow-none) (out caller-allocates): return location for the birthday, or %NULL - * - * Gets the #GDataContactsContact:birthday and #GDataContactsContact:birthday-has-year properties. If @birthday is non-%NULL, - * #GDataContactsContact:birthday is returned in it. The function returns the value of #GDataContactsContact:birthday-has-year, - * which specifies whether the year in @birthday is meaningful. Contacts may not have the year of their birth set, in which - * case, the function would return %FALSE, and the year in @birthday should be ignored. - * - * Return value: whether the contact's birthday has the year set - * - * Since: 0.7.0 - * Deprecated: 0.18.2: The Google Contacts service is deprecated. Use Google’s CardDAV interface instead. - */ -gboolean -gdata_contacts_contact_get_birthday (GDataContactsContact *self, GDate *birthday) -{ - g_return_val_if_fail (GDATA_IS_CONTACTS_CONTACT (self), FALSE); - - if (birthday != NULL) - *birthday = self->priv->birthday; - return self->priv->birthday_has_year; -} - -/** - * gdata_contacts_contact_set_birthday: - * @self: a #GDataContactsContact - * @birthday: (allow-none): the new birthday, or %NULL - * @birthday_has_year: %TRUE if @birthday's year is relevant, %FALSE otherwise - * - * Sets the #GDataContactsContact:birthday property to @birthday and the #GDataContactsContact:birthday-has-year property to @birthday_has_year. - * See gdata_contacts_contact_get_birthday() for an explanation of the interaction between these two properties. - * - * If @birthday is %NULL, the contact's birthday will be removed. - * - * Since: 0.7.0 - * Deprecated: 0.18.2: The Google Contacts service is deprecated. Use Google’s CardDAV interface instead. - */ -void -gdata_contacts_contact_set_birthday (GDataContactsContact *self, GDate *birthday, gboolean birthday_has_year) -{ - g_return_if_fail (GDATA_IS_CONTACTS_CONTACT (self)); - g_return_if_fail (birthday == NULL || g_date_valid (birthday)); - - if (birthday != NULL) - self->priv->birthday = *birthday; - else - g_date_clear (&(self->priv->birthday), 1); - - self->priv->birthday_has_year = birthday_has_year; - - g_object_freeze_notify (G_OBJECT (self)); - g_object_notify (G_OBJECT (self), "birthday"); - g_object_notify (G_OBJECT (self), "birthday-has-year"); - g_object_thaw_notify (G_OBJECT (self)); -} - -/** - * gdata_contacts_contact_get_billing_information: - * @self: a #GDataContactsContact - * - * Gets the #GDataContactsContact:billing-information property. - * - * Return value: the contact's billing information, or %NULL - * - * Since: 0.7.0 - * Deprecated: 0.18.2: The Google Contacts service is deprecated. Use Google’s CardDAV interface instead. - */ -const gchar * -gdata_contacts_contact_get_billing_information (GDataContactsContact *self) -{ - g_return_val_if_fail (GDATA_IS_CONTACTS_CONTACT (self), NULL); - return self->priv->billing_information; -} - -/** - * gdata_contacts_contact_set_billing_information: - * @self: a #GDataContactsContact - * @billing_information: (allow-none): the new billing information for the contact, or %NULL - * - * Sets the #GDataContactsContact:billing-information property to @billing_information. - * - * If @billing_information is %NULL, the contact's billing information will be removed. - * - * Since: 0.7.0 - * Deprecated: 0.18.2: The Google Contacts service is deprecated. Use Google’s CardDAV interface instead. - */ -void -gdata_contacts_contact_set_billing_information (GDataContactsContact *self, const gchar *billing_information) -{ - g_return_if_fail (GDATA_IS_CONTACTS_CONTACT (self)); - g_return_if_fail (billing_information == NULL || *billing_information != '\0'); - - g_free (self->priv->billing_information); - self->priv->billing_information = g_strdup (billing_information); - g_object_notify (G_OBJECT (self), "billing-information"); -} - -/** - * gdata_contacts_contact_get_directory_server: - * @self: a #GDataContactsContact - * - * Gets the #GDataContactsContact:directory-server property. - * - * Return value: the name or address of a directory server associated with the contact, or %NULL - * - * Since: 0.7.0 - * Deprecated: 0.18.2: The Google Contacts service is deprecated. Use Google’s CardDAV interface instead. - */ -const gchar * -gdata_contacts_contact_get_directory_server (GDataContactsContact *self) -{ - g_return_val_if_fail (GDATA_IS_CONTACTS_CONTACT (self), NULL); - return self->priv->directory_server; -} - -/** - * gdata_contacts_contact_set_directory_server: - * @self: a #GDataContactsContact - * @directory_server: (allow-none): the new name or address of a directory server associated with the contact, or %NULL - * - * Sets the #GDataContactsContact:directory-server property to @directory_server. - * - * If @directory_server is %NULL, the contact's directory server will be removed. - * - * Since: 0.7.0 - * Deprecated: 0.18.2: The Google Contacts service is deprecated. Use Google’s CardDAV interface instead. - */ -void -gdata_contacts_contact_set_directory_server (GDataContactsContact *self, const gchar *directory_server) -{ - g_return_if_fail (GDATA_IS_CONTACTS_CONTACT (self)); - g_return_if_fail (directory_server == NULL || *directory_server != '\0'); - - g_free (self->priv->directory_server); - self->priv->directory_server = g_strdup (directory_server); - g_object_notify (G_OBJECT (self), "directory-server"); -} - -/** - * gdata_contacts_contact_get_gender: - * @self: a #GDataContactsContact - * - * Gets the #GDataContactsContact:gender property. - * - * Return value: the gender of the contact, or %NULL - * - * Since: 0.7.0 - * Deprecated: 0.18.2: The Google Contacts service is deprecated. Use Google’s CardDAV interface instead. - */ -const gchar * -gdata_contacts_contact_get_gender (GDataContactsContact *self) -{ - g_return_val_if_fail (GDATA_IS_CONTACTS_CONTACT (self), NULL); - return self->priv->gender; -} - -/** - * gdata_contacts_contact_set_gender: - * @self: a #GDataContactsContact - * @gender: (allow-none): the new gender of the contact, or %NULL - * - * Sets the #GDataContactsContact:gender property to @gender. - * - * If @gender is %NULL, the contact's gender will be removed. - * - * Since: 0.7.0 - * Deprecated: 0.18.2: The Google Contacts service is deprecated. Use Google’s CardDAV interface instead. - */ -void -gdata_contacts_contact_set_gender (GDataContactsContact *self, const gchar *gender) -{ - g_return_if_fail (GDATA_IS_CONTACTS_CONTACT (self)); - g_return_if_fail (gender == NULL || *gender != '\0'); - - g_free (self->priv->gender); - self->priv->gender = g_strdup (gender); - g_object_notify (G_OBJECT (self), "gender"); -} - -/** - * gdata_contacts_contact_get_initials: - * @self: a #GDataContactsContact - * - * Gets the #GDataContactsContact:initials property. - * - * Return value: the initials of the contact, or %NULL - * - * Since: 0.7.0 - * Deprecated: 0.18.2: The Google Contacts service is deprecated. Use Google’s CardDAV interface instead. - */ -const gchar * -gdata_contacts_contact_get_initials (GDataContactsContact *self) -{ - g_return_val_if_fail (GDATA_IS_CONTACTS_CONTACT (self), NULL); - return self->priv->initials; -} - -/** - * gdata_contacts_contact_set_initials: - * @self: a #GDataContactsContact - * @initials: (allow-none): the new initials of the contact, or %NULL - * - * Sets the #GDataContactsContact:initials property to @initials. - * - * If @initials is %NULL, the contact's initials will be removed. - * - * Since: 0.7.0 - * Deprecated: 0.18.2: The Google Contacts service is deprecated. Use Google’s CardDAV interface instead. - */ -void -gdata_contacts_contact_set_initials (GDataContactsContact *self, const gchar *initials) -{ - g_return_if_fail (GDATA_IS_CONTACTS_CONTACT (self)); - - g_free (self->priv->initials); - self->priv->initials = g_strdup (initials); - g_object_notify (G_OBJECT (self), "initials"); -} - -/** - * gdata_contacts_contact_get_maiden_name: - * @self: a #GDataContactsContact - * - * Gets the #GDataContactsContact:maiden-name property. - * - * Return value: the maiden name of the contact, or %NULL - * - * Since: 0.7.0 - * Deprecated: 0.18.2: The Google Contacts service is deprecated. Use Google’s CardDAV interface instead. - */ -const gchar * -gdata_contacts_contact_get_maiden_name (GDataContactsContact *self) -{ - g_return_val_if_fail (GDATA_IS_CONTACTS_CONTACT (self), NULL); - return self->priv->maiden_name; -} - -/** - * gdata_contacts_contact_set_maiden_name: - * @self: a #GDataContactsContact - * @maiden_name: (allow-none): the new maiden name of the contact, or %NULL - * - * Sets the #GDataContactsContact:maiden-name property to @maiden_name. - * - * If @maiden_name is %NULL, the contact's maiden name will be removed. - * - * Since: 0.7.0 - * Deprecated: 0.18.2: The Google Contacts service is deprecated. Use Google’s CardDAV interface instead. - */ -void -gdata_contacts_contact_set_maiden_name (GDataContactsContact *self, const gchar *maiden_name) -{ - g_return_if_fail (GDATA_IS_CONTACTS_CONTACT (self)); - - g_free (self->priv->maiden_name); - self->priv->maiden_name = g_strdup (maiden_name); - g_object_notify (G_OBJECT (self), "maiden-name"); -} - -/** - * gdata_contacts_contact_get_mileage: - * @self: a #GDataContactsContact - * - * Gets the #GDataContactsContact:mileage property. - * - * Return value: a mileage associated with the contact, or %NULL - * - * Since: 0.7.0 - * Deprecated: 0.18.2: The Google Contacts service is deprecated. Use Google’s CardDAV interface instead. - */ -const gchar * -gdata_contacts_contact_get_mileage (GDataContactsContact *self) -{ - g_return_val_if_fail (GDATA_IS_CONTACTS_CONTACT (self), NULL); - return self->priv->mileage; -} - -/** - * gdata_contacts_contact_set_mileage: - * @self: a #GDataContactsContact - * @mileage: (allow-none): the new mileage associated with the contact, or %NULL - * - * Sets the #GDataContactsContact:mileage property to @mileage. - * - * If @mileage is %NULL, the contact's mileage will be removed. - * - * Since: 0.7.0 - * Deprecated: 0.18.2: The Google Contacts service is deprecated. Use Google’s CardDAV interface instead. - */ -void -gdata_contacts_contact_set_mileage (GDataContactsContact *self, const gchar *mileage) -{ - g_return_if_fail (GDATA_IS_CONTACTS_CONTACT (self)); - - g_free (self->priv->mileage); - self->priv->mileage = g_strdup (mileage); - g_object_notify (G_OBJECT (self), "mileage"); -} - -/** - * gdata_contacts_contact_get_occupation: - * @self: a #GDataContactsContact - * - * Gets the #GDataContactsContact:occupation property. - * - * Return value: the contact's occupation, or %NULL - * - * Since: 0.7.0 - * Deprecated: 0.18.2: The Google Contacts service is deprecated. Use Google’s CardDAV interface instead. - */ -const gchar * -gdata_contacts_contact_get_occupation (GDataContactsContact *self) -{ - g_return_val_if_fail (GDATA_IS_CONTACTS_CONTACT (self), NULL); - return self->priv->occupation; -} - -/** - * gdata_contacts_contact_set_occupation: - * @self: a #GDataContactsContact - * @occupation: (allow-none): the contact's new occupation, or %NULL - * - * Sets the #GDataContactsContact:occupation property to @occupation. - * - * If @occupation is %NULL, the contact's occupation will be removed. - * - * Since: 0.7.0 - * Deprecated: 0.18.2: The Google Contacts service is deprecated. Use Google’s CardDAV interface instead. - */ -void -gdata_contacts_contact_set_occupation (GDataContactsContact *self, const gchar *occupation) -{ - g_return_if_fail (GDATA_IS_CONTACTS_CONTACT (self)); - - g_free (self->priv->occupation); - self->priv->occupation = g_strdup (occupation); - g_object_notify (G_OBJECT (self), "occupation"); -} - -/** - * gdata_contacts_contact_get_priority: - * @self: a #GDataContactsContact - * - * Gets the #GDataContactsContact:priority property. - * - * Return value: the contact's priority, or %NULL - * - * Since: 0.7.0 - * Deprecated: 0.18.2: The Google Contacts service is deprecated. Use Google’s CardDAV interface instead. - */ -const gchar * -gdata_contacts_contact_get_priority (GDataContactsContact *self) -{ - g_return_val_if_fail (GDATA_IS_CONTACTS_CONTACT (self), NULL); - return self->priv->priority; -} - -/** - * gdata_contacts_contact_set_priority: - * @self: a #GDataContactsContact - * @priority: (allow-none): the contact's new priority, or %NULL - * - * Sets the #GDataContactsContact:priority property to @priority. - * - * If @priority is %NULL, the contact's priority will be removed. - * - * Since: 0.7.0 - * Deprecated: 0.18.2: The Google Contacts service is deprecated. Use Google’s CardDAV interface instead. - */ -void -gdata_contacts_contact_set_priority (GDataContactsContact *self, const gchar *priority) -{ - g_return_if_fail (GDATA_IS_CONTACTS_CONTACT (self)); - g_return_if_fail (priority == NULL || *priority != '\0'); - - g_free (self->priv->priority); - self->priv->priority = g_strdup (priority); - g_object_notify (G_OBJECT (self), "priority"); -} - -/** - * gdata_contacts_contact_get_sensitivity: - * @self: a #GDataContactsContact - * - * Gets the #GDataContactsContact:sensitivity property. - * - * Return value: the contact's sensitivity, or %NULL - * - * Since: 0.7.0 - * Deprecated: 0.18.2: The Google Contacts service is deprecated. Use Google’s CardDAV interface instead. - */ -const gchar * -gdata_contacts_contact_get_sensitivity (GDataContactsContact *self) -{ - g_return_val_if_fail (GDATA_IS_CONTACTS_CONTACT (self), NULL); - return self->priv->sensitivity; -} - -/** - * gdata_contacts_contact_set_sensitivity: - * @self: a #GDataContactsContact - * @sensitivity: (allow-none): the contact's new sensitivity, or %NULL - * - * Sets the #GDataContactsContact:sensitivity property to @sensitivity. - * - * If @sensitivity is %NULL, the contact's sensitivity will be removed. - * - * Since: 0.7.0 - * Deprecated: 0.18.2: The Google Contacts service is deprecated. Use Google’s CardDAV interface instead. - */ -void -gdata_contacts_contact_set_sensitivity (GDataContactsContact *self, const gchar *sensitivity) -{ - g_return_if_fail (GDATA_IS_CONTACTS_CONTACT (self)); - g_return_if_fail (sensitivity == NULL || *sensitivity != '\0'); - - g_free (self->priv->sensitivity); - self->priv->sensitivity = g_strdup (sensitivity); - g_object_notify (G_OBJECT (self), "sensitivity"); -} - -/** - * gdata_contacts_contact_get_short_name: - * @self: a #GDataContactsContact - * - * Gets the #GDataContactsContact:short-name property. - * - * Return value: the contact's short name, or %NULL - * - * Since: 0.7.0 - * Deprecated: 0.18.2: The Google Contacts service is deprecated. Use Google’s CardDAV interface instead. - */ -const gchar * -gdata_contacts_contact_get_short_name (GDataContactsContact *self) -{ - g_return_val_if_fail (GDATA_IS_CONTACTS_CONTACT (self), NULL); - return self->priv->short_name; -} - -/** - * gdata_contacts_contact_set_short_name: - * @self: a #GDataContactsContact - * @short_name: (allow-none): the contact's new short name, or %NULL - * - * Sets the #GDataContactsContact:short-name property to @short_name. - * - * If @short_name is %NULL, the contact's short name will be removed. - * - * Since: 0.7.0 - * Deprecated: 0.18.2: The Google Contacts service is deprecated. Use Google’s CardDAV interface instead. - */ -void -gdata_contacts_contact_set_short_name (GDataContactsContact *self, const gchar *short_name) -{ - g_return_if_fail (GDATA_IS_CONTACTS_CONTACT (self)); - - g_free (self->priv->short_name); - self->priv->short_name = g_strdup (short_name); - g_object_notify (G_OBJECT (self), "short-name"); -} - -/** - * gdata_contacts_contact_get_subject: - * @self: a #GDataContactsContact - * - * Gets the #GDataContactsContact:subject property. - * - * Return value: the contact's subject, or %NULL - * - * Since: 0.7.0 - * Deprecated: 0.18.2: The Google Contacts service is deprecated. Use Google’s CardDAV interface instead. - */ -const gchar * -gdata_contacts_contact_get_subject (GDataContactsContact *self) -{ - g_return_val_if_fail (GDATA_IS_CONTACTS_CONTACT (self), NULL); - return self->priv->subject; -} - -/** - * gdata_contacts_contact_set_subject: - * @self: a #GDataContactsContact - * @subject: (allow-none): the contact's new subject, or %NULL - * - * Sets the #GDataContactsContact:subject property to @subject. - * - * If @subject is %NULL, the contact's subject will be removed. - * - * Since: 0.7.0 - * Deprecated: 0.18.2: The Google Contacts service is deprecated. Use Google’s CardDAV interface instead. - */ -void -gdata_contacts_contact_set_subject (GDataContactsContact *self, const gchar *subject) -{ - g_return_if_fail (GDATA_IS_CONTACTS_CONTACT (self)); - - g_free (self->priv->subject); - self->priv->subject = g_strdup (subject); - g_object_notify (G_OBJECT (self), "subject"); -} - -/** - * gdata_contacts_contact_add_email_address: - * @self: a #GDataContactsContact - * @email_address: a #GDataGDEmailAddress to add - * - * Adds an e-mail address to the contact's list of e-mail addresses and increments its reference count. - * - * Note that only one e-mail address per contact may be marked as "primary". Insertion and update operations - * (with gdata_contacts_service_insert_contact()) will return an error if more than one e-mail address - * is marked as primary. - * - * Duplicate e-mail addresses will not be added to the list. - * - * Since: 0.2.0 - * Deprecated: 0.18.2: The Google Contacts service is deprecated. Use Google’s CardDAV interface instead. - */ -void -gdata_contacts_contact_add_email_address (GDataContactsContact *self, GDataGDEmailAddress *email_address) -{ - g_return_if_fail (GDATA_IS_CONTACTS_CONTACT (self)); - g_return_if_fail (GDATA_IS_GD_EMAIL_ADDRESS (email_address)); - - if (g_list_find_custom (self->priv->email_addresses, email_address, (GCompareFunc) gdata_comparable_compare) == NULL) - self->priv->email_addresses = g_list_append (self->priv->email_addresses, g_object_ref (email_address)); -} - -/** - * gdata_contacts_contact_get_email_addresses: - * @self: a #GDataContactsContact - * - * Gets a list of the e-mail addresses owned by the contact. - * - * Return value: (element-type GData.GDEmailAddress) (transfer none): a #GList of #GDataGDEmailAddresses, or %NULL - * - * Since: 0.2.0 - * Deprecated: 0.18.2: The Google Contacts service is deprecated. Use Google’s CardDAV interface instead. - */ -GList * -gdata_contacts_contact_get_email_addresses (GDataContactsContact *self) -{ - g_return_val_if_fail (GDATA_IS_CONTACTS_CONTACT (self), NULL); - return self->priv->email_addresses; -} - -/** - * gdata_contacts_contact_get_primary_email_address: - * @self: a #GDataContactsContact - * - * Gets the contact's primary e-mail address, if one exists. - * - * Return value: (transfer none): a #GDataGDEmailAddress, or %NULL - * - * Since: 0.2.0 - * Deprecated: 0.18.2: The Google Contacts service is deprecated. Use Google’s CardDAV interface instead. - */ -GDataGDEmailAddress * -gdata_contacts_contact_get_primary_email_address (GDataContactsContact *self) -{ - GList *i; - - g_return_val_if_fail (GDATA_IS_CONTACTS_CONTACT (self), NULL); - - for (i = self->priv->email_addresses; i != NULL; i = i->next) { - if (gdata_gd_email_address_is_primary (GDATA_GD_EMAIL_ADDRESS (i->data)) == TRUE) - return GDATA_GD_EMAIL_ADDRESS (i->data); - } - - return NULL; -} - -/** - * gdata_contacts_contact_remove_all_email_addresses: - * @self: a #GDataContactsContact - * - * Removes all e-mail addresses from the contact. - * - * Since: 0.4.0 - * Deprecated: 0.18.2: The Google Contacts service is deprecated. Use Google’s CardDAV interface instead. - */ -void -gdata_contacts_contact_remove_all_email_addresses (GDataContactsContact *self) -{ - GDataContactsContactPrivate *priv = self->priv; - - g_return_if_fail (GDATA_IS_CONTACTS_CONTACT (self)); - - g_list_free_full (priv->email_addresses, g_object_unref); - priv->email_addresses = NULL; -} - -/** - * gdata_contacts_contact_add_im_address: - * @self: a #GDataContactsContact - * @im_address: a #GDataGDIMAddress to add - * - * Adds an IM (instant messaging) address to the contact's list of IM addresses and increments its reference count. - * - * Note that only one IM address per contact may be marked as "primary". Insertion and update operations - * (with gdata_contacts_service_insert_contact()) will return an error if more than one IM address - * is marked as primary. - * - * Duplicate IM addresses will not be added to the list. - * - * Since: 0.2.0 - * Deprecated: 0.18.2: The Google Contacts service is deprecated. Use Google’s CardDAV interface instead. - */ -void -gdata_contacts_contact_add_im_address (GDataContactsContact *self, GDataGDIMAddress *im_address) -{ - g_return_if_fail (GDATA_IS_CONTACTS_CONTACT (self)); - g_return_if_fail (GDATA_IS_GD_IM_ADDRESS (im_address)); - - if (g_list_find_custom (self->priv->im_addresses, im_address, (GCompareFunc) gdata_comparable_compare) == NULL) - self->priv->im_addresses = g_list_append (self->priv->im_addresses, g_object_ref (im_address)); -} - -/** - * gdata_contacts_contact_get_im_addresses: - * @self: a #GDataContactsContact - * - * Gets a list of the IM addresses owned by the contact. - * - * Return value: (element-type GData.GDIMAddress) (transfer none): a #GList of #GDataGDIMAddresses, or %NULL - * - * Since: 0.2.0 - * Deprecated: 0.18.2: The Google Contacts service is deprecated. Use Google’s CardDAV interface instead. - */ -GList * -gdata_contacts_contact_get_im_addresses (GDataContactsContact *self) -{ - g_return_val_if_fail (GDATA_IS_CONTACTS_CONTACT (self), NULL); - return self->priv->im_addresses; -} - -/** - * gdata_contacts_contact_get_primary_im_address: - * @self: a #GDataContactsContact - * - * Gets the contact's primary IM address, if one exists. - * - * Return value: (transfer none): a #GDataGDIMAddress, or %NULL - * - * Since: 0.2.0 - * Deprecated: 0.18.2: The Google Contacts service is deprecated. Use Google’s CardDAV interface instead. - */ -GDataGDIMAddress * -gdata_contacts_contact_get_primary_im_address (GDataContactsContact *self) -{ - GList *i; - - g_return_val_if_fail (GDATA_IS_CONTACTS_CONTACT (self), NULL); - - for (i = self->priv->im_addresses; i != NULL; i = i->next) { - if (gdata_gd_im_address_is_primary (GDATA_GD_IM_ADDRESS (i->data)) == TRUE) - return GDATA_GD_IM_ADDRESS (i->data); - } - - return NULL; -} - -/** - * gdata_contacts_contact_remove_all_im_addresses: - * @self: a #GDataContactsContact - * - * Removes all IM addresses from the contact. - * - * Since: 0.4.0 - * Deprecated: 0.18.2: The Google Contacts service is deprecated. Use Google’s CardDAV interface instead. - */ -void -gdata_contacts_contact_remove_all_im_addresses (GDataContactsContact *self) -{ - GDataContactsContactPrivate *priv = self->priv; - - g_return_if_fail (GDATA_IS_CONTACTS_CONTACT (self)); - - g_list_free_full (priv->im_addresses, g_object_unref); - priv->im_addresses = NULL; -} - -/** - * gdata_contacts_contact_add_phone_number: - * @self: a #GDataContactsContact - * @phone_number: a #GDataGDPhoneNumber to add - * - * Adds a phone number to the contact's list of phone numbers and increments its reference count - * - * Note that only one phone number per contact may be marked as "primary". Insertion and update operations - * (with gdata_contacts_service_insert_contact()) will return an error if more than one phone number - * is marked as primary. - * - * Duplicate phone numbers will not be added to the list. - * - * Since: 0.2.0 - * Deprecated: 0.18.2: The Google Contacts service is deprecated. Use Google’s CardDAV interface instead. - */ -void -gdata_contacts_contact_add_phone_number (GDataContactsContact *self, GDataGDPhoneNumber *phone_number) -{ - g_return_if_fail (GDATA_IS_CONTACTS_CONTACT (self)); - g_return_if_fail (GDATA_IS_GD_PHONE_NUMBER (phone_number)); - - if (g_list_find_custom (self->priv->phone_numbers, phone_number, (GCompareFunc) gdata_comparable_compare) == NULL) - self->priv->phone_numbers = g_list_append (self->priv->phone_numbers, g_object_ref (phone_number)); -} - -/** - * gdata_contacts_contact_get_phone_numbers: - * @self: a #GDataContactsContact - * - * Gets a list of the phone numbers owned by the contact. - * - * Return value: (element-type GData.GDPhoneNumber) (transfer none): a #GList of #GDataGDPhoneNumbers, or %NULL - * - * Since: 0.2.0 - * Deprecated: 0.18.2: The Google Contacts service is deprecated. Use Google’s CardDAV interface instead. - */ -GList * -gdata_contacts_contact_get_phone_numbers (GDataContactsContact *self) -{ - g_return_val_if_fail (GDATA_IS_CONTACTS_CONTACT (self), NULL); - return self->priv->phone_numbers; -} - -/** - * gdata_contacts_contact_get_primary_phone_number: - * @self: a #GDataContactsContact - * - * Gets the contact's primary phone number, if one exists. - * - * Return value: (transfer none): a #GDataGDPhoneNumber, or %NULL - * - * Since: 0.2.0 - * Deprecated: 0.18.2: The Google Contacts service is deprecated. Use Google’s CardDAV interface instead. - */ -GDataGDPhoneNumber * -gdata_contacts_contact_get_primary_phone_number (GDataContactsContact *self) -{ - GList *i; - - g_return_val_if_fail (GDATA_IS_CONTACTS_CONTACT (self), NULL); - - for (i = self->priv->phone_numbers; i != NULL; i = i->next) { - if (gdata_gd_phone_number_is_primary (GDATA_GD_PHONE_NUMBER (i->data)) == TRUE) - return GDATA_GD_PHONE_NUMBER (i->data); - } - - return NULL; -} - -/** - * gdata_contacts_contact_remove_all_phone_numbers: - * @self: a #GDataContactsContact - * - * Removes all phone numbers from the contact. - * - * Since: 0.4.0 - * Deprecated: 0.18.2: The Google Contacts service is deprecated. Use Google’s CardDAV interface instead. - */ -void -gdata_contacts_contact_remove_all_phone_numbers (GDataContactsContact *self) -{ - GDataContactsContactPrivate *priv = self->priv; - - g_return_if_fail (GDATA_IS_CONTACTS_CONTACT (self)); - - g_list_free_full (priv->phone_numbers, g_object_unref); - priv->phone_numbers = NULL; -} - -/** - * gdata_contacts_contact_add_postal_address: - * @self: a #GDataContactsContact - * @postal_address: a #GDataGDPostalAddress to add - * - * Adds a postal address to the contact's list of postal addresses and increments its reference count. - * - * Note that only one postal address per contact may be marked as "primary". Insertion and update operations - * (with gdata_contacts_service_insert_contact()) will return an error if more than one postal address - * is marked as primary. - * - * Duplicate postal addresses will not be added to the list. - * - * Since: 0.2.0 - * Deprecated: 0.18.2: The Google Contacts service is deprecated. Use Google’s CardDAV interface instead. - */ -void -gdata_contacts_contact_add_postal_address (GDataContactsContact *self, GDataGDPostalAddress *postal_address) -{ - g_return_if_fail (GDATA_IS_CONTACTS_CONTACT (self)); - g_return_if_fail (GDATA_IS_GD_POSTAL_ADDRESS (postal_address)); - - if (g_list_find_custom (self->priv->postal_addresses, postal_address, (GCompareFunc) gdata_comparable_compare) == NULL) - self->priv->postal_addresses = g_list_append (self->priv->postal_addresses, g_object_ref (postal_address)); -} - -/** - * gdata_contacts_contact_get_postal_addresses: - * @self: a #GDataContactsContact - * - * Gets a list of the postal addresses owned by the contact. - * - * Return value: (element-type GData.GDPostalAddress) (transfer none): a #GList of #GDataGDPostalAddresses, or %NULL - * - * Since: 0.2.0 - * Deprecated: 0.18.2: The Google Contacts service is deprecated. Use Google’s CardDAV interface instead. - */ -GList * -gdata_contacts_contact_get_postal_addresses (GDataContactsContact *self) -{ - g_return_val_if_fail (GDATA_IS_CONTACTS_CONTACT (self), NULL); - return self->priv->postal_addresses; -} - -/** - * gdata_contacts_contact_get_primary_postal_address: - * @self: a #GDataContactsContact - * - * Gets the contact's primary postal address, if one exists. - * - * Return value: (transfer none): a #GDataGDPostalAddress, or %NULL - * - * Since: 0.2.0 - * Deprecated: 0.18.2: The Google Contacts service is deprecated. Use Google’s CardDAV interface instead. - */ -GDataGDPostalAddress * -gdata_contacts_contact_get_primary_postal_address (GDataContactsContact *self) -{ - GList *i; - - g_return_val_if_fail (GDATA_IS_CONTACTS_CONTACT (self), NULL); - - for (i = self->priv->postal_addresses; i != NULL; i = i->next) { - if (gdata_gd_postal_address_is_primary (GDATA_GD_POSTAL_ADDRESS (i->data)) == TRUE) - return GDATA_GD_POSTAL_ADDRESS (i->data); - } - - return NULL; -} - -/** - * gdata_contacts_contact_remove_all_postal_addresses: - * @self: a #GDataContactsContact - * - * Removes all postal addresses from the contact. - * - * Since: 0.4.0 - * Deprecated: 0.18.2: The Google Contacts service is deprecated. Use Google’s CardDAV interface instead. - */ -void -gdata_contacts_contact_remove_all_postal_addresses (GDataContactsContact *self) -{ - GDataContactsContactPrivate *priv = self->priv; - - g_return_if_fail (GDATA_IS_CONTACTS_CONTACT (self)); - - g_list_free_full (priv->postal_addresses, g_object_unref); - priv->postal_addresses = NULL; -} - -/** - * gdata_contacts_contact_add_organization: - * @self: a #GDataContactsContact - * @organization: a #GDataGDOrganization to add - * - * Adds an organization to the contact's list of organizations (e.g. employers) and increments its reference count. - * - * Note that only one organization per contact may be marked as "primary". Insertion and update operations - * (with gdata_contacts_service_insert_contact()) will return an error if more than one organization - * is marked as primary. - * - * Duplicate organizations will not be added to the list. - * - * Since: 0.2.0 - * Deprecated: 0.18.2: The Google Contacts service is deprecated. Use Google’s CardDAV interface instead. - */ -void -gdata_contacts_contact_add_organization (GDataContactsContact *self, GDataGDOrganization *organization) -{ - g_return_if_fail (GDATA_IS_CONTACTS_CONTACT (self)); - g_return_if_fail (organization != NULL); - - if (g_list_find_custom (self->priv->organizations, organization, (GCompareFunc) gdata_comparable_compare) == NULL) - self->priv->organizations = g_list_append (self->priv->organizations, g_object_ref (organization)); -} - -/** - * gdata_contacts_contact_get_organizations: - * @self: a #GDataContactsContact - * - * Gets a list of the organizations to which the contact belongs. - * - * Return value: (element-type GData.GDOrganization) (transfer none): a #GList of #GDataGDOrganizations, or %NULL - * - * Since: 0.2.0 - * Deprecated: 0.18.2: The Google Contacts service is deprecated. Use Google’s CardDAV interface instead. - */ -GList * -gdata_contacts_contact_get_organizations (GDataContactsContact *self) -{ - g_return_val_if_fail (GDATA_IS_CONTACTS_CONTACT (self), NULL); - return self->priv->organizations; -} - -/** - * gdata_contacts_contact_get_primary_organization: - * @self: a #GDataContactsContact - * - * Gets the contact's primary organization, if one exists. - * - * Return value: (transfer none): a #GDataGDOrganization, or %NULL - * - * Since: 0.2.0 - * Deprecated: 0.18.2: The Google Contacts service is deprecated. Use Google’s CardDAV interface instead. - */ -GDataGDOrganization * -gdata_contacts_contact_get_primary_organization (GDataContactsContact *self) -{ - GList *i; - - g_return_val_if_fail (GDATA_IS_CONTACTS_CONTACT (self), NULL); - - for (i = self->priv->organizations; i != NULL; i = i->next) { - if (gdata_gd_organization_is_primary (GDATA_GD_ORGANIZATION (i->data)) == TRUE) - return GDATA_GD_ORGANIZATION (i->data); - } - - return NULL; -} - -/** - * gdata_contacts_contact_remove_all_organizations: - * @self: a #GDataContactsContact - * - * Removes all organizations from the contact. - * - * Since: 0.4.0 - * Deprecated: 0.18.2: The Google Contacts service is deprecated. Use Google’s CardDAV interface instead. - */ -void -gdata_contacts_contact_remove_all_organizations (GDataContactsContact *self) -{ - GDataContactsContactPrivate *priv = self->priv; - - g_return_if_fail (GDATA_IS_CONTACTS_CONTACT (self)); - - g_list_free_full (priv->organizations, g_object_unref); - priv->organizations = NULL; -} - -/** - * gdata_contacts_contact_add_jot: - * @self: a #GDataContactsContact - * @jot: a #GDataGContactJot to add - * - * Adds a jot to the contact's list of jots and increments its reference count. - * - * Duplicate jots will be added to the list, and multiple jots with the same relation type can be added to a single contact. - * - * Since: 0.7.0 - * Deprecated: 0.18.2: The Google Contacts service is deprecated. Use Google’s CardDAV interface instead. - */ -void -gdata_contacts_contact_add_jot (GDataContactsContact *self, GDataGContactJot *jot) -{ - g_return_if_fail (GDATA_IS_CONTACTS_CONTACT (self)); - g_return_if_fail (GDATA_IS_GCONTACT_JOT (jot)); - - self->priv->jots = g_list_append (self->priv->jots, g_object_ref (jot)); -} - -/** - * gdata_contacts_contact_get_jots: - * @self: a #GDataContactsContact - * - * Gets a list of the jots attached to the contact. - * - * Return value: (element-type GData.GContactJot) (transfer none): a #GList of #GDataGContactJots, or %NULL - * - * Since: 0.7.0 - * Deprecated: 0.18.2: The Google Contacts service is deprecated. Use Google’s CardDAV interface instead. - */ -GList * -gdata_contacts_contact_get_jots (GDataContactsContact *self) -{ - g_return_val_if_fail (GDATA_IS_CONTACTS_CONTACT (self), NULL); - return self->priv->jots; -} - -/** - * gdata_contacts_contact_remove_all_jots: - * @self: a #GDataContactsContact - * - * Removes all jots from the contact. - * - * Since: 0.7.0 - * Deprecated: 0.18.2: The Google Contacts service is deprecated. Use Google’s CardDAV interface instead. - */ -void -gdata_contacts_contact_remove_all_jots (GDataContactsContact *self) -{ - GDataContactsContactPrivate *priv = self->priv; - - g_return_if_fail (GDATA_IS_CONTACTS_CONTACT (self)); - - g_list_free_full (priv->jots, g_object_unref); - priv->jots = NULL; -} - -/** - * gdata_contacts_contact_add_relation: - * @self: a #GDataContactsContact - * @relation: a #GDataGContactRelation to add - * - * Adds a relation to the contact's list of relations and increments its reference count. - * - * Duplicate relations will be added to the list, and multiple relations with the same relation type can be added to a single contact. - * Though it may not make sense for some relation types to be repeated, adding them is allowed. - * - * Since: 0.7.0 - * Deprecated: 0.18.2: The Google Contacts service is deprecated. Use Google’s CardDAV interface instead. - */ -void -gdata_contacts_contact_add_relation (GDataContactsContact *self, GDataGContactRelation *relation) -{ - g_return_if_fail (GDATA_IS_CONTACTS_CONTACT (self)); - g_return_if_fail (GDATA_IS_GCONTACT_RELATION (relation)); - - self->priv->relations = g_list_append (self->priv->relations, g_object_ref (relation)); -} - -/** - * gdata_contacts_contact_get_relations: - * @self: a #GDataContactsContact - * - * Gets a list of the relations of the contact. - * - * Return value: (element-type GData.GContactRelation) (transfer none): a #GList of #GDataGContactRelations, or %NULL - * - * Since: 0.7.0 - * Deprecated: 0.18.2: The Google Contacts service is deprecated. Use Google’s CardDAV interface instead. - */ -GList * -gdata_contacts_contact_get_relations (GDataContactsContact *self) -{ - g_return_val_if_fail (GDATA_IS_CONTACTS_CONTACT (self), NULL); - return self->priv->relations; -} - -/** - * gdata_contacts_contact_remove_all_relations: - * @self: a #GDataContactsContact - * - * Removes all relations from the contact. - * - * Since: 0.7.0 - * Deprecated: 0.18.2: The Google Contacts service is deprecated. Use Google’s CardDAV interface instead. - */ -void -gdata_contacts_contact_remove_all_relations (GDataContactsContact *self) -{ - GDataContactsContactPrivate *priv = self->priv; - - g_return_if_fail (GDATA_IS_CONTACTS_CONTACT (self)); - - g_list_free_full (priv->relations, g_object_unref); - priv->relations = NULL; -} - -/** - * gdata_contacts_contact_add_website: - * @self: a #GDataContactsContact - * @website: a #GDataGContactWebsite to add - * - * Adds a website to the contact's list of websites and increments its reference count. - * - * Duplicate websites will not be added to the list, though the same URI may appear in several #GDataGContactWebsites with different - * relation types or labels. - * - * Since: 0.7.0 - * Deprecated: 0.18.2: The Google Contacts service is deprecated. Use Google’s CardDAV interface instead. - */ -void -gdata_contacts_contact_add_website (GDataContactsContact *self, GDataGContactWebsite *website) -{ - g_return_if_fail (GDATA_IS_CONTACTS_CONTACT (self)); - g_return_if_fail (GDATA_IS_GCONTACT_WEBSITE (website)); - - if (g_list_find_custom (self->priv->websites, website, (GCompareFunc) gdata_comparable_compare) == NULL) - self->priv->websites = g_list_append (self->priv->websites, g_object_ref (website)); -} - -/** - * gdata_contacts_contact_get_websites: - * @self: a #GDataContactsContact - * - * Gets a list of the websites of the contact. - * - * Return value: (element-type GData.GContactWebsite) (transfer none): a #GList of #GDataGContactWebsites, or %NULL - * - * Since: 0.7.0 - * Deprecated: 0.18.2: The Google Contacts service is deprecated. Use Google’s CardDAV interface instead. - */ -GList * -gdata_contacts_contact_get_websites (GDataContactsContact *self) -{ - g_return_val_if_fail (GDATA_IS_CONTACTS_CONTACT (self), NULL); - return self->priv->websites; -} - -/** - * gdata_contacts_contact_get_primary_website: - * @self: a #GDataContactsContact - * - * Gets the contact's primary website, if one exists. - * - * Return value: (transfer none): a #GDataGContactWebsite, or %NULL - * - * Since: 0.7.0 - * Deprecated: 0.18.2: The Google Contacts service is deprecated. Use Google’s CardDAV interface instead. - */ -GDataGContactWebsite * -gdata_contacts_contact_get_primary_website (GDataContactsContact *self) -{ - GList *i; - - g_return_val_if_fail (GDATA_IS_CONTACTS_CONTACT (self), NULL); - - for (i = self->priv->websites; i != NULL; i = i->next) { - if (gdata_gcontact_website_is_primary (GDATA_GCONTACT_WEBSITE (i->data)) == TRUE) - return GDATA_GCONTACT_WEBSITE (i->data); - } - - return NULL; -} - -/** - * gdata_contacts_contact_remove_all_websites: - * @self: a #GDataContactsContact - * - * Removes all websites from the contact. - * - * Since: 0.7.0 - * Deprecated: 0.18.2: The Google Contacts service is deprecated. Use Google’s CardDAV interface instead. - */ -void -gdata_contacts_contact_remove_all_websites (GDataContactsContact *self) -{ - GDataContactsContactPrivate *priv = self->priv; - - g_return_if_fail (GDATA_IS_CONTACTS_CONTACT (self)); - - g_list_free_full (priv->websites, g_object_unref); - priv->websites = NULL; -} - -/** - * gdata_contacts_contact_add_event: - * @self: a #GDataContactsContact - * @event: a #GDataGContactEvent to add - * - * Adds an event to the contact's list of events and increments its reference count. - * - * Duplicate events will be added to the list, and multiple events with the same event type can be added to a single contact. - * Though it may not make sense for some event types to be repeated, adding them is allowed. - * - * Since: 0.7.0 - * Deprecated: 0.18.2: The Google Contacts service is deprecated. Use Google’s CardDAV interface instead. - */ -void -gdata_contacts_contact_add_event (GDataContactsContact *self, GDataGContactEvent *event) -{ - g_return_if_fail (GDATA_IS_CONTACTS_CONTACT (self)); - g_return_if_fail (GDATA_IS_GCONTACT_EVENT (event)); - - self->priv->events = g_list_append (self->priv->events, g_object_ref (event)); -} - -/** - * gdata_contacts_contact_get_events: - * @self: a #GDataContactsContact - * - * Gets a list of the events of the contact. - * - * Return value: (element-type GData.GContactEvent) (transfer none): a #GList of #GDataGContactEvents, or %NULL - * - * Since: 0.7.0 - * Deprecated: 0.18.2: The Google Contacts service is deprecated. Use Google’s CardDAV interface instead. - */ -GList * -gdata_contacts_contact_get_events (GDataContactsContact *self) -{ - g_return_val_if_fail (GDATA_IS_CONTACTS_CONTACT (self), NULL); - return self->priv->events; -} - -/** - * gdata_contacts_contact_remove_all_events: - * @self: a #GDataContactsContact - * - * Removes all events from the contact. - * - * Since: 0.7.0 - * Deprecated: 0.18.2: The Google Contacts service is deprecated. Use Google’s CardDAV interface instead. - */ -void -gdata_contacts_contact_remove_all_events (GDataContactsContact *self) -{ - GDataContactsContactPrivate *priv = self->priv; - - g_return_if_fail (GDATA_IS_CONTACTS_CONTACT (self)); - - g_list_free_full (priv->events, g_object_unref); - priv->events = NULL; -} - -/** - * gdata_contacts_contact_add_calendar: - * @self: a #GDataContactsContact - * @calendar: a #GDataGContactCalendar to add - * - * Adds a calendar to the contact's list of calendars and increments its reference count. - * - * Duplicate calendars will not be added to the list, though the same URI may appear in several #GDataGContactCalendars with different - * relation types or labels. - * - * Since: 0.7.0 - * Deprecated: 0.18.2: The Google Contacts service is deprecated. Use Google’s CardDAV interface instead. - */ -void -gdata_contacts_contact_add_calendar (GDataContactsContact *self, GDataGContactCalendar *calendar) -{ - g_return_if_fail (GDATA_IS_CONTACTS_CONTACT (self)); - g_return_if_fail (GDATA_IS_GCONTACT_CALENDAR (calendar)); - - if (g_list_find_custom (self->priv->calendars, calendar, (GCompareFunc) gdata_comparable_compare) == NULL) - self->priv->calendars = g_list_append (self->priv->calendars, g_object_ref (calendar)); -} - -/** - * gdata_contacts_contact_get_calendars: - * @self: a #GDataContactsContact - * - * Gets a list of the calendars of the contact. - * - * Return value: (element-type GData.GContactCalendar) (transfer none): a #GList of #GDataGContactCalendars, or %NULL - * - * Since: 0.7.0 - * Deprecated: 0.18.2: The Google Contacts service is deprecated. Use Google’s CardDAV interface instead. - */ -GList * -gdata_contacts_contact_get_calendars (GDataContactsContact *self) -{ - g_return_val_if_fail (GDATA_IS_CONTACTS_CONTACT (self), NULL); - return self->priv->calendars; -} - -/** - * gdata_contacts_contact_get_primary_calendar: - * @self: a #GDataContactsContact - * - * Gets the contact's primary calendar, if one exists. - * - * Return value: (transfer none): a #GDataGContactCalendar, or %NULL - * - * Since: 0.7.0 - * Deprecated: 0.18.2: The Google Contacts service is deprecated. Use Google’s CardDAV interface instead. - */ -GDataGContactCalendar * -gdata_contacts_contact_get_primary_calendar (GDataContactsContact *self) -{ - GList *i; - - g_return_val_if_fail (GDATA_IS_CONTACTS_CONTACT (self), NULL); - - for (i = self->priv->calendars; i != NULL; i = i->next) { - if (gdata_gcontact_calendar_is_primary (GDATA_GCONTACT_CALENDAR (i->data)) == TRUE) - return GDATA_GCONTACT_CALENDAR (i->data); - } - - return NULL; -} - -/** - * gdata_contacts_contact_remove_all_calendars: - * @self: a #GDataContactsContact - * - * Removes all calendars from the contact. - * - * Since: 0.7.0 - * Deprecated: 0.18.2: The Google Contacts service is deprecated. Use Google’s CardDAV interface instead. - */ -void -gdata_contacts_contact_remove_all_calendars (GDataContactsContact *self) -{ - GDataContactsContactPrivate *priv = self->priv; - - g_return_if_fail (GDATA_IS_CONTACTS_CONTACT (self)); - - g_list_free_full (priv->calendars, g_object_unref); - priv->calendars = NULL; -} - -/** - * gdata_contacts_contact_add_external_id: - * @self: a #GDataContactsContact - * @external_id: a #GDataGContactExternalID to add - * - * Adds an external ID to the contact's list of external IDs and increments its reference count. - * - * Duplicate IDs will not be added to the list. - * - * Since: 0.7.0 - * Deprecated: 0.18.2: The Google Contacts service is deprecated. Use Google’s CardDAV interface instead. - */ -void -gdata_contacts_contact_add_external_id (GDataContactsContact *self, GDataGContactExternalID *external_id) -{ - g_return_if_fail (GDATA_IS_CONTACTS_CONTACT (self)); - g_return_if_fail (GDATA_IS_GCONTACT_EXTERNAL_ID (external_id)); - - if (g_list_find_custom (self->priv->external_ids, external_id, (GCompareFunc) gdata_comparable_compare) == NULL) - self->priv->external_ids = g_list_append (self->priv->external_ids, g_object_ref (external_id)); -} - -/** - * gdata_contacts_contact_get_external_ids: - * @self: a #GDataContactsContact - * - * Gets a list of the external IDs of the contact. - * - * Return value: (element-type GData.GContactExternalID) (transfer none): a #GList of #GDataGContactExternalIDs, or %NULL - * - * Since: 0.7.0 - * Deprecated: 0.18.2: The Google Contacts service is deprecated. Use Google’s CardDAV interface instead. - */ -GList * -gdata_contacts_contact_get_external_ids (GDataContactsContact *self) -{ - g_return_val_if_fail (GDATA_IS_CONTACTS_CONTACT (self), NULL); - return self->priv->external_ids; -} - -/** - * gdata_contacts_contact_remove_all_external_ids: - * @self: a #GDataContactsContact - * - * Removes all external IDs from the contact. - * - * Since: 0.7.0 - * Deprecated: 0.18.2: The Google Contacts service is deprecated. Use Google’s CardDAV interface instead. - */ -void -gdata_contacts_contact_remove_all_external_ids (GDataContactsContact *self) -{ - GDataContactsContactPrivate *priv = self->priv; - - g_return_if_fail (GDATA_IS_CONTACTS_CONTACT (self)); - - g_list_free_full (priv->external_ids, g_object_unref); - priv->external_ids = NULL; -} - -/** - * gdata_contacts_contact_add_hobby: - * @self: a #GDataContactsContact - * @hobby: a hobby to add - * - * Adds a hobby to the contact's list of hobbies, copying it in the process. - * - * Duplicate hobbies will not be added to the list. - * - * Since: 0.7.0 - * Deprecated: 0.18.2: The Google Contacts service is deprecated. Use Google’s CardDAV interface instead. - */ -void -gdata_contacts_contact_add_hobby (GDataContactsContact *self, const gchar *hobby) -{ - g_return_if_fail (GDATA_IS_CONTACTS_CONTACT (self)); - g_return_if_fail (hobby != NULL && *hobby != '\0'); - - if (g_list_find_custom (self->priv->hobbies, hobby, (GCompareFunc) g_strcmp0) == NULL) - self->priv->hobbies = g_list_append (self->priv->hobbies, g_strdup (hobby)); -} - -/** - * gdata_contacts_contact_get_hobbies: - * @self: a #GDataContactsContact - * - * Gets a list of the hobbies of the contact. - * - * Return value: (element-type utf8) (transfer none): a #GList of hobby strings, or %NULL - * - * Since: 0.7.0 - * Deprecated: 0.18.2: The Google Contacts service is deprecated. Use Google’s CardDAV interface instead. - */ -GList * -gdata_contacts_contact_get_hobbies (GDataContactsContact *self) -{ - g_return_val_if_fail (GDATA_IS_CONTACTS_CONTACT (self), NULL); - return self->priv->hobbies; -} - -/** - * gdata_contacts_contact_remove_all_hobbies: - * @self: a #GDataContactsContact - * - * Removes all hobbies from the contact. - * - * Since: 0.7.0 - * Deprecated: 0.18.2: The Google Contacts service is deprecated. Use Google’s CardDAV interface instead. - */ -void -gdata_contacts_contact_remove_all_hobbies (GDataContactsContact *self) -{ - GDataContactsContactPrivate *priv = self->priv; - - g_return_if_fail (GDATA_IS_CONTACTS_CONTACT (self)); - - g_list_free_full (priv->hobbies, g_free); - priv->hobbies = NULL; -} - -/** - * gdata_contacts_contact_add_language: - * @self: a #GDataContactsContact - * @language: a #GDataGContactLanguage to add - * - * Adds a language to the contact's list of languages and increments its reference count. - * - * Duplicate languages will not be added to the list. - * - * Since: 0.7.0 - * Deprecated: 0.18.2: The Google Contacts service is deprecated. Use Google’s CardDAV interface instead. - */ -void -gdata_contacts_contact_add_language (GDataContactsContact *self, GDataGContactLanguage *language) -{ - g_return_if_fail (GDATA_IS_CONTACTS_CONTACT (self)); - g_return_if_fail (GDATA_IS_GCONTACT_LANGUAGE (language)); - - if (g_list_find_custom (self->priv->languages, language, (GCompareFunc) gdata_comparable_compare) == NULL) - self->priv->languages = g_list_append (self->priv->languages, g_object_ref (language)); -} - -/** - * gdata_contacts_contact_get_languages: - * @self: a #GDataContactsContact - * - * Gets a list of the languages of the contact. - * - * Return value: (element-type GData.GContactLanguage) (transfer none): a #GList of #GDataGContactLanguages, or %NULL - * - * Since: 0.7.0 - * Deprecated: 0.18.2: The Google Contacts service is deprecated. Use Google’s CardDAV interface instead. - */ -GList * -gdata_contacts_contact_get_languages (GDataContactsContact *self) -{ - g_return_val_if_fail (GDATA_IS_CONTACTS_CONTACT (self), NULL); - return self->priv->languages; -} - -/** - * gdata_contacts_contact_remove_all_languages: - * @self: a #GDataContactsContact - * - * Removes all languages from the contact. - * - * Since: 0.7.0 - * Deprecated: 0.18.2: The Google Contacts service is deprecated. Use Google’s CardDAV interface instead. - */ -void -gdata_contacts_contact_remove_all_languages (GDataContactsContact *self) -{ - GDataContactsContactPrivate *priv = self->priv; - - g_return_if_fail (GDATA_IS_CONTACTS_CONTACT (self)); - - g_list_free_full (priv->languages, g_object_unref); - priv->languages = NULL; -} - -/** - * gdata_contacts_contact_get_extended_property: - * @self: a #GDataContactsContact - * @name: the property name; an arbitrary, unique string - * - * Gets the value of an extended property of the contact. Each contact can have up to 10 client-set extended - * properties to store data of the client's choosing. - * - * Return value: the property's value, or %NULL - * - * Since: 0.2.0 - * Deprecated: 0.18.2: The Google Contacts service is deprecated. Use Google’s CardDAV interface instead. - */ -const gchar * -gdata_contacts_contact_get_extended_property (GDataContactsContact *self, const gchar *name) -{ - g_return_val_if_fail (GDATA_IS_CONTACTS_CONTACT (self), NULL); - g_return_val_if_fail (name != NULL && *name != '\0', NULL); - return g_hash_table_lookup (self->priv->extended_properties, name); -} - -/** - * gdata_contacts_contact_get_extended_properties: - * @self: a #GDataContactsContact - * - * Gets the full list of extended properties of the contact; a hash table mapping property name to value. - * - * Return value: (transfer none): a #GHashTable of extended properties - * - * Since: 0.4.0 - * Deprecated: 0.18.2: The Google Contacts service is deprecated. Use Google’s CardDAV interface instead. - */ -GHashTable * -gdata_contacts_contact_get_extended_properties (GDataContactsContact *self) -{ - g_return_val_if_fail (GDATA_IS_CONTACTS_CONTACT (self), NULL); - return self->priv->extended_properties; -} - -/** - * gdata_contacts_contact_set_extended_property: - * @self: a #GDataContactsContact - * @name: the property name; an arbitrary, unique string - * @value: (allow-none): the property value, or %NULL - * - * Sets the value of a contact's extended property. Extended property names are unique (but of the client's choosing), - * and reusing the same property name will result in the old value of that property being overwritten. - * - * To unset a property, set @value to %NULL or an empty string. - * - * A contact may have up to 10 extended properties, and each should be reasonably small (i.e. not a photo or ringtone). - * For more information, see the online documentation. - * %FALSE will be returned if you attempt to add more than 10 extended properties. - * - * Return value: %TRUE if the property was updated or deleted successfully, %FALSE otherwise - * - * Since: 0.2.0 - * Deprecated: 0.18.2: The Google Contacts service is deprecated. Use Google’s CardDAV interface instead. - */ -gboolean -gdata_contacts_contact_set_extended_property (GDataContactsContact *self, const gchar *name, const gchar *value) -{ - GHashTable *extended_properties = self->priv->extended_properties; - - g_return_val_if_fail (GDATA_IS_CONTACTS_CONTACT (self), FALSE); - g_return_val_if_fail (name != NULL && *name != '\0', FALSE); - - if (value == NULL || *value == '\0') { - /* Removing a property */ - g_hash_table_remove (extended_properties, name); - return TRUE; - } - - /* We can't add more than MAX_N_EXTENDED_PROPERTIES */ - if (g_hash_table_lookup (extended_properties, name) == NULL && - g_hash_table_size (extended_properties) >= MAX_N_EXTENDED_PROPERTIES) - return FALSE; - - /* Updating an existing property or adding a new one */ - g_hash_table_insert (extended_properties, g_strdup (name), g_strdup (value)); - - return TRUE; -} - -/** - * gdata_contacts_contact_get_user_defined_field: - * @self: a #GDataContactsContact - * @name: the field name; an arbitrary, case-sensitive, unique string - * - * Gets the value of a user-defined field of the contact. User-defined fields are settable by the user through the Google Contacts web interface, - * in contrast to extended properties, which are visible and settable only through the GData interface. - * - * The @name of the field may not be %NULL, but may be an empty string. - * - * Return value: the field's value, or %NULL - * - * Since: 0.7.0 - * Deprecated: 0.18.2: The Google Contacts service is deprecated. Use Google’s CardDAV interface instead. - */ -const gchar * -gdata_contacts_contact_get_user_defined_field (GDataContactsContact *self, const gchar *name) -{ - g_return_val_if_fail (GDATA_IS_CONTACTS_CONTACT (self), NULL); - g_return_val_if_fail (name != NULL, NULL); - return g_hash_table_lookup (self->priv->user_defined_fields, name); -} - -/** - * gdata_contacts_contact_get_user_defined_fields: - * @self: a #GDataContactsContact - * - * Gets the full list of user-defined fields of the contact; a hash table mapping field name to value. - * - * Return value: (transfer none): a #GHashTable of user-defined fields - * - * Since: 0.7.0 - * Deprecated: 0.18.2: The Google Contacts service is deprecated. Use Google’s CardDAV interface instead. - */ -GHashTable * -gdata_contacts_contact_get_user_defined_fields (GDataContactsContact *self) -{ - g_return_val_if_fail (GDATA_IS_CONTACTS_CONTACT (self), NULL); - return self->priv->user_defined_fields; -} - -/** - * gdata_contacts_contact_set_user_defined_field: - * @self: a #GDataContactsContact - * @name: the field name; an arbitrary, case-sensitive, unique string - * @value: (allow-none): the field value, or %NULL - * - * Sets the value of a contact's user-defined field. User-defined field names are unique (but of the client's choosing), - * and reusing the same field name will result in the old value of that field being overwritten. - * - * The @name of the field may not be %NULL, but may be an empty string. - * - * To unset a field, set @value to %NULL. - * - * Since: 0.7.0 - * Deprecated: 0.18.2: The Google Contacts service is deprecated. Use Google’s CardDAV interface instead. - */ -void -gdata_contacts_contact_set_user_defined_field (GDataContactsContact *self, const gchar *name, const gchar *value) -{ - g_return_if_fail (GDATA_IS_CONTACTS_CONTACT (self)); - g_return_if_fail (name != NULL); - - if (value == NULL) { - /* Removing a field */ - g_hash_table_remove (self->priv->user_defined_fields, name); - } else { - /* Updating an existing field or adding a new one */ - g_hash_table_insert (self->priv->user_defined_fields, g_strdup (name), g_strdup (value)); - } -} - -/** - * gdata_contacts_contact_add_group: - * @self: a #GDataContactsContact - * @href: the group's ID URI - * - * Adds the contact to the given group. @href should be a URI. - * - * Since: 0.2.0 - * Deprecated: 0.18.2: The Google Contacts service is deprecated. Use Google’s CardDAV interface instead. - */ -void -gdata_contacts_contact_add_group (GDataContactsContact *self, const gchar *href) -{ - g_return_if_fail (GDATA_IS_CONTACTS_CONTACT (self)); - g_return_if_fail (href != NULL); - g_hash_table_insert (self->priv->groups, g_strdup (href), GUINT_TO_POINTER (FALSE)); -} - -/** - * gdata_contacts_contact_remove_group: - * @self: a #GDataContactsContact - * @href: the group's ID URI - * - * Removes the contact from the given group. @href should be a URI. - * - * Since: 0.2.0 - * Deprecated: 0.18.2: The Google Contacts service is deprecated. Use Google’s CardDAV interface instead. - */ -void -gdata_contacts_contact_remove_group (GDataContactsContact *self, const gchar *href) -{ - g_return_if_fail (GDATA_IS_CONTACTS_CONTACT (self)); - g_return_if_fail (href != NULL); - g_hash_table_remove (self->priv->groups, href); -} - -/** - * gdata_contacts_contact_is_group_deleted: - * @self: a #GDataContactsContact - * @href: the group's ID URI - * - * Returns whether the contact has recently been removed from the given group on the server. This - * will always return %FALSE unless #GDataContactsQuery:show-deleted has been set to - * %TRUE for the query which returned the contact. - * - * If you've just removed a contact from a group locally using gdata_contacts_contact_remove_group(), %FALSE will still be returned by this function, - * as the change hasn't been sent to the server. - * - * Return value: %TRUE if the contact has recently been removed from the group, %FALSE otherwise - * - * Since: 0.2.0 - * Deprecated: 0.18.2: The Google Contacts service is deprecated. Use Google’s CardDAV interface instead. - */ -gboolean -gdata_contacts_contact_is_group_deleted (GDataContactsContact *self, const gchar *href) -{ - g_return_val_if_fail (GDATA_IS_CONTACTS_CONTACT (self), FALSE); - g_return_val_if_fail (href != NULL, FALSE); - return GPOINTER_TO_UINT (g_hash_table_lookup (self->priv->groups, href)); -} - -/** - * gdata_contacts_contact_get_groups: - * @self: a #GDataContactsContact - * - * Gets a list of the groups to which the contact belongs. - * - * Return value: (element-type utf8) (transfer container): a #GList of constant group ID URIs, or %NULL; free with g_list_free() - * - * Since: 0.2.0 - * Deprecated: 0.18.2: The Google Contacts service is deprecated. Use Google’s CardDAV interface instead. - */ -GList * -gdata_contacts_contact_get_groups (GDataContactsContact *self) -{ - GHashTableIter iter; - const gchar *href; - gpointer value; - GList *groups = NULL; - - g_return_val_if_fail (GDATA_IS_CONTACTS_CONTACT (self), NULL); - - g_hash_table_iter_init (&iter, self->priv->groups); - while (g_hash_table_iter_next (&iter, (gpointer*) &href, &value) == TRUE) { - /* Add the group to the list as long as it hasn't been deleted */ - if (GPOINTER_TO_UINT (value) == FALSE) - groups = g_list_prepend (groups, (gpointer) href); - } - - return g_list_reverse (groups); -} - -/** - * gdata_contacts_contact_is_deleted: - * @self: a #GDataContactsContact - * - * Returns whether the contact has recently been deleted. This will always return - * %FALSE unless #GDataContactsQuery:show-deleted has been set to - * %TRUE for the query which returned the contact; then this function will return - * %TRUE only if the contact has been deleted. - * - * If a contact has been deleted, no other information is available about it. This - * is designed to allow contacts to be deleted from local address books using - * incremental updates from the server (e.g. with #GDataQuery:updated-min and - * #GDataContactsQuery:show-deleted). - * - * Return value: %TRUE if the contact has been deleted, %FALSE otherwise - * - * Since: 0.2.0 - * Deprecated: 0.18.2: The Google Contacts service is deprecated. Use Google’s CardDAV interface instead. - */ -gboolean -gdata_contacts_contact_is_deleted (GDataContactsContact *self) -{ - g_return_val_if_fail (GDATA_IS_CONTACTS_CONTACT (self), FALSE); - return self->priv->deleted; -} - -/** - * gdata_contacts_contact_get_photo_etag: - * @self: a #GDataContactsContact - * - * Returns the ETag for the contact's attached photo, if it exists. If it does exist, the contact's photo can be retrieved using - * gdata_contacts_contact_get_photo(). If it doesn't exist, %NULL will be returned, and the contact doesn't have a photo (so calling - * gdata_contacts_contact_get_photo() will also return %NULL) - * - * Return value: the contact's photo's ETag if it exists, %NULL otherwise - * - * Since: 0.9.0 - * Deprecated: 0.18.2: The Google Contacts service is deprecated. Use Google’s CardDAV interface instead. - */ -const gchar * -gdata_contacts_contact_get_photo_etag (GDataContactsContact *self) -{ - g_return_val_if_fail (GDATA_IS_CONTACTS_CONTACT (self), NULL); - return self->priv->photo_etag; -} - -/** - * gdata_contacts_contact_get_photo: - * @self: a #GDataContactsContact - * @service: a #GDataContactsService - * @length: (out caller-allocates): return location for the image length, in bytes - * @content_type: (out callee-allocates) (transfer full) (allow-none): return location for the image's content type, or %NULL; free with g_free() - * @cancellable: (allow-none): optional #GCancellable object, or %NULL - * @error: a #GError, or %NULL - * - * Downloads and returns the contact's photo, if they have one. If the contact doesn't - * have a photo (i.e. gdata_contacts_contact_get_photo_etag() returns %NULL), %NULL is returned, but - * no error is set in @error. - * - * If @cancellable is not %NULL, then the operation can be cancelled by triggering the @cancellable object from another thread. - * If the operation was cancelled, the error %G_IO_ERROR_CANCELLED will be returned. - * - * If there is an error getting the photo, a %GDATA_SERVICE_ERROR_PROTOCOL_ERROR error will be returned. - * - * Return value: (transfer full) (array length=length): the image data, or %NULL; free with g_free() - * - * Since: 0.8.0 - * Deprecated: 0.18.2: The Google Contacts service is deprecated. Use Google’s CardDAV interface instead. - */ -guint8 * -gdata_contacts_contact_get_photo (GDataContactsContact *self, GDataContactsService *service, gsize *length, gchar **content_type, - GCancellable *cancellable, GError **error) -{ - GDataLink *_link; - SoupMessage *message; - guint status; - guint8 *data; - - g_return_val_if_fail (GDATA_IS_CONTACTS_CONTACT (self), NULL); - g_return_val_if_fail (GDATA_IS_CONTACTS_SERVICE (service), NULL); - g_return_val_if_fail (length != NULL, NULL); - g_return_val_if_fail (cancellable == NULL || G_IS_CANCELLABLE (cancellable), NULL); - g_return_val_if_fail (error == NULL || *error == NULL, NULL); - - /* Return if there is no photo */ - if (gdata_contacts_contact_get_photo_etag (self) == NULL) - return NULL; - - /* Get the photo URI */ - /* TODO: ETag support */ - _link = gdata_entry_look_up_link (GDATA_ENTRY (self), "http://schemas.google.com/contacts/2008/rel#photo"); - g_assert (_link != NULL); - message = _gdata_service_build_message (GDATA_SERVICE (service), gdata_contacts_service_get_primary_authorization_domain (), - SOUP_METHOD_GET, gdata_link_get_uri (_link), NULL, FALSE); - - /* Send the message */ - status = _gdata_service_send_message (GDATA_SERVICE (service), message, cancellable, error); - - if (status == SOUP_STATUS_NONE || status == SOUP_STATUS_CANCELLED) { - /* Redirect error or cancelled */ - g_object_unref (message); - return NULL; - } else if (status != SOUP_STATUS_OK) { - /* Error */ - GDataServiceClass *klass = GDATA_SERVICE_GET_CLASS (service); - g_assert (klass->parse_error_response != NULL); - klass->parse_error_response (GDATA_SERVICE (service), GDATA_OPERATION_DOWNLOAD, status, message->reason_phrase, - message->response_body->data, message->response_body->length, error); - g_object_unref (message); - return NULL; - } - - g_assert (message->response_body->data != NULL); - - /* Sort out the return values */ - if (content_type != NULL) - *content_type = g_strdup (soup_message_headers_get_content_type (message->response_headers, NULL)); - *length = message->response_body->length; -#if GLIB_CHECK_VERSION (2, 68, 0) - data = g_memdup2 (message->response_body->data, message->response_body->length); -#else - data = g_memdup (message->response_body->data, message->response_body->length); -#endif - - /* Update the stored photo ETag */ - g_free (self->priv->photo_etag); - self->priv->photo_etag = g_strdup (soup_message_headers_get_one (message->response_headers, "ETag")); - g_object_unref (message); - - return data; -} - -typedef struct { - GDataContactsService *service; - guint8 *data; - gsize length; - gchar *content_type; -} PhotoData; - -static void -photo_data_free (PhotoData *data) -{ - if (data->service != NULL) - g_object_unref (data->service); - g_free (data->data); - g_free (data->content_type); - g_slice_free (PhotoData, data); -} - -G_DEFINE_AUTOPTR_CLEANUP_FUNC (PhotoData, photo_data_free) - -static void -get_photo_thread (GTask *task, gpointer source_object, gpointer task_data, GCancellable *cancellable) -{ - GDataContactsContact *contact = GDATA_CONTACTS_CONTACT (source_object); - GDataContactsService *service = GDATA_CONTACTS_SERVICE (task_data); - g_autoptr(PhotoData) data = NULL; - g_autoptr(GError) error = NULL; - - /* Input and output */ - data = g_slice_new0 (PhotoData); - - /* Get the photo */ - data->data = gdata_contacts_contact_get_photo (contact, service, &(data->length), &(data->content_type), cancellable, &error); - if (error != NULL) - g_task_return_error (task, g_steal_pointer (&error)); - else - g_task_return_pointer (task, g_steal_pointer (&data), (GDestroyNotify) photo_data_free); -} - -/** - * gdata_contacts_contact_get_photo_async: - * @self: a #GDataContactsContact - * @service: a #GDataContactsService - * @cancellable: (allow-none): optional #GCancellable object, or %NULL - * @callback: a #GAsyncReadyCallback to call when the photo has been retrieved, or %NULL - * @user_data: (closure): data to pass to the @callback function - * - * Downloads and returns the contact's photo, if they have one, asynchronously. @self and @service are both reffed when this function is called, so - * can safely be unreffed after this function returns. - * - * When the operation is finished, @callback will be called. You can then call gdata_contacts_contact_get_photo_finish() to get the results of the - * operation. - * - * For more details, see gdata_contacts_contact_get_photo(), which is the synchronous version of this function. - * - * If @cancellable is not %NULL, then the operation can be cancelled by triggering the @cancellable object from another thread. - * If the operation was cancelled, the error %G_IO_ERROR_CANCELLED will be returned by gdata_contacts_contact_get_photo_finish(). - * - * If there is an error getting the photo, a %GDATA_SERVICE_ERROR_PROTOCOL_ERROR error will be returned by gdata_contacts_contact_get_photo_finish(). - * - * Since: 0.8.0 - * Deprecated: 0.18.2: The Google Contacts service is deprecated. Use Google’s CardDAV interface instead. - */ -void -gdata_contacts_contact_get_photo_async (GDataContactsContact *self, GDataContactsService *service, GCancellable *cancellable, - GAsyncReadyCallback callback, gpointer user_data) -{ - g_autoptr(GTask) task = NULL; - - g_return_if_fail (GDATA_IS_CONTACTS_CONTACT (self)); - g_return_if_fail (GDATA_IS_CONTACTS_SERVICE (service)); - g_return_if_fail (cancellable == NULL || G_IS_CANCELLABLE (cancellable)); - g_return_if_fail (callback != NULL); - - task = g_task_new (self, cancellable, callback, user_data); - g_task_set_source_tag (task, gdata_contacts_contact_get_photo_async); - g_task_set_task_data (task, g_object_ref (service), (GDestroyNotify) g_object_unref); - g_task_run_in_thread (task, get_photo_thread); -} - -/** - * gdata_contacts_contact_get_photo_finish: - * @self: a #GDataContactsContact - * @async_result: a #GAsyncResult - * @length: (out caller-allocates): return location for the image length, in bytes - * @content_type: (out callee-allocates) (transfer full) (allow-none): return location for the image's content type, or %NULL; free with g_free() - * @error: a #GError, or %NULL - * - * Finishes an asynchronous contact photo retrieval operation started with gdata_contacts_contact_get_photo_async(). If the contact doesn't have a - * photo (i.e. gdata_contacts_contact_get_photo_etag() returns %NULL), %NULL is returned, but no error is set in @error. - * - * If there is an error getting the photo, a %GDATA_SERVICE_ERROR_PROTOCOL_ERROR error will be returned. @length will be set to - * 0 and @content_type will be set to %NULL. - * - * Return value: (transfer full) (array length=length): the image data, or %NULL; free with g_free() - * - * Since: 0.8.0 - * Deprecated: 0.18.2: The Google Contacts service is deprecated. Use Google’s CardDAV interface instead. - */ -guint8 * -gdata_contacts_contact_get_photo_finish (GDataContactsContact *self, GAsyncResult *async_result, gsize *length, gchar **content_type, GError **error) -{ - g_autoptr(PhotoData) data = NULL; - - g_return_val_if_fail (GDATA_IS_CONTACTS_CONTACT (self), NULL); - g_return_val_if_fail (G_IS_ASYNC_RESULT (async_result), NULL); - g_return_val_if_fail (length != NULL, NULL); - g_return_val_if_fail (error == NULL || *error == NULL, NULL); - g_return_val_if_fail (g_task_is_valid (async_result, self), NULL); - g_return_val_if_fail (g_async_result_is_tagged (async_result, gdata_contacts_contact_get_photo_async), NULL); - - data = g_task_propagate_pointer (G_TASK (async_result), error); - if (data == NULL) { - /* Error */ - *length = 0; - - if (content_type != NULL) { - *content_type = NULL; - } - - return NULL; - } - - /* Return the photo (steal the data from the PhotoData struct so we don't have to copy it again) */ - *length = data->length; - if (content_type != NULL) - *content_type = g_steal_pointer (&data->content_type); - - return g_steal_pointer (&data->data); -} - -/** - * gdata_contacts_contact_set_photo: - * @self: a #GDataContactsContact - * @service: a #GDataContactsService - * @data: (allow-none): the image data, or %NULL - * @length: the image length, in bytes - * @content_type: (allow-none): the content type of the image, or %NULL - * @cancellable: (allow-none): optional #GCancellable object, or %NULL - * @error: a #GError, or %NULL - * - * Sets the contact's photo to @data or, if @data is %NULL, deletes the contact's photo. @content_type must be specified if @data is non-%NULL. - * - * If @cancellable is not %NULL, then the operation can be cancelled by triggering the @cancellable object from another thread. - * If the operation was cancelled, the error %G_IO_ERROR_CANCELLED will be returned. - * - * If there is an error setting the photo, a %GDATA_SERVICE_ERROR_PROTOCOL_ERROR error will be returned. - * - * Return value: %TRUE on success, %FALSE otherwise - * - * Since: 0.8.0 - * Deprecated: 0.18.2: The Google Contacts service is deprecated. Use Google’s CardDAV interface instead. - */ -gboolean -gdata_contacts_contact_set_photo (GDataContactsContact *self, GDataContactsService *service, const guint8 *data, gsize length, - const gchar *content_type, GCancellable *cancellable, GError **error) -{ - GDataLink *_link; - SoupMessage *message; - guint status; - gboolean deleting_photo = FALSE; - const gchar *etag; - - g_return_val_if_fail (GDATA_IS_CONTACTS_CONTACT (self), FALSE); - g_return_val_if_fail (GDATA_IS_CONTACTS_SERVICE (service), FALSE); - g_return_val_if_fail (data == NULL || content_type != NULL, FALSE); - g_return_val_if_fail (cancellable == NULL || G_IS_CANCELLABLE (cancellable), FALSE); - g_return_val_if_fail (error == NULL || *error == NULL, FALSE); - - if (self->priv->photo_etag != NULL && data == NULL) - deleting_photo = TRUE; - - /* Get the photo URI */ - _link = gdata_entry_look_up_link (GDATA_ENTRY (self), "http://schemas.google.com/contacts/2008/rel#photo"); - g_assert (_link != NULL); - - /* We always have to set an If-Match header. */ - etag = self->priv->photo_etag; - if (etag == NULL || *etag == '\0') { - etag = "*"; - } - - message = _gdata_service_build_message (GDATA_SERVICE (service), gdata_contacts_service_get_primary_authorization_domain (), - (deleting_photo == TRUE) ? SOUP_METHOD_DELETE : SOUP_METHOD_PUT, - gdata_link_get_uri (_link), etag, TRUE); - - /* Append the data */ - if (deleting_photo == FALSE) - soup_message_set_request (message, content_type, SOUP_MEMORY_STATIC, (gchar*) data, length); - - /* Send the message */ - status = _gdata_service_send_message (GDATA_SERVICE (service), message, cancellable, error); - - if (status == SOUP_STATUS_NONE || status == SOUP_STATUS_CANCELLED) { - /* Redirect error or cancelled */ - g_object_unref (message); - return FALSE; - } else if (status != SOUP_STATUS_OK) { - /* Error */ - GDataServiceClass *klass = GDATA_SERVICE_GET_CLASS (service); - g_assert (klass->parse_error_response != NULL); - klass->parse_error_response (GDATA_SERVICE (service), GDATA_OPERATION_UPLOAD, status, message->reason_phrase, - message->response_body->data, message->response_body->length, error); - g_object_unref (message); - return FALSE; - } - - /* Update the stored photo ETag */ - g_free (self->priv->photo_etag); - self->priv->photo_etag = g_strdup (soup_message_headers_get_one (message->response_headers, "ETag")); - g_object_notify (G_OBJECT (self), "photo-etag"); - - g_object_unref (message); - - return TRUE; -} - -static void -set_photo_thread (GTask *task, gpointer source_object, gpointer task_data, GCancellable *cancellable) -{ - GDataContactsContact *contact = GDATA_CONTACTS_CONTACT (source_object); - PhotoData *data = task_data; - g_autoptr(GError) error = NULL; - - /* Set the photo */ - if (!gdata_contacts_contact_set_photo (contact, data->service, data->data, data->length, data->content_type, cancellable, &error)) - g_task_return_error (task, g_steal_pointer (&error)); - else - g_task_return_boolean (task, TRUE); -} - -/** - * gdata_contacts_contact_set_photo_async: - * @self: a #GDataContactsContact - * @service: a #GDataContactsService - * @data: (allow-none): the image data, or %NULL - * @length: the image length, in bytes - * @content_type: (allow-none): the content type of the image, or %NULL - * @cancellable: (allow-none): optional #GCancellable object, or %NULL - * @callback: a #GAsyncReadyCallback to call when the photo has been set, or %NULL - * @user_data: (closure): data to pass to the @callback function - * - * Sets the contact's photo to @data or, if @data is %NULL, deletes the contact's photo. @content_type must be specified if @data is non-%NULL. @self, - * @service, @data and @content_type are all reffed and copied when this function is called, so can safely be unreffed after this function returns. - * - * When the operation is finished, @callback will be called. You can then call gdata_contacts_contact_set_photo_finish() to get the results of the - * operation. - * - * For more details, see gdata_contacts_contact_set_photo(), which is the synchronous version of this function. - * - * If @cancellable is not %NULL, then the operation can be cancelled by triggering the @cancellable object from another thread. - * If the operation was cancelled, the error %G_IO_ERROR_CANCELLED will be returned by gdata_contacts_contact_set_photo_finish(). - * - * If there is an error setting the photo, a %GDATA_SERVICE_ERROR_PROTOCOL_ERROR error will be returned by gdata_contacts_contact_set_photo_finish(). - * - * Since: 0.8.0 - * Deprecated: 0.18.2: The Google Contacts service is deprecated. Use Google’s CardDAV interface instead. - */ -void -gdata_contacts_contact_set_photo_async (GDataContactsContact *self, GDataContactsService *service, const guint8 *data, gsize length, - const gchar *content_type, GCancellable *cancellable, GAsyncReadyCallback callback, gpointer user_data) -{ - g_autoptr(GTask) task = NULL; - g_autoptr(PhotoData) photo_data = NULL; - - g_return_if_fail (GDATA_IS_CONTACTS_CONTACT (self)); - g_return_if_fail (GDATA_IS_CONTACTS_SERVICE (service)); - g_return_if_fail (data == NULL || content_type != NULL); - g_return_if_fail (cancellable == NULL || G_IS_CANCELLABLE (cancellable)); - - /* Prepare the data to be passed to the thread */ - photo_data = g_slice_new (PhotoData); - photo_data->service = g_object_ref (service); -#if GLIB_CHECK_VERSION (2, 68, 0) - photo_data->data = g_memdup2 (data, length); -#else - photo_data->data = g_memdup (data, length); -#endif - photo_data->length = length; - photo_data->content_type = g_strdup (content_type); - - task = g_task_new (self, cancellable, callback, user_data); - g_task_set_source_tag (task, gdata_contacts_contact_set_photo_async); - g_task_set_task_data (task, g_steal_pointer (&photo_data), (GDestroyNotify) photo_data_free); - g_task_run_in_thread (task, set_photo_thread); -} - -/** - * gdata_contacts_contact_set_photo_finish: - * @self: a #GDataContactsContact - * @async_result: a #GAsyncResult - * @error: a #GError, or %NULL - * - * Finishes an asynchronous contact photo setting operation started with gdata_contacts_contact_set_photo_async(). - * - * If there is an error setting the photo, a %GDATA_SERVICE_ERROR_PROTOCOL_ERROR error will be returned. - * - * Return value: %TRUE on success, %FALSE otherwise - * - * Since: 0.8.0 - * Deprecated: 0.18.2: The Google Contacts service is deprecated. Use Google’s CardDAV interface instead. - */ -gboolean -gdata_contacts_contact_set_photo_finish (GDataContactsContact *self, GAsyncResult *async_result, GError **error) -{ - g_return_val_if_fail (GDATA_IS_CONTACTS_CONTACT (self), FALSE); - g_return_val_if_fail (G_IS_ASYNC_RESULT (async_result), FALSE); - g_return_val_if_fail (error == NULL || *error == NULL, FALSE); - g_return_val_if_fail (g_task_is_valid (async_result, self), FALSE); - g_return_val_if_fail (g_async_result_is_tagged (async_result, gdata_contacts_contact_set_photo_async), FALSE); - - return g_task_propagate_boolean (G_TASK (async_result), error); -} - -G_GNUC_END_IGNORE_DEPRECATIONS diff --git a/gdata/services/contacts/gdata-contacts-contact.h b/gdata/services/contacts/gdata-contacts-contact.h deleted file mode 100644 index 29095412..00000000 --- a/gdata/services/contacts/gdata-contacts-contact.h +++ /dev/null @@ -1,402 +0,0 @@ -/* -*- Mode: C; indent-tabs-mode: t; c-basic-offset: 8; tab-width: 8 -*- */ -/* - * GData Client - * Copyright (C) Philip Withnall 2009, 2010, 2011 - * - * GData Client is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2.1 of the License, or (at your option) any later version. - * - * GData Client is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with GData Client. If not, see . - */ - -#ifndef GDATA_CONTACTS_CONTACT_H -#define GDATA_CONTACTS_CONTACT_H - -#include -#include - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -G_BEGIN_DECLS - -/** - * GDATA_CONTACTS_GENDER_MALE: - * - * The contact is male. - * - * Since: 0.7.0 - */ -#define GDATA_CONTACTS_GENDER_MALE "male" - -/** - * GDATA_CONTACTS_GENDER_FEMALE: - * - * The contact is female. - * - * Since: 0.7.0 - */ -#define GDATA_CONTACTS_GENDER_FEMALE "female" - -/** - * GDATA_CONTACTS_PRIORITY_LOW: - * - * The contact is of low importance. - * - * Since: 0.7.0 - */ -#define GDATA_CONTACTS_PRIORITY_LOW "low" - -/** - * GDATA_CONTACTS_PRIORITY_NORMAL: - * - * The contact is of normal importance. - * - * Since: 0.7.0 - */ -#define GDATA_CONTACTS_PRIORITY_NORMAL "normal" - -/** - * GDATA_CONTACTS_PRIORITY_HIGH: - * - * The contact is of high importance. - * - * Since: 0.7.0 - */ -#define GDATA_CONTACTS_PRIORITY_HIGH "high" - -/** - * GDATA_CONTACTS_SENSITIVITY_CONFIDENTIAL: - * - * The contact's data is confidential. - * - * Since: 0.7.0 - */ -#define GDATA_CONTACTS_SENSITIVITY_CONFIDENTIAL "confidential" - -/** - * GDATA_CONTACTS_SENSITIVITY_NORMAL: - * - * The contact's data is of normal sensitivity. - * - * Since: 0.7.0 - */ -#define GDATA_CONTACTS_SENSITIVITY_NORMAL "normal" - -/** - * GDATA_CONTACTS_SENSITIVITY_PERSONAL: - * - * The contact's data is personal. - * - * Since: 0.7.0 - */ -#define GDATA_CONTACTS_SENSITIVITY_PERSONAL "personal" - -/** - * GDATA_CONTACTS_SENSITIVITY_PRIVATE: - * - * The contact's data is private. - * - * Since: 0.7.0 - */ -#define GDATA_CONTACTS_SENSITIVITY_PRIVATE "private" - -#define GDATA_TYPE_CONTACTS_CONTACT (gdata_contacts_contact_get_type ()) -#define GDATA_CONTACTS_CONTACT(o) (G_TYPE_CHECK_INSTANCE_CAST ((o), GDATA_TYPE_CONTACTS_CONTACT, GDataContactsContact)) -#define GDATA_CONTACTS_CONTACT_CLASS(k) (G_TYPE_CHECK_CLASS_CAST((k), GDATA_TYPE_CONTACTS_CONTACT, GDataContactsContactClass)) -#define GDATA_IS_CONTACTS_CONTACT(o) (G_TYPE_CHECK_INSTANCE_TYPE ((o), GDATA_TYPE_CONTACTS_CONTACT)) -#define GDATA_IS_CONTACTS_CONTACT_CLASS(k) (G_TYPE_CHECK_CLASS_TYPE ((k), GDATA_TYPE_CONTACTS_CONTACT)) -#define GDATA_CONTACTS_CONTACT_GET_CLASS(o) (G_TYPE_INSTANCE_GET_CLASS ((o), GDATA_TYPE_CONTACTS_CONTACT, GDataContactsContactClass)) - -typedef struct _GDataContactsContactPrivate GDataContactsContactPrivate; - -/** - * GDataContactsContact: - * - * All the fields in the #GDataContactsContact structure are private and should never be accessed directly. - * - * Since: 0.2.0 - */ -typedef struct { - GDataEntry parent; - GDataContactsContactPrivate *priv; -} GDataContactsContact; - -/** - * GDataContactsContactClass: - * - * All the fields in the #GDataContactsContactClass structure are private and should never be accessed directly. - * - * Since: 0.2.0 - */ -typedef struct { - /*< private >*/ - GDataEntryClass parent; - - /*< private >*/ - /* Padding for future expansion */ - void (*_g_reserved0) (void); - void (*_g_reserved1) (void); -} GDataContactsContactClass; - -G_DEPRECATED -GType gdata_contacts_contact_get_type (void) G_GNUC_CONST; - -G_DEPRECATED -GDataContactsContact *gdata_contacts_contact_new (const gchar *id) G_GNUC_WARN_UNUSED_RESULT G_GNUC_MALLOC; - -G_DEPRECATED -gint64 gdata_contacts_contact_get_edited (GDataContactsContact *self); -G_DEPRECATED -gboolean gdata_contacts_contact_is_deleted (GDataContactsContact *self) G_GNUC_PURE; - -G_DEPRECATED -GDataGDName *gdata_contacts_contact_get_name (GDataContactsContact *self) G_GNUC_PURE; -G_DEPRECATED -void gdata_contacts_contact_set_name (GDataContactsContact *self, GDataGDName *name); - -G_DEPRECATED -const gchar *gdata_contacts_contact_get_nickname (GDataContactsContact *self) G_GNUC_PURE; -G_DEPRECATED -void gdata_contacts_contact_set_nickname (GDataContactsContact *self, const gchar *nickname); - -G_DEPRECATED -const gchar *gdata_contacts_contact_get_file_as (GDataContactsContact *self) G_GNUC_PURE; -G_DEPRECATED -void gdata_contacts_contact_set_file_as (GDataContactsContact *self, const gchar *file_as); - -G_DEPRECATED -gboolean gdata_contacts_contact_get_birthday (GDataContactsContact *self, GDate *birthday) G_GNUC_PURE; -G_DEPRECATED -void gdata_contacts_contact_set_birthday (GDataContactsContact *self, GDate *birthday, gboolean birthday_has_year); - -G_DEPRECATED -const gchar *gdata_contacts_contact_get_billing_information (GDataContactsContact *self) G_GNUC_PURE; -G_DEPRECATED -void gdata_contacts_contact_set_billing_information (GDataContactsContact *self, const gchar *billing_information); - -G_DEPRECATED -const gchar *gdata_contacts_contact_get_directory_server (GDataContactsContact *self) G_GNUC_PURE; -G_DEPRECATED -void gdata_contacts_contact_set_directory_server (GDataContactsContact *self, const gchar *directory_server); - -G_DEPRECATED -const gchar *gdata_contacts_contact_get_gender (GDataContactsContact *self) G_GNUC_PURE; -G_DEPRECATED -void gdata_contacts_contact_set_gender (GDataContactsContact *self, const gchar *gender); - -G_DEPRECATED -const gchar *gdata_contacts_contact_get_initials (GDataContactsContact *self) G_GNUC_PURE; -G_DEPRECATED -void gdata_contacts_contact_set_initials (GDataContactsContact *self, const gchar *initials); - -G_DEPRECATED -const gchar *gdata_contacts_contact_get_maiden_name (GDataContactsContact *self) G_GNUC_PURE; -G_DEPRECATED -void gdata_contacts_contact_set_maiden_name (GDataContactsContact *self, const gchar *maiden_name); - -G_DEPRECATED -const gchar *gdata_contacts_contact_get_mileage (GDataContactsContact *self) G_GNUC_PURE; -G_DEPRECATED -void gdata_contacts_contact_set_mileage (GDataContactsContact *self, const gchar *mileage); - -G_DEPRECATED -const gchar *gdata_contacts_contact_get_occupation (GDataContactsContact *self) G_GNUC_PURE; -G_DEPRECATED -void gdata_contacts_contact_set_occupation (GDataContactsContact *self, const gchar *occupation); - -G_DEPRECATED -const gchar *gdata_contacts_contact_get_priority (GDataContactsContact *self) G_GNUC_PURE; -G_DEPRECATED -void gdata_contacts_contact_set_priority (GDataContactsContact *self, const gchar *priority); - -G_DEPRECATED -const gchar *gdata_contacts_contact_get_sensitivity (GDataContactsContact *self) G_GNUC_PURE; -G_DEPRECATED -void gdata_contacts_contact_set_sensitivity (GDataContactsContact *self, const gchar *sensitivity); - -G_DEPRECATED -const gchar *gdata_contacts_contact_get_short_name (GDataContactsContact *self) G_GNUC_PURE; -G_DEPRECATED -void gdata_contacts_contact_set_short_name (GDataContactsContact *self, const gchar *short_name); - -G_DEPRECATED -const gchar *gdata_contacts_contact_get_subject (GDataContactsContact *self) G_GNUC_PURE; -G_DEPRECATED -void gdata_contacts_contact_set_subject (GDataContactsContact *self, const gchar *subject); - -G_DEPRECATED -void gdata_contacts_contact_add_email_address (GDataContactsContact *self, GDataGDEmailAddress *email_address); -G_DEPRECATED -GList *gdata_contacts_contact_get_email_addresses (GDataContactsContact *self) G_GNUC_PURE; -G_DEPRECATED -GDataGDEmailAddress *gdata_contacts_contact_get_primary_email_address (GDataContactsContact *self) G_GNUC_PURE; -G_DEPRECATED -void gdata_contacts_contact_remove_all_email_addresses (GDataContactsContact *self); - -G_DEPRECATED -void gdata_contacts_contact_add_im_address (GDataContactsContact *self, GDataGDIMAddress *im_address); -G_DEPRECATED -GList *gdata_contacts_contact_get_im_addresses (GDataContactsContact *self) G_GNUC_PURE; -G_DEPRECATED -GDataGDIMAddress *gdata_contacts_contact_get_primary_im_address (GDataContactsContact *self) G_GNUC_PURE; -G_DEPRECATED -void gdata_contacts_contact_remove_all_im_addresses (GDataContactsContact *self); - -G_DEPRECATED -void gdata_contacts_contact_add_phone_number (GDataContactsContact *self, GDataGDPhoneNumber *phone_number); -G_DEPRECATED -GList *gdata_contacts_contact_get_phone_numbers (GDataContactsContact *self) G_GNUC_PURE; -G_DEPRECATED -GDataGDPhoneNumber *gdata_contacts_contact_get_primary_phone_number (GDataContactsContact *self) G_GNUC_PURE; -G_DEPRECATED -void gdata_contacts_contact_remove_all_phone_numbers (GDataContactsContact *self); - -G_DEPRECATED -void gdata_contacts_contact_add_postal_address (GDataContactsContact *self, GDataGDPostalAddress *postal_address); -G_DEPRECATED -GList *gdata_contacts_contact_get_postal_addresses (GDataContactsContact *self) G_GNUC_PURE; -G_DEPRECATED -GDataGDPostalAddress *gdata_contacts_contact_get_primary_postal_address (GDataContactsContact *self) G_GNUC_PURE; -G_DEPRECATED -void gdata_contacts_contact_remove_all_postal_addresses (GDataContactsContact *self); - -G_DEPRECATED -void gdata_contacts_contact_add_organization (GDataContactsContact *self, GDataGDOrganization *organization); -G_DEPRECATED -GList *gdata_contacts_contact_get_organizations (GDataContactsContact *self) G_GNUC_PURE; -G_DEPRECATED -GDataGDOrganization *gdata_contacts_contact_get_primary_organization (GDataContactsContact *self) G_GNUC_PURE; -G_DEPRECATED -void gdata_contacts_contact_remove_all_organizations (GDataContactsContact *self); - -G_DEPRECATED -void gdata_contacts_contact_add_jot (GDataContactsContact *self, GDataGContactJot *jot); -G_DEPRECATED -GList *gdata_contacts_contact_get_jots (GDataContactsContact *self) G_GNUC_PURE; -G_DEPRECATED -void gdata_contacts_contact_remove_all_jots (GDataContactsContact *self); - -G_DEPRECATED -void gdata_contacts_contact_add_relation (GDataContactsContact *self, GDataGContactRelation *relation); -G_DEPRECATED -GList *gdata_contacts_contact_get_relations (GDataContactsContact *self) G_GNUC_PURE; -G_DEPRECATED -void gdata_contacts_contact_remove_all_relations (GDataContactsContact *self); - -G_DEPRECATED -void gdata_contacts_contact_add_website (GDataContactsContact *self, GDataGContactWebsite *website); -G_DEPRECATED -GList *gdata_contacts_contact_get_websites (GDataContactsContact *self) G_GNUC_PURE; -G_DEPRECATED -GDataGContactWebsite *gdata_contacts_contact_get_primary_website (GDataContactsContact *self) G_GNUC_PURE; -G_DEPRECATED -void gdata_contacts_contact_remove_all_websites (GDataContactsContact *self); - -G_DEPRECATED -void gdata_contacts_contact_add_event (GDataContactsContact *self, GDataGContactEvent *event); -G_DEPRECATED -GList *gdata_contacts_contact_get_events (GDataContactsContact *self) G_GNUC_PURE; -G_DEPRECATED -void gdata_contacts_contact_remove_all_events (GDataContactsContact *self); - -G_DEPRECATED -void gdata_contacts_contact_add_calendar (GDataContactsContact *self, GDataGContactCalendar *calendar); -G_DEPRECATED -GList *gdata_contacts_contact_get_calendars (GDataContactsContact *self) G_GNUC_PURE; -G_DEPRECATED -GDataGContactCalendar *gdata_contacts_contact_get_primary_calendar (GDataContactsContact *self) G_GNUC_PURE; -G_DEPRECATED -void gdata_contacts_contact_remove_all_calendars (GDataContactsContact *self); - -G_DEPRECATED -void gdata_contacts_contact_add_external_id (GDataContactsContact *self, GDataGContactExternalID *external_id); -G_DEPRECATED -GList *gdata_contacts_contact_get_external_ids (GDataContactsContact *self) G_GNUC_PURE; -G_DEPRECATED -void gdata_contacts_contact_remove_all_external_ids (GDataContactsContact *self); - -G_DEPRECATED -void gdata_contacts_contact_add_hobby (GDataContactsContact *self, const gchar *hobby); -G_DEPRECATED -GList *gdata_contacts_contact_get_hobbies (GDataContactsContact *self) G_GNUC_PURE; -G_DEPRECATED -void gdata_contacts_contact_remove_all_hobbies (GDataContactsContact *self); - -G_DEPRECATED -void gdata_contacts_contact_add_language (GDataContactsContact *self, GDataGContactLanguage *language); -G_DEPRECATED -GList *gdata_contacts_contact_get_languages (GDataContactsContact *self) G_GNUC_PURE; -G_DEPRECATED -void gdata_contacts_contact_remove_all_languages (GDataContactsContact *self); - -G_DEPRECATED -const gchar *gdata_contacts_contact_get_extended_property (GDataContactsContact *self, const gchar *name) G_GNUC_PURE; -G_DEPRECATED -GHashTable *gdata_contacts_contact_get_extended_properties (GDataContactsContact *self) G_GNUC_PURE; -G_DEPRECATED -gboolean gdata_contacts_contact_set_extended_property (GDataContactsContact *self, const gchar *name, const gchar *value); - -G_DEPRECATED -const gchar *gdata_contacts_contact_get_user_defined_field (GDataContactsContact *self, const gchar *name) G_GNUC_PURE; -G_DEPRECATED -GHashTable *gdata_contacts_contact_get_user_defined_fields (GDataContactsContact *self) G_GNUC_PURE; -G_DEPRECATED -void gdata_contacts_contact_set_user_defined_field (GDataContactsContact *self, const gchar *name, const gchar *value); - -G_DEPRECATED -void gdata_contacts_contact_add_group (GDataContactsContact *self, const gchar *href); -G_DEPRECATED -void gdata_contacts_contact_remove_group (GDataContactsContact *self, const gchar *href); -G_DEPRECATED -gboolean gdata_contacts_contact_is_group_deleted (GDataContactsContact *self, const gchar *href) G_GNUC_PURE; -G_DEPRECATED -GList *gdata_contacts_contact_get_groups (GDataContactsContact *self) G_GNUC_WARN_UNUSED_RESULT G_GNUC_MALLOC; - -#include - -G_DEPRECATED -const gchar *gdata_contacts_contact_get_photo_etag (GDataContactsContact *self) G_GNUC_PURE; - -G_DEPRECATED -guint8 *gdata_contacts_contact_get_photo (GDataContactsContact *self, GDataContactsService *service, gsize *length, gchar **content_type, - GCancellable *cancellable, GError **error) G_GNUC_WARN_UNUSED_RESULT G_GNUC_MALLOC; -G_DEPRECATED -void gdata_contacts_contact_get_photo_async (GDataContactsContact *self, GDataContactsService *service, GCancellable *cancellable, - GAsyncReadyCallback callback, gpointer user_data); -G_DEPRECATED -guint8 *gdata_contacts_contact_get_photo_finish (GDataContactsContact *self, GAsyncResult *async_result, gsize *length, gchar **content_type, - GError **error) G_GNUC_WARN_UNUSED_RESULT G_GNUC_MALLOC; - -G_DEPRECATED -gboolean gdata_contacts_contact_set_photo (GDataContactsContact *self, GDataContactsService *service, const guint8 *data, gsize length, - const gchar *content_type, GCancellable *cancellable, GError **error); -G_DEPRECATED -void gdata_contacts_contact_set_photo_async (GDataContactsContact *self, GDataContactsService *service, const guint8 *data, gsize length, - const gchar *content_type, GCancellable *cancellable, GAsyncReadyCallback callback, gpointer user_data); -G_DEPRECATED -gboolean gdata_contacts_contact_set_photo_finish (GDataContactsContact *self, GAsyncResult *async_result, GError **error); - -G_END_DECLS - -#endif /* !GDATA_CONTACTS_CONTACT_H */ diff --git a/gdata/services/contacts/gdata-contacts-group.c b/gdata/services/contacts/gdata-contacts-group.c deleted file mode 100644 index fb25f772..00000000 --- a/gdata/services/contacts/gdata-contacts-group.c +++ /dev/null @@ -1,612 +0,0 @@ -/* -*- Mode: C; indent-tabs-mode: t; c-basic-offset: 8; tab-width: 8 -*- */ -/* - * GData Client - * Copyright (C) Philip Withnall 2010 - * - * GData Client is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2.1 of the License, or (at your option) any later version. - * - * GData Client is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with GData Client. If not, see . - */ - -/** - * SECTION:gdata-contacts-group - * @short_description: GData Contacts group object - * @stability: Stable - * @include: gdata/services/contacts/gdata-contacts-group.h - * - * #GDataContactsGroup is a subclass of #GDataEntry to represent a group from a Google address book. - * - * For more details of Google Contacts' GData API, see the - * online documentation. - * - * The user-set name of the group is stored in the #GDataEntry:title property, retrievable using gdata_entry_get_title(). Note that for system groups - * (see #GDataContactsGroup:system-group-id), this group name is provided by Google, and is not localised. Clients should provide their own localised - * group names for the system groups. - * - * In addition to all the standard properties available for a group, #GDataContactsGroup supports an additional kind of property: extended - * properties. Extended properties, set with gdata_contacts_group_set_extended_property() and retrieved with - * gdata_contacts_group_get_extended_property(), are provided as a method of storing client-specific data which shouldn't be seen or be editable - * by the user, such as IDs and cache times. - * - * - * Adding a New Group - * - * GDataContactsService *service; - * GDataContactsGroup *group, *updated_group; - * GDataContactsContact *contact, *updated_contact; - * GError *error = NULL; - * - * /* Create a service and return a contact to add to the new group. */ - * service = create_contacts_service (); - * contact = query_user_for_contact (service); - * - * /* Create the new group */ - * group = gdata_contacts_group_new (NULL); - * gdata_entry_set_title (GDATA_ENTRY (group), "Group Name"); - * - * /* Insert the group on the server */ - * updated_group = gdata_contacts_service_insert_group (service, group, NULL, &error); - * - * g_object_unref (group); - * - * if (error != NULL) { - * g_error ("Error adding a group: %s", error->message); - * g_error_free (error); - * g_object_unref (contact); - * g_object_unref (service); - * return; - * } - * - * /* Add the contact to the new group. */ - * gdata_contacts_contact_add_group (contact, gdata_entry_get_id (GDATA_ENTRY (updated_group))); - * - * g_object_unref (updated_group); - * - * /* Update the contact on the server */ - * updated_contact = GDATA_CONTACTS_CONTACT (gdata_service_update_entry (GDATA_SERVICE (service), GDATA_ENTRY (contact), NULL, &error)); - * - * g_object_unref (contact); - * g_object_unref (service); - * - * if (error != NULL) { - * g_error ("Error updating contact: %s", error->message); - * g_error_free (error); - * return; - * } - * - * /* Do something with the updated contact, such as update them in the UI, or store their ID for future use. */ - * - * g_object_unref (updated_contact); - * - * - * - * Since: 0.7.0 - * Deprecated: 0.18.2: The Google Contacts service is deprecated. Use Google’s CardDAV interface instead. - */ - -#include -#include -#include -#include -#include - -#include "gdata-contacts-group.h" -#include "gdata-parser.h" -#include "gdata-types.h" -#include "gdata-private.h" - -G_GNUC_BEGIN_IGNORE_DEPRECATIONS - -/* The maximum number of extended properties the server allows us. See - * http://code.google.com/apis/contacts/docs/3.0/reference.html#ProjectionsAndExtended. - * When updating this, make sure to update the API documentation for gdata_contacts_group_get_extended_property() and - * gdata_contacts_group_set_extended_property(). */ -#define MAX_N_EXTENDED_PROPERTIES 10 - -static GObject *gdata_contacts_group_constructor (GType type, guint n_construct_params, GObjectConstructParam *construct_params); -static void gdata_contacts_group_get_property (GObject *object, guint property_id, GValue *value, GParamSpec *pspec); -static void gdata_contacts_group_finalize (GObject *object); -static void get_xml (GDataParsable *parsable, GString *xml_string); -static gboolean parse_xml (GDataParsable *parsable, xmlDoc *doc, xmlNode *node, gpointer user_data, GError **error); -static void get_namespaces (GDataParsable *parsable, GHashTable *namespaces); -static gchar *get_entry_uri (const gchar *id) G_GNUC_WARN_UNUSED_RESULT; - -struct _GDataContactsGroupPrivate { - gint64 edited; - GHashTable *extended_properties; - gboolean deleted; - gchar *system_group_id; -}; - -enum { - PROP_EDITED = 1, - PROP_DELETED, - PROP_SYSTEM_GROUP_ID -}; - -G_DEFINE_TYPE_WITH_PRIVATE (GDataContactsGroup, gdata_contacts_group, GDATA_TYPE_ENTRY) - -static void -gdata_contacts_group_class_init (GDataContactsGroupClass *klass) -{ - GObjectClass *gobject_class = G_OBJECT_CLASS (klass); - GDataParsableClass *parsable_class = GDATA_PARSABLE_CLASS (klass); - GDataEntryClass *entry_class = GDATA_ENTRY_CLASS (klass); - - gobject_class->constructor = gdata_contacts_group_constructor; - gobject_class->get_property = gdata_contacts_group_get_property; - gobject_class->finalize = gdata_contacts_group_finalize; - - parsable_class->parse_xml = parse_xml; - parsable_class->get_xml = get_xml; - parsable_class->get_namespaces = get_namespaces; - - entry_class->get_entry_uri = get_entry_uri; - entry_class->kind_term = "http://schemas.google.com/contact/2008#group"; - - /** - * GDataContactsGroup:edited: - * - * The last time the group was edited. If the group has not been edited yet, the content indicates the time it was created. - * - * For more information, see the - * Atom Publishing Protocol specification. - * - * Since: 0.7.0 - * Deprecated: 0.18.2: The Google Contacts service is deprecated. Use Google’s CardDAV interface instead. - */ - g_object_class_install_property (gobject_class, PROP_EDITED, - g_param_spec_int64 ("edited", - "Edited", "The last time the group was edited.", - -1, G_MAXINT64, -1, - G_PARAM_READABLE | G_PARAM_STATIC_STRINGS)); - - /** - * GDataContactsGroup:deleted: - * - * Whether the entry has been deleted. - * - * Since: 0.7.0 - * Deprecated: 0.18.2: The Google Contacts service is deprecated. Use Google’s CardDAV interface instead. - */ - g_object_class_install_property (gobject_class, PROP_DELETED, - g_param_spec_boolean ("deleted", - "Deleted", "Whether the entry has been deleted.", - FALSE, - G_PARAM_READABLE | G_PARAM_STATIC_STRINGS)); - - /** - * GDataContactsGroup:system-group-id: - * - * The system group ID for this group, if it's a system group. If the group is not a system group, this is %NULL. Otherwise, it is one of the - * four system group IDs: %GDATA_CONTACTS_GROUP_CONTACTS, %GDATA_CONTACTS_GROUP_FRIENDS, %GDATA_CONTACTS_GROUP_FAMILY and - * %GDATA_CONTACTS_GROUP_COWORKERS. - * - * If this is non-%NULL, the group name stored in #GDataEntry:title will not be localised, so clients should provide localised group names of - * their own for each of the system groups. Whether a group is a system group should be detected solely on the basis of the value of this - * property, not by comparing the group name (#GDataEntry:title) or entry ID (#GDataEntry:id). The entry ID is not the same as the system - * group ID. - * - * Since: 0.7.0 - * Deprecated: 0.18.2: The Google Contacts service is deprecated. Use Google’s CardDAV interface instead. - */ - g_object_class_install_property (gobject_class, PROP_SYSTEM_GROUP_ID, - g_param_spec_string ("system-group-id", - "System group ID", "The system group ID for this group, if it's a system group.", - NULL, - G_PARAM_READABLE | G_PARAM_STATIC_STRINGS)); -} - -static void notify_content_cb (GObject *gobject, GParamSpec *pspec, GDataContactsGroup *self); - -static void -notify_title_cb (GObject *gobject, GParamSpec *pspec, GDataContactsGroup *self) -{ - /* Update GDataEntry:content */ - g_signal_handlers_block_by_func (self, notify_content_cb, self); - gdata_entry_set_content (GDATA_ENTRY (self), gdata_entry_get_title (GDATA_ENTRY (self))); - g_signal_handlers_unblock_by_func (self, notify_content_cb, self); -} - -static void -notify_content_cb (GObject *gobject, GParamSpec *pspec, GDataContactsGroup *self) -{ - /* Update GDataEntry:title */ - g_signal_handlers_block_by_func (self, notify_title_cb, self); - gdata_entry_set_title (GDATA_ENTRY (self), gdata_entry_get_content (GDATA_ENTRY (self))); - g_signal_handlers_unblock_by_func (self, notify_title_cb, self); -} - -static void -gdata_contacts_group_init (GDataContactsGroup *self) -{ - self->priv =gdata_contacts_group_get_instance_private (self); - self->priv->extended_properties = g_hash_table_new_full (g_str_hash, g_str_equal, g_free, g_free); - self->priv->edited = -1; - - /* Listen to change notifications for the entry's title and content, since they're linked */ - g_signal_connect (self, "notify::title", (GCallback) notify_title_cb, self); - g_signal_connect (self, "notify::content", (GCallback) notify_content_cb, self); -} - -static GObject * -gdata_contacts_group_constructor (GType type, guint n_construct_params, GObjectConstructParam *construct_params) -{ - GObject *object; - guint i; - - /* Find the "id" property and ensure it's sane */ - for (i = 0; i < n_construct_params; i++) { - GParamSpec *pspec = construct_params[i].pspec; - GValue *value = construct_params[i].value; - - if (strcmp (g_param_spec_get_name (pspec), "id") == 0) { - gchar *base, *id; - - id = g_value_dup_string (value); - - /* Fix the ID to refer to the full projection, rather than the base projection. */ - if (id != NULL) { - base = strstr (id, "/base/"); - if (base != NULL) - memcpy (base, "/full/", 6); - } - - g_value_take_string (value, id); - - break; - } - } - - /* Chain up to the parent class */ - object = G_OBJECT_CLASS (gdata_contacts_group_parent_class)->constructor (type, n_construct_params, construct_params); - - if (_gdata_parsable_is_constructed_from_xml (GDATA_PARSABLE (object)) == FALSE) { - GDataContactsGroupPrivate *priv = GDATA_CONTACTS_GROUP (object)->priv; - - /* Set the edited property to the current time (creation time). We don't do this in *_init() since that would cause setting it from - * parse_xml() to fail (duplicate element). */ - priv->edited = g_get_real_time () / G_USEC_PER_SEC; - } - - return object; -} - -static void -gdata_contacts_group_get_property (GObject *object, guint property_id, GValue *value, GParamSpec *pspec) -{ - GDataContactsGroupPrivate *priv = GDATA_CONTACTS_GROUP (object)->priv; - - switch (property_id) { - case PROP_EDITED: - g_value_set_int64 (value, priv->edited); - break; - case PROP_DELETED: - g_value_set_boolean (value, priv->deleted); - break; - case PROP_SYSTEM_GROUP_ID: - g_value_set_string (value, priv->system_group_id); - break; - default: - /* We don't have any other property... */ - G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec); - break; - } -} - -static void -gdata_contacts_group_finalize (GObject *object) -{ - GDataContactsGroupPrivate *priv = GDATA_CONTACTS_GROUP (object)->priv; - - g_hash_table_destroy (priv->extended_properties); - g_free (priv->system_group_id); - - /* Chain up to the parent class */ - G_OBJECT_CLASS (gdata_contacts_group_parent_class)->finalize (object); -} - -static gboolean -parse_xml (GDataParsable *parsable, xmlDoc *doc, xmlNode *node, gpointer user_data, GError **error) -{ - gboolean success; - GDataContactsGroup *self = GDATA_CONTACTS_GROUP (parsable); - - if (gdata_parser_is_namespace (node, "http://www.w3.org/2007/app") == TRUE && - gdata_parser_int64_time_from_element (node, "edited", P_REQUIRED | P_NO_DUPES, &(self->priv->edited), &success, error) == TRUE) { - return success; - } else if (gdata_parser_is_namespace (node, "http://www.w3.org/2005/Atom") == TRUE && xmlStrcmp (node->name, (xmlChar*) "id") == 0) { - /* We have to override parsing to fix the projection. Modify it in-place so that the parser in GDataEntry will pick up the - * changes. This fixes bugs caused by referring to contacts by the base projection, rather than the full projection; such as - * http://code.google.com/p/gdata-issues/issues/detail?id=2129. */ - gchar *base; - gchar *id = (gchar*) xmlNodeListGetString (doc, node->children, TRUE); - - if (id != NULL) { - base = strstr (id, "/base/"); - if (base != NULL) { - memcpy (base, "/full/", 6); - xmlNodeSetContent (node, (xmlChar*) id); - } - } - - xmlFree (id); - - return GDATA_PARSABLE_CLASS (gdata_contacts_group_parent_class)->parse_xml (parsable, doc, node, user_data, error); - } else if (gdata_parser_is_namespace (node, "http://schemas.google.com/g/2005") == TRUE) { - if (xmlStrcmp (node->name, (xmlChar*) "extendedProperty") == 0) { - /* gd:extendedProperty */ - xmlChar *name, *value; - xmlBuffer *buffer = NULL; - - name = xmlGetProp (node, (xmlChar*) "name"); - if (name == NULL) - return gdata_parser_error_required_property_missing (node, "name", error); - - /* Get either the value property, or the element's content */ - value = xmlGetProp (node, (xmlChar*) "value"); - if (value == NULL) { - xmlNode *child_node; - - /* Use the element's content instead (arbitrary XML) */ - buffer = xmlBufferCreate (); - for (child_node = node->children; child_node != NULL; child_node = child_node->next) - xmlNodeDump (buffer, doc, child_node, 0, 0); - value = (xmlChar*) xmlBufferContent (buffer); - } - - gdata_contacts_group_set_extended_property (self, (gchar*) name, (gchar*) value); - - xmlFree (name); - if (buffer != NULL) - xmlBufferFree (buffer); - else - xmlFree (value); - } else if (xmlStrcmp (node->name, (xmlChar*) "deleted") == 0) { - /* gd:deleted */ - if (self->priv->deleted == TRUE) - return gdata_parser_error_duplicate_element (node, error); - - self->priv->deleted = TRUE; - } else { - return GDATA_PARSABLE_CLASS (gdata_contacts_group_parent_class)->parse_xml (parsable, doc, node, user_data, error); - } - } else if (gdata_parser_is_namespace (node, "http://schemas.google.com/contact/2008") == TRUE) { - if (xmlStrcmp (node->name, (xmlChar*) "systemGroup") == 0) { - /* gContact:systemGroup */ - xmlChar *value; - - if (self->priv->system_group_id != NULL) - return gdata_parser_error_duplicate_element (node, error); - - value = xmlGetProp (node, (xmlChar*) "id"); - if (value == NULL || *value == '\0') { - xmlFree (value); - return gdata_parser_error_required_property_missing (node, "id", error); - } - - self->priv->system_group_id = (gchar*) value; - } else { - return GDATA_PARSABLE_CLASS (gdata_contacts_group_parent_class)->parse_xml (parsable, doc, node, user_data, error); - } - } else { - return GDATA_PARSABLE_CLASS (gdata_contacts_group_parent_class)->parse_xml (parsable, doc, node, user_data, error); - } - - return TRUE; -} - -static void -get_extended_property_xml_cb (const gchar *name, const gchar *value, GString *xml_string) -{ - /* Note that the value *isn't* escaped (see http://code.google.com/apis/gdata/docs/2.0/elements.html#gdExtendedProperty) */ - gdata_parser_string_append_escaped (xml_string, ""); - g_string_append_printf (xml_string, "%s", value); -} - -static void -get_xml (GDataParsable *parsable, GString *xml_string) -{ - GDataContactsGroupPrivate *priv = GDATA_CONTACTS_GROUP (parsable)->priv; - - /* Chain up to the parent class */ - GDATA_PARSABLE_CLASS (gdata_contacts_group_parent_class)->get_xml (parsable, xml_string); - - /* Extended properties */ - g_hash_table_foreach (priv->extended_properties, (GHFunc) get_extended_property_xml_cb, xml_string); -} - -static void -get_namespaces (GDataParsable *parsable, GHashTable *namespaces) -{ - /* Chain up to the parent class */ - GDATA_PARSABLE_CLASS (gdata_contacts_group_parent_class)->get_namespaces (parsable, namespaces); - - g_hash_table_insert (namespaces, (gchar*) "gd", (gchar*) "http://schemas.google.com/g/2005"); - g_hash_table_insert (namespaces, (gchar*) "gContact", (gchar*) "http://schemas.google.com/contact/2008"); - g_hash_table_insert (namespaces, (gchar*) "app", (gchar*) "http://www.w3.org/2007/app"); -} - -static gchar * -get_entry_uri (const gchar *id) -{ - const gchar *base_pos; - gchar *uri = g_strdup (id); - - /* The service API sometimes stubbornly insists on using the "base" view instead of the "full" view, which we have to fix, or our extended - * attributes are never visible */ - base_pos = strstr (uri, "/base/"); - if (base_pos != NULL) - memcpy ((char*) base_pos, "/full/", 6); - - return uri; -} - -/** - * gdata_contacts_group_new: - * @id: (allow-none): the group's ID, or %NULL - * - * Creates a new #GDataContactsGroup with the given ID and default properties. - * - * Return value: a new #GDataContactsGroup; unref with g_object_unref() - * - * Since: 0.7.0 - * Deprecated: 0.18.2: The Google Contacts service is deprecated. Use Google’s CardDAV interface instead. - */ -GDataContactsGroup * -gdata_contacts_group_new (const gchar *id) -{ - return GDATA_CONTACTS_GROUP (g_object_new (GDATA_TYPE_CONTACTS_GROUP, "id", id, NULL)); -} - -/** - * gdata_contacts_group_get_edited: - * @self: a #GDataContactsGroup - * - * Gets the #GDataContactsGroup:edited property. If the property is unset, -1 will be returned. - * - * Return value: the UNIX timestamp for the time the file was last edited, or -1 - * - * Since: 0.7.0 - * Deprecated: 0.18.2: The Google Contacts service is deprecated. Use Google’s CardDAV interface instead. - */ -gint64 -gdata_contacts_group_get_edited (GDataContactsGroup *self) -{ - g_return_val_if_fail (GDATA_IS_CONTACTS_GROUP (self), -1); - return self->priv->edited; -} - -/** - * gdata_contacts_group_get_system_group_id: - * @self: a #GDataContactsGroup - * - * Gets the #GDataContactsGroup:system-group-id property. If the group is not a system group, %NULL will be returned. - * - * Return value: the group's system group ID, or %NULL - * - * Since: 0.7.0 - * Deprecated: 0.18.2: The Google Contacts service is deprecated. Use Google’s CardDAV interface instead. - */ -const gchar * -gdata_contacts_group_get_system_group_id (GDataContactsGroup *self) -{ - g_return_val_if_fail (GDATA_IS_CONTACTS_GROUP (self), NULL); - return self->priv->system_group_id; -} - -/** - * gdata_contacts_group_get_extended_property: - * @self: a #GDataContactsGroup - * @name: the property name; an arbitrary, unique string - * - * Gets the value of an extended property of the group. Each group can have up to 10 client-set extended properties to store data of the client's - * choosing. - * - * Return value: the property's value, or %NULL - * - * Since: 0.7.0 - * Deprecated: 0.18.2: The Google Contacts service is deprecated. Use Google’s CardDAV interface instead. - */ -const gchar * -gdata_contacts_group_get_extended_property (GDataContactsGroup *self, const gchar *name) -{ - g_return_val_if_fail (GDATA_IS_CONTACTS_GROUP (self), NULL); - g_return_val_if_fail (name != NULL && *name != '\0', NULL); - return g_hash_table_lookup (self->priv->extended_properties, name); -} - -/** - * gdata_contacts_group_get_extended_properties: - * @self: a #GDataContactsGroup - * - * Gets the full list of extended properties of the group; a hash table mapping property name to value. - * - * Return value: (transfer none): a #GHashTable of extended properties - * - * Since: 0.7.0 - * Deprecated: 0.18.2: The Google Contacts service is deprecated. Use Google’s CardDAV interface instead. - */ -GHashTable * -gdata_contacts_group_get_extended_properties (GDataContactsGroup *self) -{ - g_return_val_if_fail (GDATA_IS_CONTACTS_GROUP (self), NULL); - return self->priv->extended_properties; -} - -/** - * gdata_contacts_group_set_extended_property: - * @self: a #GDataContactsGroup - * @name: the property name; an arbitrary, unique string - * @value: (allow-none): the property value, or %NULL - * - * Sets the value of a group's extended property. Extended property names are unique (but of the client's choosing), and reusing the same property - * name will result in the old value of that property being overwritten. - * - * To unset a property, set @value to %NULL or an empty string. - * - * A group may have up to 10 extended properties, and each should be reasonably small (i.e. not a photo or ringtone). For more information, see the - * online documentation. - * %FALSE will be returned if you attempt to add more than 10 extended properties. - * - * Return value: %TRUE if the property was updated or deleted successfully, %FALSE otherwise - * - * Since: 0.7.0 - * Deprecated: 0.18.2: The Google Contacts service is deprecated. Use Google’s CardDAV interface instead. - */ -gboolean -gdata_contacts_group_set_extended_property (GDataContactsGroup *self, const gchar *name, const gchar *value) -{ - GHashTable *extended_properties = self->priv->extended_properties; - - g_return_val_if_fail (GDATA_IS_CONTACTS_GROUP (self), FALSE); - g_return_val_if_fail (name != NULL && *name != '\0', FALSE); - - if (value == NULL || *value == '\0') { - /* Removing a property */ - g_hash_table_remove (extended_properties, name); - return TRUE; - } - - /* We can't add more than MAX_N_EXTENDED_PROPERTIES */ - if (g_hash_table_lookup (extended_properties, name) == NULL && g_hash_table_size (extended_properties) >= MAX_N_EXTENDED_PROPERTIES) - return FALSE; - - /* Updating an existing property or adding a new one */ - g_hash_table_insert (extended_properties, g_strdup (name), g_strdup (value)); - - return TRUE; -} - -/** - * gdata_contacts_group_is_deleted: - * @self: a #GDataContactsGroup - * - * Returns whether the group has recently been deleted. This will always return %FALSE unless #GDataContactsQuery:show-deleted has been set to %TRUE - * for the query which returned the group; then this function will return %TRUE only if the group has been deleted. - * - * If a group has been deleted, no other information is available about it. This is designed to allow groups to be deleted from local address - * books using incremental updates from the server (e.g. with #GDataQuery:updated-min and #GDataContactsQuery:show-deleted). - * - * Return value: %TRUE if the group has been deleted, %FALSE otherwise - * - * Since: 0.7.0 - * Deprecated: 0.18.2: The Google Contacts service is deprecated. Use Google’s CardDAV interface instead. - */ -gboolean -gdata_contacts_group_is_deleted (GDataContactsGroup *self) -{ - g_return_val_if_fail (GDATA_IS_CONTACTS_GROUP (self), FALSE); - return self->priv->deleted; -} - -G_GNUC_END_IGNORE_DEPRECATIONS diff --git a/gdata/services/contacts/gdata-contacts-group.h b/gdata/services/contacts/gdata-contacts-group.h deleted file mode 100644 index 4332f42e..00000000 --- a/gdata/services/contacts/gdata-contacts-group.h +++ /dev/null @@ -1,126 +0,0 @@ -/* -*- Mode: C; indent-tabs-mode: t; c-basic-offset: 8; tab-width: 8 -*- */ -/* - * GData Client - * Copyright (C) Philip Withnall 2010 - * - * GData Client is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2.1 of the License, or (at your option) any later version. - * - * GData Client is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with GData Client. If not, see . - */ - -#ifndef GDATA_CONTACTS_GROUP_H -#define GDATA_CONTACTS_GROUP_H - -#include -#include - -#include - -G_BEGIN_DECLS - -/** - * GDATA_CONTACTS_GROUP_CONTACTS: - * - * The system group ID for the "My Contacts" system group. - * - * Since: 0.7.0 - */ -#define GDATA_CONTACTS_GROUP_CONTACTS "Contacts" - -/** - * GDATA_CONTACTS_GROUP_FRIENDS: - * - * The system group ID for the "Friends" system group. - * - * Since: 0.7.0 - */ -#define GDATA_CONTACTS_GROUP_FRIENDS "Friends" - -/** - * GDATA_CONTACTS_GROUP_FAMILY: - * - * The system group ID for the "Family" system group. - * - * Since: 0.7.0 - */ -#define GDATA_CONTACTS_GROUP_FAMILY "Family" - -/** - * GDATA_CONTACTS_GROUP_COWORKERS: - * - * The system group ID for the "Coworkers" system group. - * - * Since: 0.7.0 - */ -#define GDATA_CONTACTS_GROUP_COWORKERS "Coworkers" - -#define GDATA_TYPE_CONTACTS_GROUP (gdata_contacts_group_get_type ()) -#define GDATA_CONTACTS_GROUP(o) (G_TYPE_CHECK_INSTANCE_CAST ((o), GDATA_TYPE_CONTACTS_GROUP, GDataContactsGroup)) -#define GDATA_CONTACTS_GROUP_CLASS(k) (G_TYPE_CHECK_CLASS_CAST((k), GDATA_TYPE_CONTACTS_GROUP, GDataContactsGroupClass)) -#define GDATA_IS_CONTACTS_GROUP(o) (G_TYPE_CHECK_INSTANCE_TYPE ((o), GDATA_TYPE_CONTACTS_GROUP)) -#define GDATA_IS_CONTACTS_GROUP_CLASS(k) (G_TYPE_CHECK_CLASS_TYPE ((k), GDATA_TYPE_CONTACTS_GROUP)) -#define GDATA_CONTACTS_GROUP_GET_CLASS(o) (G_TYPE_INSTANCE_GET_CLASS ((o), GDATA_TYPE_CONTACTS_GROUP, GDataContactsGroupClass)) - -typedef struct _GDataContactsGroupPrivate GDataContactsGroupPrivate; - -/** - * GDataContactsGroup: - * - * All the fields in the #GDataContactsGroup structure are private and should never be accessed directly. - * - * Since: 0.7.0 - */ -typedef struct { - GDataEntry parent; - GDataContactsGroupPrivate *priv; -} GDataContactsGroup; - -/** - * GDataContactsGroupClass: - * - * All the fields in the #GDataContactsGroupClass structure are private and should never be accessed directly. - * - * Since: 0.7.0 - */ -typedef struct { - /*< private >*/ - GDataEntryClass parent; - - /*< private >*/ - /* Padding for future expansion */ - void (*_g_reserved0) (void); - void (*_g_reserved1) (void); -} GDataContactsGroupClass; - -G_DEPRECATED -GType gdata_contacts_group_get_type (void) G_GNUC_CONST; - -G_DEPRECATED -GDataContactsGroup *gdata_contacts_group_new (const gchar *id) G_GNUC_WARN_UNUSED_RESULT G_GNUC_MALLOC; - -G_DEPRECATED -gint64 gdata_contacts_group_get_edited (GDataContactsGroup *self); -G_DEPRECATED -gboolean gdata_contacts_group_is_deleted (GDataContactsGroup *self) G_GNUC_PURE; -G_DEPRECATED -const gchar *gdata_contacts_group_get_system_group_id (GDataContactsGroup *self) G_GNUC_PURE; - -G_DEPRECATED -const gchar *gdata_contacts_group_get_extended_property (GDataContactsGroup *self, const gchar *name) G_GNUC_PURE; -G_DEPRECATED -GHashTable *gdata_contacts_group_get_extended_properties (GDataContactsGroup *self) G_GNUC_PURE; -G_DEPRECATED -gboolean gdata_contacts_group_set_extended_property (GDataContactsGroup *self, const gchar *name, const gchar *value); - -G_END_DECLS - -#endif /* !GDATA_CONTACTS_GROUP_H */ diff --git a/gdata/services/contacts/gdata-contacts-query.c b/gdata/services/contacts/gdata-contacts-query.c deleted file mode 100644 index 1cda4eaa..00000000 --- a/gdata/services/contacts/gdata-contacts-query.c +++ /dev/null @@ -1,505 +0,0 @@ -/* -*- Mode: C; indent-tabs-mode: t; c-basic-offset: 8; tab-width: 8 -*- */ -/* - * GData Client - * Copyright (C) Philip Withnall 2009–2010 - * - * GData Client is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2.1 of the License, or (at your option) any later version. - * - * GData Client is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with GData Client. If not, see . - */ - -/** - * SECTION:gdata-contacts-query - * @short_description: GData Contacts query object - * @stability: Stable - * @include: gdata/services/contacts/gdata-contacts-query.h - * - * #GDataContactsQuery represents a collection of query parameters specific to the Google Contacts service, which go above and beyond - * those catered for by #GDataQuery. - * - * For more information on the custom GData query parameters supported by #GDataContactsQuery, see the online documentation. - * - * - * Querying for Contacts - * - * GDataContactsService *service; - * gchar *group_id; - * GDataContactsQuery *query; - * GDataFeed *feed; - * GList *i; - * GError *error = NULL; - * - * /* Create a service and return the group we're querying within. */ - * service = create_contacts_service (); - * group_id = query_user_for_group (service); - * - * /* Create the query to use. We're going to query for contacts which match the search term "John" within a given group, - * * including deleted contacts. The group is specified by its ID. */ - * query = gdata_contacts_query_new ("John"); - * gdata_contacts_query_set_show_deleted (query, TRUE); - * gdata_contacts_query_set_group (query, group_id); - * - * g_free (group_id); - * - * /* Execute the query */ - * feed = gdata_contacts_service_query_contacts (service, query, NULL, NULL, NULL, &error); - * - * g_object_unref (query); - * g_object_unref (service); - * - * if (error != NULL) { - * g_error ("Error querying for contacts: %s", error->message); - * g_error_free (error); - * return; - * } - * - * /* Iterate through the returned contacts and do something with them */ - * for (i = gdata_feed_get_entries (feed); i != NULL; i = i->next) { - * GDataContactsContact *contact = GDATA_CONTACTS_CONTACT (i->data); - * - * /* Do something with the contact here, such as insert it into a UI */ - * } - * - * g_object_unref (feed); - * - * - * - * Since: 0.2.0 - * Deprecated: 0.18.2: The Google Contacts service is deprecated. Use Google’s CardDAV interface instead. - */ - -#include -#include -#include -#include - -#include "gdata-contacts-query.h" -#include "gdata-query.h" -#include "gdata-private.h" - -G_GNUC_BEGIN_IGNORE_DEPRECATIONS - -static void gdata_contacts_query_finalize (GObject *object); -static void gdata_contacts_query_get_property (GObject *object, guint property_id, GValue *value, GParamSpec *pspec); -static void gdata_contacts_query_set_property (GObject *object, guint property_id, const GValue *value, GParamSpec *pspec); -static void get_query_uri (GDataQuery *self, const gchar *feed_uri, GString *query_uri, gboolean *params_started); - -struct _GDataContactsQueryPrivate { - gchar *order_by; /* TODO: #defined values */ - gboolean show_deleted; - gchar *sort_order; /* TODO: #defined values */ - gchar *group; -}; - -enum { - PROP_ORDER_BY = 1, - PROP_SHOW_DELETED, - PROP_SORT_ORDER, - PROP_GROUP -}; - -G_DEFINE_TYPE_WITH_PRIVATE (GDataContactsQuery, gdata_contacts_query, GDATA_TYPE_QUERY) - -static void -gdata_contacts_query_class_init (GDataContactsQueryClass *klass) -{ - GObjectClass *gobject_class = G_OBJECT_CLASS (klass); - GDataQueryClass *query_class = GDATA_QUERY_CLASS (klass); - - gobject_class->set_property = gdata_contacts_query_set_property; - gobject_class->get_property = gdata_contacts_query_get_property; - gobject_class->finalize = gdata_contacts_query_finalize; - - query_class->get_query_uri = get_query_uri; - - /** - * GDataContactsQuery:order-by: - * - * Sorting criterion. The only supported value is lastmodified. - * - * Since: 0.2.0 - * Deprecated: 0.18.2: The Google Contacts service is deprecated. Use Google’s CardDAV interface instead. - */ - g_object_class_install_property (gobject_class, PROP_ORDER_BY, - g_param_spec_string ("order-by", - "Order by", "Sorting criterion.", - NULL, - G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS)); - - /** - * GDataContactsQuery:show-deleted: - * - * Whether to include deleted contacts in the query feed. Deleted contacts return %TRUE - * from gdata_contacts_contact_is_deleted(), and have no other information. They do not - * normally appear in query results. - * - * Since: 0.2.0 - * Deprecated: 0.18.2: The Google Contacts service is deprecated. Use Google’s CardDAV interface instead. - */ - g_object_class_install_property (gobject_class, PROP_SHOW_DELETED, - g_param_spec_boolean ("show-deleted", - "Show deleted?", "Whether to include deleted contacts in the query feed.", - FALSE, - G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS)); - - /** - * GDataContactsQuery:sort-order: - * - * Sorting order direction. Can be either ascending or descending. - * - * Since: 0.2.0 - * Deprecated: 0.18.2: The Google Contacts service is deprecated. Use Google’s CardDAV interface instead. - */ - g_object_class_install_property (gobject_class, PROP_SORT_ORDER, - g_param_spec_string ("sort-order", - "Sort order", "Sorting order direction.", - NULL, - G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS)); - - /** - * GDataContactsQuery:group: - * - * Constrains the results to only those belonging to the group specified. The value of this parameter - * should be a group ID URI. - * - * Since: 0.2.0 - * Deprecated: 0.18.2: The Google Contacts service is deprecated. Use Google’s CardDAV interface instead. - */ - g_object_class_install_property (gobject_class, PROP_GROUP, - g_param_spec_string ("group", - "Group", "Constrains the results to only those belonging to the group specified.", - NULL, - G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS)); -} - -static void -gdata_contacts_query_init (GDataContactsQuery *self) -{ - self->priv = gdata_contacts_query_get_instance_private (self); - - /* https://developers.google.com/google-apps/contacts/v3/reference#contacts-query-parameters-reference - * indicates that the Contacts service uses index pagination, but all - * the results include next/previous URIs, so use those instead. - * (We have to — the #GDataService code will use them unconditionally.) */ - _gdata_query_set_pagination_type (GDATA_QUERY (self), - GDATA_QUERY_PAGINATION_URIS); -} - -static void -gdata_contacts_query_finalize (GObject *object) -{ - GDataContactsQueryPrivate *priv = GDATA_CONTACTS_QUERY (object)->priv; - - g_free (priv->order_by); - g_free (priv->sort_order); - g_free (priv->group); - - /* Chain up to the parent class */ - G_OBJECT_CLASS (gdata_contacts_query_parent_class)->finalize (object); -} - -static void -gdata_contacts_query_get_property (GObject *object, guint property_id, GValue *value, GParamSpec *pspec) -{ - GDataContactsQueryPrivate *priv = GDATA_CONTACTS_QUERY (object)->priv; - - switch (property_id) { - case PROP_ORDER_BY: - g_value_set_string (value, priv->order_by); - break; - case PROP_SHOW_DELETED: - g_value_set_boolean (value, priv->show_deleted); - break; - case PROP_SORT_ORDER: - g_value_set_string (value, priv->sort_order); - break; - case PROP_GROUP: - g_value_set_string (value, priv->group); - break; - default: - /* We don't have any other property... */ - G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec); - break; - } -} - -static void -gdata_contacts_query_set_property (GObject *object, guint property_id, const GValue *value, GParamSpec *pspec) -{ - GDataContactsQuery *self = GDATA_CONTACTS_QUERY (object); - - switch (property_id) { - case PROP_ORDER_BY: - gdata_contacts_query_set_order_by (self, g_value_get_string (value)); - break; - case PROP_SHOW_DELETED: - gdata_contacts_query_set_show_deleted (self, g_value_get_boolean (value)); - break; - case PROP_SORT_ORDER: - gdata_contacts_query_set_sort_order (self, g_value_get_string (value)); - break; - case PROP_GROUP: - gdata_contacts_query_set_group (self, g_value_get_string (value)); - break; - default: - /* We don't have any other property... */ - G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec); - break; - } -} - -static void -get_query_uri (GDataQuery *self, const gchar *feed_uri, GString *query_uri, gboolean *params_started) -{ - GDataContactsQueryPrivate *priv = GDATA_CONTACTS_QUERY (self)->priv; - - #define APPEND_SEP g_string_append_c (query_uri, (*params_started == FALSE) ? '?' : '&'); *params_started = TRUE; - - /* Chain up to the parent class */ - GDATA_QUERY_CLASS (gdata_contacts_query_parent_class)->get_query_uri (self, feed_uri, query_uri, params_started); - - if (priv->order_by != NULL) { - APPEND_SEP - g_string_append (query_uri, "orderby="); - g_string_append_uri_escaped (query_uri, priv->order_by, NULL, FALSE); - } - - APPEND_SEP - if (priv->show_deleted == TRUE) - g_string_append (query_uri, "showdeleted=true"); - else - g_string_append (query_uri, "showdeleted=false"); - - if (priv->sort_order != NULL) { - APPEND_SEP - g_string_append (query_uri, "sortorder="); - g_string_append_uri_escaped (query_uri, priv->sort_order, NULL, FALSE); - } - - if (priv->group != NULL) { - APPEND_SEP - g_string_append (query_uri, "group="); - g_string_append_uri_escaped (query_uri, priv->group, NULL, FALSE); - } -} - -/** - * gdata_contacts_query_new: - * @q: (allow-none): a query string, or %NULL - * - * Creates a new #GDataContactsQuery with its #GDataQuery:q property set to @q. - * - * Return value: a new #GDataContactsQuery - * - * Since: 0.2.0 - * Deprecated: 0.18.2: The Google Contacts service is deprecated. Use Google’s CardDAV interface instead. - */ -GDataContactsQuery * -gdata_contacts_query_new (const gchar *q) -{ - return g_object_new (GDATA_TYPE_CONTACTS_QUERY, "q", q, NULL); -} - -/** - * gdata_contacts_query_new_with_limits: - * @q: (allow-none): a query string, or %NULL - * @start_index: a one-based start index for the results, or 0 - * @max_results: the maximum number of results to return, or 0 - * - * Creates a new #GDataContactsQuery with its #GDataQuery:q property set to @q, and the limits @start_index and @max_results - * applied. - * - * Return value: a new #GDataContactsQuery - * - * Since: 0.2.0 - * Deprecated: 0.18.2: The Google Contacts service is deprecated. Use Google’s CardDAV interface instead. - */ -GDataContactsQuery * -gdata_contacts_query_new_with_limits (const gchar *q, guint start_index, guint max_results) -{ - return g_object_new (GDATA_TYPE_CONTACTS_QUERY, - "q", q, - "start-index", start_index, - "max-results", max_results, - NULL); -} - -/** - * gdata_contacts_query_get_order_by: - * @self: a #GDataContactsQuery - * - * Gets the #GDataContactsQuery:order-by property. - * - * Return value: the order by property, or %NULL if it is unset - * - * Since: 0.2.0 - * Deprecated: 0.18.2: The Google Contacts service is deprecated. Use Google’s CardDAV interface instead. - */ -const gchar * -gdata_contacts_query_get_order_by (GDataContactsQuery *self) -{ - g_return_val_if_fail (GDATA_IS_CONTACTS_QUERY (self), NULL); - return self->priv->order_by; -} - -/** - * gdata_contacts_query_set_order_by: - * @self: a #GDataContactsQuery - * @order_by: (allow-none): a new order by string, or %NULL - * - * Sets the #GDataContactsQuery:order-by property of the #GDataContactsQuery to the new order by string, @order_by. - * - * Set @order_by to %NULL to unset the property in the query URI. - * - * Since: 0.2.0 - * Deprecated: 0.18.2: The Google Contacts service is deprecated. Use Google’s CardDAV interface instead. - */ -void -gdata_contacts_query_set_order_by (GDataContactsQuery *self, const gchar *order_by) -{ - g_return_if_fail (GDATA_IS_CONTACTS_QUERY (self)); - - g_free (self->priv->order_by); - self->priv->order_by = g_strdup (order_by); - g_object_notify (G_OBJECT (self), "order-by"); - - /* Our current ETag will no longer be relevant */ - gdata_query_set_etag (GDATA_QUERY (self), NULL); -} - -/** - * gdata_contacts_query_show_deleted: - * @self: a #GDataContactsQuery - * - * Gets the #GDataContactsQuery:show-deleted property. - * - * Return value: %TRUE if deleted contacts should be shown, %FALSE otherwise - * - * Since: 0.2.0 - * Deprecated: 0.18.2: The Google Contacts service is deprecated. Use Google’s CardDAV interface instead. - */ -gboolean -gdata_contacts_query_show_deleted (GDataContactsQuery *self) -{ - g_return_val_if_fail (GDATA_IS_CONTACTS_QUERY (self), FALSE); - return self->priv->show_deleted; -} - -/** - * gdata_contacts_query_set_show_deleted: - * @self: a #GDataContactsQuery - * @show_deleted: %TRUE to show deleted contacts, %FALSE otherwise - * - * Sets the #GDataContactsQuery:show-deleted property of the #GDataContactsQuery. - * - * Since: 0.2.0 - * Deprecated: 0.18.2: The Google Contacts service is deprecated. Use Google’s CardDAV interface instead. - */ -void -gdata_contacts_query_set_show_deleted (GDataContactsQuery *self, gboolean show_deleted) -{ - g_return_if_fail (GDATA_IS_CONTACTS_QUERY (self)); - self->priv->show_deleted = show_deleted; - g_object_notify (G_OBJECT (self), "show-deleted"); - - /* Our current ETag will no longer be relevant */ - gdata_query_set_etag (GDATA_QUERY (self), NULL); -} - -/** - * gdata_contacts_query_get_sort_order: - * @self: a #GDataContactsQuery - * - * Gets the #GDataContactsQuery:sort-order property. - * - * Return value: the sort order property, or %NULL if it is unset - * - * Since: 0.2.0 - * Deprecated: 0.18.2: The Google Contacts service is deprecated. Use Google’s CardDAV interface instead. - */ -const gchar * -gdata_contacts_query_get_sort_order (GDataContactsQuery *self) -{ - g_return_val_if_fail (GDATA_IS_CONTACTS_QUERY (self), NULL); - return self->priv->sort_order; -} - -/** - * gdata_contacts_query_set_sort_order: - * @self: a #GDataContactsQuery - * @sort_order: (allow-none): a new sort order string, or %NULL - * - * Sets the #GDataContactsQuery:sort-order property of the #GDataContactsQuery to the new sort order string, @sort_order. - * - * Set @sort_order to %NULL to unset the property in the query URI. - * - * Since: 0.2.0 - * Deprecated: 0.18.2: The Google Contacts service is deprecated. Use Google’s CardDAV interface instead. - */ -void -gdata_contacts_query_set_sort_order (GDataContactsQuery *self, const gchar *sort_order) -{ - g_return_if_fail (GDATA_IS_CONTACTS_QUERY (self)); - - g_free (self->priv->sort_order); - self->priv->sort_order = g_strdup (sort_order); - g_object_notify (G_OBJECT (self), "sort-order"); - - /* Our current ETag will no longer be relevant */ - gdata_query_set_etag (GDATA_QUERY (self), NULL); -} - -/** - * gdata_contacts_query_get_group: - * @self: a #GDataContactsQuery - * - * Gets the #GDataContactsQuery:group property. - * - * Return value: the group property, or %NULL if it is unset - * - * Since: 0.2.0 - * Deprecated: 0.18.2: The Google Contacts service is deprecated. Use Google’s CardDAV interface instead. - */ -const gchar * -gdata_contacts_query_get_group (GDataContactsQuery *self) -{ - g_return_val_if_fail (GDATA_IS_CONTACTS_QUERY (self), NULL); - return self->priv->group; -} - -/** - * gdata_contacts_query_set_group: - * @self: a #GDataContactsQuery - * @group: (allow-none): a new group ID URI, or %NULL - * - * Sets the #GDataContactsQuery:group property of the #GDataContactsQuery to the new group ID URI, @group. - * - * Set @group to %NULL to unset the property in the query URI. - * - * Since: 0.2.0 - * Deprecated: 0.18.2: The Google Contacts service is deprecated. Use Google’s CardDAV interface instead. - */ -void -gdata_contacts_query_set_group (GDataContactsQuery *self, const gchar *group) -{ - g_return_if_fail (GDATA_IS_CONTACTS_QUERY (self)); - - g_free (self->priv->group); - self->priv->group = g_strdup (group); - g_object_notify (G_OBJECT (self), "group"); - - /* Our current ETag will no longer be relevant */ - gdata_query_set_etag (GDATA_QUERY (self), NULL); -} - -G_GNUC_END_IGNORE_DEPRECATIONS diff --git a/gdata/services/contacts/gdata-contacts-query.h b/gdata/services/contacts/gdata-contacts-query.h deleted file mode 100644 index a961b7fc..00000000 --- a/gdata/services/contacts/gdata-contacts-query.h +++ /dev/null @@ -1,96 +0,0 @@ -/* -*- Mode: C; indent-tabs-mode: t; c-basic-offset: 8; tab-width: 8 -*- */ -/* - * GData Client - * Copyright (C) Philip Withnall 2009–2010 - * - * GData Client is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2.1 of the License, or (at your option) any later version. - * - * GData Client is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with GData Client. If not, see . - */ - -#ifndef GDATA_CONTACTS_QUERY_H -#define GDATA_CONTACTS_QUERY_H - -#include -#include - -#include - -G_BEGIN_DECLS - -#define GDATA_TYPE_CONTACTS_QUERY (gdata_contacts_query_get_type ()) -#define GDATA_CONTACTS_QUERY(o) (G_TYPE_CHECK_INSTANCE_CAST ((o), GDATA_TYPE_CONTACTS_QUERY, GDataContactsQuery)) -#define GDATA_CONTACTS_QUERY_CLASS(k) (G_TYPE_CHECK_CLASS_CAST((k), GDATA_TYPE_CONTACTS_QUERY, GDataContactsQueryClass)) -#define GDATA_IS_CONTACTS_QUERY(o) (G_TYPE_CHECK_INSTANCE_TYPE ((o), GDATA_TYPE_CONTACTS_QUERY)) -#define GDATA_IS_CONTACTS_QUERY_CLASS(k) (G_TYPE_CHECK_CLASS_TYPE ((k), GDATA_TYPE_CONTACTS_QUERY)) -#define GDATA_CONTACTS_QUERY_GET_CLASS(o) (G_TYPE_INSTANCE_GET_CLASS ((o), GDATA_TYPE_CONTACTS_QUERY, GDataContactsQueryClass)) - -typedef struct _GDataContactsQueryPrivate GDataContactsQueryPrivate; - -/** - * GDataContactsQuery: - * - * All the fields in the #GDataContactsQuery structure are private and should never be accessed directly. - * - * Since: 0.2.0 - */ -typedef struct { - GDataQuery parent; - GDataContactsQueryPrivate *priv; -} GDataContactsQuery; - -/** - * GDataContactsQueryClass: - * - * All the fields in the #GDataContactsQueryClass structure are private and should never be accessed directly. - * - * Since: 0.2.0 - */ -typedef struct { - /*< private >*/ - GDataQueryClass parent; - - /*< private >*/ - /* Padding for future expansion */ - void (*_g_reserved0) (void); - void (*_g_reserved1) (void); -} GDataContactsQueryClass; - -G_DEPRECATED -GType gdata_contacts_query_get_type (void) G_GNUC_CONST; - -G_DEPRECATED -GDataContactsQuery *gdata_contacts_query_new (const gchar *q) G_GNUC_WARN_UNUSED_RESULT G_GNUC_MALLOC; -G_DEPRECATED -GDataContactsQuery *gdata_contacts_query_new_with_limits (const gchar *q, guint start_index, - guint max_results) G_GNUC_WARN_UNUSED_RESULT G_GNUC_MALLOC; - -G_DEPRECATED -const gchar *gdata_contacts_query_get_order_by (GDataContactsQuery *self) G_GNUC_PURE; -G_DEPRECATED -void gdata_contacts_query_set_order_by (GDataContactsQuery *self, const gchar *order_by); -G_DEPRECATED -gboolean gdata_contacts_query_show_deleted (GDataContactsQuery *self) G_GNUC_PURE; -G_DEPRECATED -void gdata_contacts_query_set_show_deleted (GDataContactsQuery *self, gboolean show_deleted); -G_DEPRECATED -const gchar *gdata_contacts_query_get_sort_order (GDataContactsQuery *self) G_GNUC_PURE; -G_DEPRECATED -void gdata_contacts_query_set_sort_order (GDataContactsQuery *self, const gchar *sort_order); -G_DEPRECATED -const gchar *gdata_contacts_query_get_group (GDataContactsQuery *self) G_GNUC_PURE; -G_DEPRECATED -void gdata_contacts_query_set_group (GDataContactsQuery *self, const gchar *group); - -G_END_DECLS - -#endif /* !GDATA_CONTACTS_QUERY_H */ diff --git a/gdata/services/contacts/gdata-contacts-service.c b/gdata/services/contacts/gdata-contacts-service.c deleted file mode 100644 index 91ed73a3..00000000 --- a/gdata/services/contacts/gdata-contacts-service.c +++ /dev/null @@ -1,589 +0,0 @@ -/* -*- Mode: C; indent-tabs-mode: t; c-basic-offset: 8; tab-width: 8 -*- */ -/* - * GData Client - * Copyright (C) Philip Withnall 2009 - * - * GData Client is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2.1 of the License, or (at your option) any later version. - * - * GData Client is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with GData Client. If not, see . - */ - -/** - * SECTION:gdata-contacts-service - * @short_description: GData Contacts service object - * @stability: Stable - * @include: gdata/services/contacts/gdata-contacts-service.h - * - * #GDataContactsService is a subclass of #GDataService for communicating with the GData API of Google Contacts. It supports querying - * for, inserting, editing and deleting contacts from a Google address book. - * - * As of December 2021, the [Google Contacts API server will be - * disabled](https://developers.google.com/contacts/v3/announcement). This - * client-side API is deprecated. The - * [CardDAV interface](https://developers.google.com/people/carddav) should be - * used instead. - * - * For more details of Google Contacts' GData API, see the - * online documentation. - * - * - * Querying for Groups - * - * GDataContactsService *service; - * GDataFeed *feed; - * GList *i; - * GError *error = NULL; - * - * /* Create a service */ - * service = create_contacts_service (); - * - * /* Query for groups */ - * feed = gdata_contacts_service_query_groups (service, NULL, NULL, NULL, NULL, &error); - * - * g_object_unref (service); - * - * if (error != NULL) { - * g_error ("Error querying for groups: %s", error->message); - * g_error_free (error); - * return; - * } - * - * /* Iterate through the returned groups and do something with them */ - * for (i = gdata_feed_get_entries (feed); i != NULL; i = i->next) { - * const gchar *system_group_id, *group_name; - * gboolean is_system_group; - * GDataContactsGroup *group = GDATA_CONTACTS_GROUP (i->data); - * - * /* Determine whether the group's a system group. If so, you should use the system group ID to provide your application's own - * * translations of the group name, as it's not translated. */ - * system_group_id = gdata_contacts_group_get_system_group_id (group); - * is_system_group = (system_group_id != NULL) ? TRUE : FALSE; - * group_name = (is_system_group == TRUE) ? get_group_name_for_system_group_id (system_group_id) - * : gdata_entry_get_title (GDATA_ENTRY (group)); - * - * /* Do something with the group here, such as insert it into a UI. Note that system groups are not allowed to be deleted, - * * so you may want to make certain parts of your UI insensitive accordingly if the group is a system group. */ - * } - * - * g_object_unref (feed); - * - * - * - * The Contacts service can be manipulated using batch operations, too. See the - * online documentation on batch - * operations for more information. - * - * - * Performing a Batch Operation on Contacts - * - * GDataContactsService *service; - * GDataBatchOperation *operation; - * GDataFeed *feed; - * GDataLink *batch_link; - * GList *i; - * GError *error = NULL; - * - * /* Create a service */ - * service = create_contacts_service (); - * - * /* Create the batch operation; this requires that we have done a query first so that we can get the batch link */ - * feed = do_some_query (service); - * batch_link = gdata_feed_look_up_link (feed, GDATA_LINK_BATCH); - * operation = gdata_batchable_create_operation (GDATA_BATCHABLE (service), gdata_link_get_uri (batch_link)); - * g_object_unref (feed); - * - * gdata_batch_operation_add_query (operation, contact_entry_id_to_query, GDATA_TYPE_CONTACTS_CONTACT, - * (GDataBatchOperationCallback) batch_query_cb, user_data); - * gdata_batch_operation_add_insertion (operation, new_entry, (GDataBatchOperationCallback) batch_insertion_cb, user_data); - * gdata_batch_operation_add_update (operation, old_entry, (GDataBatchOperationCallback) batch_update_cb, user_data); - * gdata_batch_operation_add_deletion (operation, entry_to_delete, (GDataBatchOperationCallback) batch_deletion_cb, user_data); - * - * /* Run the batch operation and handle the results in the various callbacks */ - * gdata_test_batch_operation_run (operation, NULL, &error); - * - * g_object_unref (operation); - * g_object_unref (service); - * - * if (error != NULL) { - * g_error ("Error running batch operation: %s", error->message); - * g_error_free (error); - * return; - * } - * - * static void - * batch_query_cb (guint operation_id, GDataBatchOperationType operation_type, GDataEntry *entry, GError *error, gpointer user_data) - * { - * /* operation_type == GDATA_BATCH_OPERATION_QUERY */ - * /* Reference and do something with the returned entry. */ - * } - * - * static void - * batch_insertion_cb (guint operation_id, GDataBatchOperationType operation_type, GDataEntry *entry, GError *error, gpointer user_data) - * { - * /* operation_type == GDATA_BATCH_OPERATION_INSERTION */ - * /* Reference and do something with the returned entry. */ - * } - * - * static void - * batch_update_cb (guint operation_id, GDataBatchOperationType operation_type, GDataEntry *entry, GError *error, gpointer user_data) - * { - * /* operation_type == GDATA_BATCH_OPERATION_UPDATE */ - * /* Reference and do something with the returned entry. */ - * } - * - * static void - * batch_deletion_cb (guint operation_id, GDataBatchOperationType operation_type, GDataEntry *entry, GError *error, gpointer user_data) - * { - * /* operation_type == GDATA_BATCH_OPERATION_DELETION, entry == NULL */ - * } - * - * - * - * Since: 0.2.0 - * Deprecated: 0.18.2: The Google Contacts service is deprecated. Use Google’s CardDAV interface instead. - */ - -#include -#include -#include -#include -#include - -#include "gdata-contacts-service.h" -#include "gdata-batchable.h" -#include "gdata-service.h" -#include "gdata-private.h" -#include "gdata-query.h" - -G_GNUC_BEGIN_IGNORE_DEPRECATIONS - -static GList *get_authorization_domains (void); - -_GDATA_DEFINE_AUTHORIZATION_DOMAIN (contacts, "cp", "https://www.google.com/m8/feeds/") -G_DEFINE_TYPE_WITH_CODE (GDataContactsService, gdata_contacts_service, GDATA_TYPE_SERVICE, - G_IMPLEMENT_INTERFACE (GDATA_TYPE_BATCHABLE, NULL)) - -static void -gdata_contacts_service_class_init (GDataContactsServiceClass *klass) -{ - GDataServiceClass *service_class = GDATA_SERVICE_CLASS (klass); - service_class->api_version = "3"; - service_class->get_authorization_domains = get_authorization_domains; -} - -static void -gdata_contacts_service_init (GDataContactsService *self) -{ - /* Nothing to see here */ -} - -static GList * -get_authorization_domains (void) -{ - return g_list_prepend (NULL, get_contacts_authorization_domain ()); -} - -/** - * gdata_contacts_service_new: - * @authorizer: (allow-none): a #GDataAuthorizer to authorize the service's requests, or %NULL - * - * Creates a new #GDataContactsService using the given #GDataAuthorizer. If @authorizer is %NULL, all requests are made as an unauthenticated user. - * - * Return value: a new #GDataContactsService, or %NULL; unref with g_object_unref() - * - * Since: 0.9.0 - * Deprecated: 0.18.2: The Google Contacts service is deprecated. Use Google’s CardDAV interface instead. - */ -GDataContactsService * -gdata_contacts_service_new (GDataAuthorizer *authorizer) -{ - g_return_val_if_fail (authorizer == NULL || GDATA_IS_AUTHORIZER (authorizer), NULL); - - return g_object_new (GDATA_TYPE_CONTACTS_SERVICE, - "authorizer", authorizer, - NULL); -} - -/** - * gdata_contacts_service_get_primary_authorization_domain: - * - * The primary #GDataAuthorizationDomain for interacting with Google Contacts. This will not normally need to be used, as it's used internally - * by the #GDataContactsService methods. However, if using the plain #GDataService methods to implement custom queries or requests which libgdata - * does not support natively, then this domain may be needed to authorize the requests. - * - * The domain never changes, and is interned so that pointer comparison can be used to differentiate it from other authorization domains. - * - * Return value: (transfer none): the service's authorization domain - * - * Since: 0.9.0 - * Deprecated: 0.18.2: The Google Contacts service is deprecated. Use Google’s CardDAV interface instead. - */ -GDataAuthorizationDomain * -gdata_contacts_service_get_primary_authorization_domain (void) -{ - return get_contacts_authorization_domain (); -} - -/** - * gdata_contacts_service_query_contacts: - * @self: a #GDataContactsService - * @query: (allow-none): a #GDataQuery with the query parameters, or %NULL - * @cancellable: (allow-none): optional #GCancellable object, or %NULL - * @progress_callback: (allow-none) (scope call) (closure progress_user_data): a #GDataQueryProgressCallback to call when an entry is loaded, or %NULL - * @progress_user_data: (closure): data to pass to the @progress_callback function - * @error: a #GError, or %NULL - * - * Queries the service to return a list of contacts matching the given @query. - * - * For more details, see gdata_service_query(). - * - * Return value: (transfer full): a #GDataFeed of query results; unref with g_object_unref() - * - * Since: 0.2.0 - * Deprecated: 0.18.2: The Google Contacts service is deprecated. Use Google’s CardDAV interface instead. - */ -GDataFeed * -gdata_contacts_service_query_contacts (GDataContactsService *self, GDataQuery *query, GCancellable *cancellable, - GDataQueryProgressCallback progress_callback, gpointer progress_user_data, GError **error) -{ - GDataFeed *feed; - gchar *request_uri; - - g_return_val_if_fail (GDATA_IS_CONTACTS_SERVICE (self), NULL); - g_return_val_if_fail (query == NULL || GDATA_IS_QUERY (query), NULL); - g_return_val_if_fail (cancellable == NULL || G_IS_CANCELLABLE (cancellable), NULL); - g_return_val_if_fail (error == NULL || *error == NULL, NULL); - - /* Ensure we're authenticated first */ - if (gdata_authorizer_is_authorized_for_domain (gdata_service_get_authorizer (GDATA_SERVICE (self)), - get_contacts_authorization_domain ()) == FALSE) { - g_set_error_literal (error, GDATA_SERVICE_ERROR, GDATA_SERVICE_ERROR_AUTHENTICATION_REQUIRED, - _("You must be authenticated to query contacts.")); - return NULL; - } - - request_uri = g_strconcat (_gdata_service_get_scheme (), "://www.google.com/m8/feeds/contacts/default/full", NULL); - feed = gdata_service_query (GDATA_SERVICE (self), get_contacts_authorization_domain (), request_uri, GDATA_QUERY (query), - GDATA_TYPE_CONTACTS_CONTACT, cancellable, progress_callback, progress_user_data, error); - g_free (request_uri); - - return feed; -} - -/** - * gdata_contacts_service_query_contacts_async: - * @self: a #GDataContactsService - * @query: (allow-none): a #GDataQuery with the query parameters, or %NULL - * @cancellable: (allow-none): optional #GCancellable object, or %NULL - * @progress_callback: (allow-none) (closure progress_user_data): a #GDataQueryProgressCallback to call when an entry is loaded, or %NULL - * @progress_user_data: (closure): data to pass to the @progress_callback function - * @destroy_progress_user_data: (allow-none): the function to call when @progress_callback will not be called any more, or %NULL. This function will be - * called with @progress_user_data as a parameter and can be used to free any memory allocated for it. - * @callback: a #GAsyncReadyCallback to call when the query is finished - * @user_data: (closure): data to pass to the @callback function - * - * Queries the service to return a list of contacts matching the given @query. @self and - * @query are all reffed when this function is called, so can safely be unreffed after this function returns. - * - * For more details, see gdata_contacts_service_query_contacts(), which is the synchronous version of this function, - * and gdata_service_query_async(), which is the base asynchronous query function. - * - * Since: 0.9.1 - * Deprecated: 0.18.2: The Google Contacts service is deprecated. Use Google’s CardDAV interface instead. - */ -void -gdata_contacts_service_query_contacts_async (GDataContactsService *self, GDataQuery *query, GCancellable *cancellable, - GDataQueryProgressCallback progress_callback, gpointer progress_user_data, - GDestroyNotify destroy_progress_user_data, - GAsyncReadyCallback callback, gpointer user_data) -{ - gchar *request_uri; - - g_return_if_fail (GDATA_IS_CONTACTS_SERVICE (self)); - g_return_if_fail (query == NULL || GDATA_IS_QUERY (query)); - g_return_if_fail (cancellable == NULL || G_IS_CANCELLABLE (cancellable)); - g_return_if_fail (callback != NULL); - - /* Ensure we're authenticated first */ - if (gdata_authorizer_is_authorized_for_domain (gdata_service_get_authorizer (GDATA_SERVICE (self)), - get_contacts_authorization_domain ()) == FALSE) { - g_autoptr(GTask) task = NULL; - - task = g_task_new (self, cancellable, callback, user_data); - g_task_set_source_tag (task, gdata_service_query_async); - g_task_return_new_error (task, GDATA_SERVICE_ERROR, GDATA_SERVICE_ERROR_AUTHENTICATION_REQUIRED, "%s", - _("You must be authenticated to query contacts.")); - - return; - } - - request_uri = g_strconcat (_gdata_service_get_scheme (), "://www.google.com/m8/feeds/contacts/default/full", NULL); - gdata_service_query_async (GDATA_SERVICE (self), get_contacts_authorization_domain (), request_uri, GDATA_QUERY (query), - GDATA_TYPE_CONTACTS_CONTACT, cancellable, progress_callback, progress_user_data, - destroy_progress_user_data, callback, user_data); - g_free (request_uri); -} - -/** - * gdata_contacts_service_insert_contact: - * @self: a #GDataContactsService - * @contact: the #GDataContactsContact to insert - * @cancellable: (allow-none): optional #GCancellable object, or %NULL - * @error: a #GError, or %NULL - * - * Inserts @contact by uploading it to the online contacts service. - * - * For more details, see gdata_service_insert_entry(). - * - * Return value: (transfer full): an updated #GDataContactsContact, or %NULL; unref with g_object_unref() - * - * Since: 0.2.0 - * Deprecated: 0.18.2: The Google Contacts service is deprecated. Use Google’s CardDAV interface instead. - */ -GDataContactsContact * -gdata_contacts_service_insert_contact (GDataContactsService *self, GDataContactsContact *contact, GCancellable *cancellable, GError **error) -{ - gchar *uri; - GDataEntry *entry; - - g_return_val_if_fail (GDATA_IS_CONTACTS_SERVICE (self), NULL); - g_return_val_if_fail (GDATA_IS_CONTACTS_CONTACT (contact), NULL); - g_return_val_if_fail (cancellable == NULL || G_IS_CANCELLABLE (cancellable), NULL); - g_return_val_if_fail (error == NULL || *error == NULL, NULL); - - uri = g_strconcat (_gdata_service_get_scheme (), "://www.google.com/m8/feeds/contacts/default/full", NULL); - entry = gdata_service_insert_entry (GDATA_SERVICE (self), get_contacts_authorization_domain (), uri, GDATA_ENTRY (contact), cancellable, - error); - g_free (uri); - - return GDATA_CONTACTS_CONTACT (entry); -} - -/** - * gdata_contacts_service_insert_contact_async: - * @self: a #GDataContactsService - * @contact: the #GDataContactsContact to insert - * @cancellable: (allow-none): optional #GCancellable object, or %NULL - * @callback: a #GAsyncReadyCallback to call when insertion is finished - * @user_data: (closure): data to pass to the @callback function - * - * Inserts @contact by uploading it to the online contacts service. @self and @contact are both reffed when this function is called, so can safely be - * unreffed after this function returns. - * - * @callback should call gdata_service_insert_entry_finish() to obtain a #GDataContactsContact representing the inserted contact and to check for - * possible errors. - * - * For more details, see gdata_contacts_service_insert_contact(), which is the synchronous version of this function, - * and gdata_service_insert_entry_async(), which is the base asynchronous insertion function. - * - * Since: 0.7.0 - * Deprecated: 0.18.2: The Google Contacts service is deprecated. Use Google’s CardDAV interface instead. - */ -void -gdata_contacts_service_insert_contact_async (GDataContactsService *self, GDataContactsContact *contact, GCancellable *cancellable, - GAsyncReadyCallback callback, gpointer user_data) -{ - gchar *uri; - - g_return_if_fail (GDATA_IS_CONTACTS_SERVICE (self)); - g_return_if_fail (GDATA_IS_CONTACTS_CONTACT (contact)); - g_return_if_fail (cancellable == NULL || G_IS_CANCELLABLE (cancellable)); - - uri = g_strconcat (_gdata_service_get_scheme (), "://www.google.com/m8/feeds/contacts/default/full", NULL); - gdata_service_insert_entry_async (GDATA_SERVICE (self), get_contacts_authorization_domain (), uri, GDATA_ENTRY (contact), cancellable, - callback, user_data); - g_free (uri); -} - -/** - * gdata_contacts_service_query_groups: - * @self: a #GDataContactsService - * @query: (allow-none): a #GDataQuery with the query parameters, or %NULL - * @cancellable: (allow-none): optional #GCancellable object, or %NULL - * @progress_callback: (allow-none) (scope call) (closure progress_user_data): a #GDataQueryProgressCallback to call when an entry is loaded, or %NULL - * @progress_user_data: (closure): data to pass to the @progress_callback function - * @error: a #GError, or %NULL - * - * Queries the service to return a list of groups matching the given @query. - * - * For more details, see gdata_service_query(). - * - * Return value: (transfer full): a #GDataFeed of query results; unref with g_object_unref() - * - * Since: 0.7.0 - * Deprecated: 0.18.2: The Google Contacts service is deprecated. Use Google’s CardDAV interface instead. - */ -GDataFeed * -gdata_contacts_service_query_groups (GDataContactsService *self, GDataQuery *query, GCancellable *cancellable, - GDataQueryProgressCallback progress_callback, gpointer progress_user_data, GError **error) -{ - GDataFeed *feed; - gchar *request_uri; - - g_return_val_if_fail (GDATA_IS_CONTACTS_SERVICE (self), NULL); - g_return_val_if_fail (query == NULL || GDATA_IS_QUERY (query), NULL); - g_return_val_if_fail (cancellable == NULL || G_IS_CANCELLABLE (cancellable), NULL); - g_return_val_if_fail (error == NULL || *error == NULL, NULL); - - /* Ensure we're authenticated first */ - if (gdata_authorizer_is_authorized_for_domain (gdata_service_get_authorizer (GDATA_SERVICE (self)), - get_contacts_authorization_domain ()) == FALSE) { - g_set_error_literal (error, GDATA_SERVICE_ERROR, GDATA_SERVICE_ERROR_AUTHENTICATION_REQUIRED, - _("You must be authenticated to query contact groups.")); - return NULL; - } - - request_uri = g_strconcat (_gdata_service_get_scheme (), "://www.google.com/m8/feeds/groups/default/full", NULL); - feed = gdata_service_query (GDATA_SERVICE (self), get_contacts_authorization_domain (), request_uri, GDATA_QUERY (query), - GDATA_TYPE_CONTACTS_GROUP, cancellable, progress_callback, progress_user_data, error); - g_free (request_uri); - - return feed; -} - -/** - * gdata_contacts_service_query_groups_async: - * @self: a #GDataContactsService - * @query: (allow-none): a #GDataQuery with the query parameters, or %NULL - * @cancellable: (allow-none): optional #GCancellable object, or %NULL - * @progress_callback: (allow-none) (closure progress_user_data): a #GDataQueryProgressCallback to call when an entry is loaded, or %NULL - * @progress_user_data: (closure): data to pass to the @progress_callback function - * @destroy_progress_user_data: (allow-none): the function to call when @progress_callback will not be called any more, or %NULL. This function will be - * called with @progress_user_data as a parameter and can be used to free any memory allocated for it. - * @callback: a #GAsyncReadyCallback to call when the query is finished - * @user_data: (closure): data to pass to the @callback function - * - * Queries the service to return a list of groups matching the given @query. @self and @query are all reffed when this function is called, so can - * safely be unreffed after this function returns. - * - * For more details, see gdata_contacts_service_query_groups(), which is the synchronous version of this function, and gdata_service_query_async(), - * which is the base asynchronous query function. - * - * Since: 0.9.1 - * Deprecated: 0.18.2: The Google Contacts service is deprecated. Use Google’s CardDAV interface instead. - */ -void -gdata_contacts_service_query_groups_async (GDataContactsService *self, GDataQuery *query, GCancellable *cancellable, - GDataQueryProgressCallback progress_callback, gpointer progress_user_data, - GDestroyNotify destroy_progress_user_data, - GAsyncReadyCallback callback, gpointer user_data) -{ - gchar *request_uri; - - g_return_if_fail (GDATA_IS_CONTACTS_SERVICE (self)); - g_return_if_fail (query == NULL || GDATA_IS_QUERY (query)); - g_return_if_fail (cancellable == NULL || G_IS_CANCELLABLE (cancellable)); - g_return_if_fail (callback != NULL); - - /* Ensure we're authenticated first */ - if (gdata_authorizer_is_authorized_for_domain (gdata_service_get_authorizer (GDATA_SERVICE (self)), - get_contacts_authorization_domain ()) == FALSE) { - g_autoptr(GTask) task = NULL; - - task = g_task_new (self, cancellable, callback, user_data); - g_task_set_source_tag (task, gdata_service_query_async); - g_task_return_new_error (task, GDATA_SERVICE_ERROR, GDATA_SERVICE_ERROR_AUTHENTICATION_REQUIRED, "%s", - _("You must be authenticated to query contact groups.")); - - return; - } - - request_uri = g_strconcat (_gdata_service_get_scheme (), "://www.google.com/m8/feeds/groups/default/full", NULL); - gdata_service_query_async (GDATA_SERVICE (self), get_contacts_authorization_domain (), request_uri, GDATA_QUERY (query), - GDATA_TYPE_CONTACTS_GROUP, cancellable, progress_callback, progress_user_data, - destroy_progress_user_data, callback, user_data); - g_free (request_uri); -} - -/** - * gdata_contacts_service_insert_group: - * @self: a #GDataContactsService - * @group: a #GDataContactsGroup to create on the server - * @cancellable: (allow-none): optional #GCancellable object, or %NULL - * @error: a #GError, or %NULL - * - * Inserts a new contact group described by @group. The user must be authenticated to use this function. - * - * Return value: (transfer full): the inserted #GDataContactsGroup; unref with g_object_unref() - * - * Since: 0.7.0 - * Deprecated: 0.18.2: The Google Contacts service is deprecated. Use Google’s CardDAV interface instead. - */ -GDataContactsGroup * -gdata_contacts_service_insert_group (GDataContactsService *self, GDataContactsGroup *group, GCancellable *cancellable, GError **error) -{ - gchar *request_uri; - GDataEntry *new_group; - - g_return_val_if_fail (GDATA_IS_CONTACTS_SERVICE (self), NULL); - g_return_val_if_fail (GDATA_IS_CONTACTS_GROUP (group), NULL); - g_return_val_if_fail (cancellable == NULL || G_IS_CANCELLABLE (cancellable), NULL); - g_return_val_if_fail (error == NULL || *error == NULL, NULL); - - if (gdata_entry_is_inserted (GDATA_ENTRY (group)) == TRUE) { - g_set_error_literal (error, GDATA_SERVICE_ERROR, GDATA_SERVICE_ERROR_ENTRY_ALREADY_INSERTED, - _("The group has already been inserted.")); - return NULL; - } - - if (gdata_authorizer_is_authorized_for_domain (gdata_service_get_authorizer (GDATA_SERVICE (self)), - get_contacts_authorization_domain ()) == FALSE) { - g_set_error_literal (error, GDATA_SERVICE_ERROR, GDATA_SERVICE_ERROR_AUTHENTICATION_REQUIRED, - _("You must be authenticated to insert a group.")); - return NULL; - } - - request_uri = g_strconcat (_gdata_service_get_scheme (), "://www.google.com/m8/feeds/groups/default/full", NULL); - new_group = gdata_service_insert_entry (GDATA_SERVICE (self), get_contacts_authorization_domain (), request_uri, GDATA_ENTRY (group), - cancellable, error); - g_free (request_uri); - - return GDATA_CONTACTS_GROUP (new_group); -} - -/** - * gdata_contacts_service_insert_group_async: - * @self: a #GDataContactsService - * @group: the #GDataContactsGroup to insert - * @cancellable: (allow-none): optional #GCancellable object, or %NULL - * @callback: a #GAsyncReadyCallback to call when insertion is finished - * @user_data: (closure): data to pass to the @callback function - * - * Inserts a new contact group described by @group. The user must be authenticated to use this function. @self and @group are both reffed when this - * function is called, so can safely be unreffed after this function returns. - * - * @callback should call gdata_service_insert_entry_finish() to obtain a #GDataContactsGroup representing the inserted group and to check for possible - * errors. - * - * For more details, see gdata_contacts_service_insert_group(), which is the synchronous version of this function, and - * gdata_service_insert_entry_async(), which is the base asynchronous insertion function. - * - * Since: 0.7.0 - * Deprecated: 0.18.2: The Google Contacts service is deprecated. Use Google’s CardDAV interface instead. - */ -void -gdata_contacts_service_insert_group_async (GDataContactsService *self, GDataContactsGroup *group, GCancellable *cancellable, - GAsyncReadyCallback callback, gpointer user_data) -{ - gchar *request_uri; - - g_return_if_fail (GDATA_IS_CONTACTS_SERVICE (self)); - g_return_if_fail (GDATA_IS_CONTACTS_GROUP (group)); - g_return_if_fail (cancellable == NULL || G_IS_CANCELLABLE (cancellable)); - - request_uri = g_strconcat (_gdata_service_get_scheme (), "://www.google.com/m8/feeds/groups/default/full", NULL); - gdata_service_insert_entry_async (GDATA_SERVICE (self), get_contacts_authorization_domain (), request_uri, GDATA_ENTRY (group), cancellable, - callback, user_data); - g_free (request_uri); -} - -G_GNUC_END_IGNORE_DEPRECATIONS diff --git a/gdata/services/contacts/gdata-contacts-service.h b/gdata/services/contacts/gdata-contacts-service.h deleted file mode 100644 index 33895d9f..00000000 --- a/gdata/services/contacts/gdata-contacts-service.h +++ /dev/null @@ -1,121 +0,0 @@ -/* -*- Mode: C; indent-tabs-mode: t; c-basic-offset: 8; tab-width: 8 -*- */ -/* - * GData Client - * Copyright (C) Philip Withnall 2009–2010 - * - * GData Client is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2.1 of the License, or (at your option) any later version. - * - * GData Client is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with GData Client. If not, see . - */ - -#ifndef GDATA_CONTACTS_SERVICE_H -#define GDATA_CONTACTS_SERVICE_H - -#include -#include - -#include -#include - -G_BEGIN_DECLS - -#define GDATA_TYPE_CONTACTS_SERVICE (gdata_contacts_service_get_type ()) -#define GDATA_CONTACTS_SERVICE(o) (G_TYPE_CHECK_INSTANCE_CAST ((o), GDATA_TYPE_CONTACTS_SERVICE, GDataContactsService)) -#define GDATA_CONTACTS_SERVICE_CLASS(k) (G_TYPE_CHECK_CLASS_CAST((k), GDATA_TYPE_CONTACTS_SERVICE, GDataContactsServiceClass)) -#define GDATA_IS_CONTACTS_SERVICE(o) (G_TYPE_CHECK_INSTANCE_TYPE ((o), GDATA_TYPE_CONTACTS_SERVICE)) -#define GDATA_IS_CONTACTS_SERVICE_CLASS(k) (G_TYPE_CHECK_CLASS_TYPE ((k), GDATA_TYPE_CONTACTS_SERVICE)) -#define GDATA_CONTACTS_SERVICE_GET_CLASS(o) (G_TYPE_INSTANCE_GET_CLASS ((o), GDATA_TYPE_CONTACTS_SERVICE, GDataContactsServiceClass)) - -typedef struct _GDataContactsServicePrivate GDataContactsServicePrivate; - -/** - * GDataContactsService: - * - * All the fields in the #GDataContactsService structure are private and should never be accessed directly. - * - * Since: 0.2.0 - */ -typedef struct { - GDataService parent; -} GDataContactsService; - -/** - * GDataContactsServiceClass: - * - * All the fields in the #GDataContactsServiceClass structure are private and should never be accessed directly. - * - * Since: 0.2.0 - */ -typedef struct { - /*< private >*/ - GDataServiceClass parent; - - /*< private >*/ - /* Padding for future expansion */ - void (*_g_reserved0) (void); - void (*_g_reserved1) (void); - void (*_g_reserved2) (void); - void (*_g_reserved3) (void); - void (*_g_reserved4) (void); - void (*_g_reserved5) (void); -} GDataContactsServiceClass; - -G_DEPRECATED -GType gdata_contacts_service_get_type (void) G_GNUC_CONST; - -G_DEPRECATED -GDataContactsService *gdata_contacts_service_new (GDataAuthorizer *authorizer) G_GNUC_WARN_UNUSED_RESULT G_GNUC_MALLOC; - -G_DEPRECATED -GDataAuthorizationDomain *gdata_contacts_service_get_primary_authorization_domain (void) G_GNUC_CONST; - -G_DEPRECATED -GDataFeed *gdata_contacts_service_query_contacts (GDataContactsService *self, GDataQuery *query, GCancellable *cancellable, - GDataQueryProgressCallback progress_callback, gpointer progress_user_data, - GError **error) G_GNUC_WARN_UNUSED_RESULT G_GNUC_MALLOC; -G_DEPRECATED -void gdata_contacts_service_query_contacts_async (GDataContactsService *self, GDataQuery *query, GCancellable *cancellable, - GDataQueryProgressCallback progress_callback, gpointer progress_user_data, - GDestroyNotify destroy_progress_user_data, - GAsyncReadyCallback callback, gpointer user_data); - -#include - -G_DEPRECATED -GDataContactsContact *gdata_contacts_service_insert_contact (GDataContactsService *self, GDataContactsContact *contact, - GCancellable *cancellable, GError **error) G_GNUC_WARN_UNUSED_RESULT G_GNUC_MALLOC; -G_DEPRECATED -void gdata_contacts_service_insert_contact_async (GDataContactsService *self, GDataContactsContact *contact, GCancellable *cancellable, - GAsyncReadyCallback callback, gpointer user_data); - -#include - -G_DEPRECATED -GDataFeed *gdata_contacts_service_query_groups (GDataContactsService *self, GDataQuery *query, GCancellable *cancellable, - GDataQueryProgressCallback progress_callback, gpointer progress_user_data, - GError **error) G_GNUC_WARN_UNUSED_RESULT G_GNUC_MALLOC; -G_DEPRECATED -void gdata_contacts_service_query_groups_async (GDataContactsService *self, GDataQuery *query, GCancellable *cancellable, - GDataQueryProgressCallback progress_callback, gpointer progress_user_data, - GDestroyNotify destroy_progress_user_data, - GAsyncReadyCallback callback, gpointer user_data); - -G_DEPRECATED -GDataContactsGroup *gdata_contacts_service_insert_group (GDataContactsService *self, GDataContactsGroup *group, - GCancellable *cancellable, GError **error) G_GNUC_WARN_UNUSED_RESULT G_GNUC_MALLOC; -G_DEPRECATED -void gdata_contacts_service_insert_group_async (GDataContactsService *self, GDataContactsGroup *group, GCancellable *cancellable, - GAsyncReadyCallback callback, gpointer user_data); - -G_END_DECLS - -#endif /* !GDATA_CONTACTS_SERVICE_H */ diff --git a/gdata/services/contacts/meson.build b/gdata/services/contacts/meson.build deleted file mode 100644 index 1627a7e4..00000000 --- a/gdata/services/contacts/meson.build +++ /dev/null @@ -1,20 +0,0 @@ -headers = files( - 'gdata-contacts-contact.h', - 'gdata-contacts-group.h', - 'gdata-contacts-query.h', - 'gdata-contacts-service.h', -) - -install_headers( - headers, - subdir: gdata_include_subdir / 'services/contacts', -) - -gir_headers += headers - -sources += files( - 'gdata-contacts-contact.c', - 'gdata-contacts-group.c', - 'gdata-contacts-query.c', - 'gdata-contacts-service.c', -) diff --git a/gdata/services/meson.build b/gdata/services/meson.build index f9879c71..19c981c0 100644 --- a/gdata/services/meson.build +++ b/gdata/services/meson.build @@ -1,5 +1,4 @@ subdir('calendar') -subdir('contacts') subdir('documents') subdir('freebase') subdir('picasaweb') diff --git a/gdata/symbol.map b/gdata/symbol.map index e2b970a4..035cde78 100644 --- a/gdata/symbol.map +++ b/gdata/symbol.map @@ -162,133 +162,6 @@ global: gdata_commentable_query_comments_finish; gdata_comparable_compare; gdata_comparable_get_type; - gdata_contacts_contact_add_calendar; - gdata_contacts_contact_add_email_address; - gdata_contacts_contact_add_event; - gdata_contacts_contact_add_external_id; - gdata_contacts_contact_add_group; - gdata_contacts_contact_add_hobby; - gdata_contacts_contact_add_im_address; - gdata_contacts_contact_add_jot; - gdata_contacts_contact_add_language; - gdata_contacts_contact_add_organization; - gdata_contacts_contact_add_phone_number; - gdata_contacts_contact_add_postal_address; - gdata_contacts_contact_add_relation; - gdata_contacts_contact_add_website; - gdata_contacts_contact_get_billing_information; - gdata_contacts_contact_get_birthday; - gdata_contacts_contact_get_calendars; - gdata_contacts_contact_get_directory_server; - gdata_contacts_contact_get_edited; - gdata_contacts_contact_get_email_addresses; - gdata_contacts_contact_get_events; - gdata_contacts_contact_get_extended_properties; - gdata_contacts_contact_get_extended_property; - gdata_contacts_contact_get_external_ids; - gdata_contacts_contact_get_file_as; - gdata_contacts_contact_get_gender; - gdata_contacts_contact_get_groups; - gdata_contacts_contact_get_hobbies; - gdata_contacts_contact_get_im_addresses; - gdata_contacts_contact_get_initials; - gdata_contacts_contact_get_jots; - gdata_contacts_contact_get_languages; - gdata_contacts_contact_get_maiden_name; - gdata_contacts_contact_get_mileage; - gdata_contacts_contact_get_name; - gdata_contacts_contact_get_nickname; - gdata_contacts_contact_get_occupation; - gdata_contacts_contact_get_organizations; - gdata_contacts_contact_get_phone_numbers; - gdata_contacts_contact_get_photo; - gdata_contacts_contact_get_photo_async; - gdata_contacts_contact_get_photo_etag; - gdata_contacts_contact_get_photo_finish; - gdata_contacts_contact_get_postal_addresses; - gdata_contacts_contact_get_primary_calendar; - gdata_contacts_contact_get_primary_email_address; - gdata_contacts_contact_get_primary_im_address; - gdata_contacts_contact_get_primary_organization; - gdata_contacts_contact_get_primary_phone_number; - gdata_contacts_contact_get_primary_postal_address; - gdata_contacts_contact_get_primary_website; - gdata_contacts_contact_get_priority; - gdata_contacts_contact_get_relations; - gdata_contacts_contact_get_sensitivity; - gdata_contacts_contact_get_short_name; - gdata_contacts_contact_get_subject; - gdata_contacts_contact_get_type; - gdata_contacts_contact_get_user_defined_field; - gdata_contacts_contact_get_user_defined_fields; - gdata_contacts_contact_get_websites; - gdata_contacts_contact_is_deleted; - gdata_contacts_contact_is_group_deleted; - gdata_contacts_contact_new; - gdata_contacts_contact_remove_all_calendars; - gdata_contacts_contact_remove_all_email_addresses; - gdata_contacts_contact_remove_all_events; - gdata_contacts_contact_remove_all_external_ids; - gdata_contacts_contact_remove_all_hobbies; - gdata_contacts_contact_remove_all_im_addresses; - gdata_contacts_contact_remove_all_jots; - gdata_contacts_contact_remove_all_languages; - gdata_contacts_contact_remove_all_organizations; - gdata_contacts_contact_remove_all_phone_numbers; - gdata_contacts_contact_remove_all_postal_addresses; - gdata_contacts_contact_remove_all_relations; - gdata_contacts_contact_remove_all_websites; - gdata_contacts_contact_remove_group; - gdata_contacts_contact_set_billing_information; - gdata_contacts_contact_set_birthday; - gdata_contacts_contact_set_directory_server; - gdata_contacts_contact_set_extended_property; - gdata_contacts_contact_set_file_as; - gdata_contacts_contact_set_gender; - gdata_contacts_contact_set_initials; - gdata_contacts_contact_set_maiden_name; - gdata_contacts_contact_set_mileage; - gdata_contacts_contact_set_name; - gdata_contacts_contact_set_nickname; - gdata_contacts_contact_set_occupation; - gdata_contacts_contact_set_photo; - gdata_contacts_contact_set_photo_async; - gdata_contacts_contact_set_photo_finish; - gdata_contacts_contact_set_priority; - gdata_contacts_contact_set_sensitivity; - gdata_contacts_contact_set_short_name; - gdata_contacts_contact_set_subject; - gdata_contacts_contact_set_user_defined_field; - gdata_contacts_group_get_edited; - gdata_contacts_group_get_extended_properties; - gdata_contacts_group_get_extended_property; - gdata_contacts_group_get_system_group_id; - gdata_contacts_group_get_type; - gdata_contacts_group_is_deleted; - gdata_contacts_group_new; - gdata_contacts_group_set_extended_property; - gdata_contacts_query_get_group; - gdata_contacts_query_get_order_by; - gdata_contacts_query_get_sort_order; - gdata_contacts_query_get_type; - gdata_contacts_query_new; - gdata_contacts_query_new_with_limits; - gdata_contacts_query_set_group; - gdata_contacts_query_set_order_by; - gdata_contacts_query_set_show_deleted; - gdata_contacts_query_set_sort_order; - gdata_contacts_query_show_deleted; - gdata_contacts_service_get_primary_authorization_domain; - gdata_contacts_service_get_type; - gdata_contacts_service_insert_contact; - gdata_contacts_service_insert_contact_async; - gdata_contacts_service_insert_group; - gdata_contacts_service_insert_group_async; - gdata_contacts_service_new; - gdata_contacts_service_query_contacts; - gdata_contacts_service_query_contacts_async; - gdata_contacts_service_query_groups; - gdata_contacts_service_query_groups_async; gdata_documents_access_rule_get_type; gdata_documents_access_rule_new; gdata_documents_document_download; diff --git a/gdata/tests/contacts.c b/gdata/tests/contacts.c deleted file mode 100644 index 59698898..00000000 --- a/gdata/tests/contacts.c +++ /dev/null @@ -1,2705 +0,0 @@ -/* -*- Mode: C; indent-tabs-mode: t; c-basic-offset: 8; tab-width: 8 -*- */ -/* - * GData Client - * Copyright (C) Philip Withnall 2009, 2010, 2011, 2014 - * - * GData Client is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2.1 of the License, or (at your option) any later version. - * - * GData Client is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with GData Client. If not, see . - */ - -#include -#include -#include - -#include "gdata.h" -#include "common.h" -#include "gdata-dummy-authorizer.h" - -G_GNUC_BEGIN_IGNORE_DEPRECATIONS - -static UhmServer *mock_server = NULL; - -#undef CLIENT_ID /* from common.h */ - -#define CLIENT_ID "352818697630-nqu2cmt5quqd6lr17ouoqmb684u84l1f.apps.googleusercontent.com" -#define CLIENT_SECRET "-fA4pHQJxR3zJ-FyAMPQsikg" -#define REDIRECT_URI "urn:ietf:wg:oauth:2.0:oob" - -typedef struct { - GDataContactsContact *contact; -} TempContactData; - -static void -set_up_temp_contact (TempContactData *data, gconstpointer service) -{ - GDataContactsContact *contact; - - gdata_test_mock_server_start_trace (mock_server, "setup-temp-contact"); - - /* Create a new temporary contact to use for a single test */ - contact = gdata_contacts_contact_new (NULL); - gdata_contacts_contact_set_nickname (contact, "Test Contact Esq."); - - /* Insert the contact */ - data->contact = gdata_contacts_service_insert_contact (GDATA_CONTACTS_SERVICE (service), contact, NULL, NULL); - g_assert (GDATA_IS_CONTACTS_CONTACT (data->contact)); - gdata_test_compare_kind (GDATA_ENTRY (data->contact), "http://schemas.google.com/contact/2008#contact", NULL); - - g_object_unref (contact); - - uhm_server_end_trace (mock_server); - - /* HACK. Wait for the server to propagate distributed changes. */ - if (uhm_server_get_enable_online (mock_server) == TRUE) { - sleep (10); - } -} - -static void -tear_down_temp_contact (TempContactData *data, gconstpointer service) -{ - GDataEntry *updated_contact; - - gdata_test_mock_server_start_trace (mock_server, "teardown-temp-contact"); - - /* Re-query for the contact to get any updated ETags */ - updated_contact = gdata_service_query_single_entry (GDATA_SERVICE (service), gdata_contacts_service_get_primary_authorization_domain (), - gdata_entry_get_id (GDATA_ENTRY (data->contact)), NULL, GDATA_TYPE_CONTACTS_CONTACT, - NULL, NULL); - g_assert (GDATA_IS_CONTACTS_CONTACT (updated_contact)); - - g_object_unref (data->contact); - - /* Delete the new/updated contact */ - g_assert (gdata_service_delete_entry (GDATA_SERVICE (service), gdata_contacts_service_get_primary_authorization_domain (), - updated_contact, NULL, NULL) == TRUE); - - g_object_unref (updated_contact); - - uhm_server_end_trace (mock_server); -} - -GDATA_ASYNC_CLOSURE_FUNCTIONS (temp_contact, TempContactData); - -static void -test_authentication (void) -{ - GDataOAuth2Authorizer *authorizer = NULL; /* owned */ - gchar *authentication_uri, *authorisation_code; - - gdata_test_mock_server_start_trace (mock_server, "authentication"); - - authorizer = gdata_oauth2_authorizer_new (CLIENT_ID, CLIENT_SECRET, - REDIRECT_URI, - GDATA_TYPE_CONTACTS_SERVICE); - - /* Get an authentication URI. */ - authentication_uri = gdata_oauth2_authorizer_build_authentication_uri (authorizer, NULL, FALSE); - g_assert (authentication_uri != NULL); - - /* Get the authorisation code off the user. */ - if (uhm_server_get_enable_online (mock_server)) { - authorisation_code = gdata_test_query_user_for_verifier (authentication_uri); - } else { - /* Hard coded, extracted from the trace file. */ - authorisation_code = g_strdup ("4/OEX-S1iMbOA_dOnNgUlSYmGWh3TK.QrR73axcNMkWoiIBeO6P2m_su7cwkQI"); - } - - g_free (authentication_uri); - - if (authorisation_code == NULL) { - /* Skip tests. */ - goto skip_test; - } - - /* Authorise the token */ - g_assert (gdata_oauth2_authorizer_request_authorization (authorizer, authorisation_code, NULL, NULL) == TRUE); - - /* Check all is as it should be */ - g_assert (gdata_authorizer_is_authorized_for_domain (GDATA_AUTHORIZER (authorizer), - gdata_contacts_service_get_primary_authorization_domain ()) == TRUE); - -skip_test: - g_free (authorisation_code); - g_object_unref (authorizer); - - uhm_server_end_trace (mock_server); -} - -typedef struct { - GDataContactsContact *contact1; - GDataContactsContact *contact2; - GDataContactsContact *contact3; -} QueryAllContactsData; - -static void -set_up_query_all_contacts (QueryAllContactsData *data, gconstpointer service) -{ - GDataContactsContact *contact; - - gdata_test_mock_server_start_trace (mock_server, "setup-query-all-contacts"); - - /* Create new temporary contacts to use for the query all contacts tests */ - contact = gdata_contacts_contact_new (NULL); - gdata_contacts_contact_set_nickname (contact, "Test Contact 1"); - data->contact1 = gdata_contacts_service_insert_contact (GDATA_CONTACTS_SERVICE (service), contact, NULL, NULL); - g_object_unref (contact); - - contact = gdata_contacts_contact_new (NULL); - gdata_contacts_contact_set_nickname (contact, "Test Contact 2"); - data->contact2 = gdata_contacts_service_insert_contact (GDATA_CONTACTS_SERVICE (service), contact, NULL, NULL); - g_object_unref (contact); - - contact = gdata_contacts_contact_new (NULL); - gdata_contacts_contact_set_nickname (contact, "Test Contact 3"); - data->contact3 = gdata_contacts_service_insert_contact (GDATA_CONTACTS_SERVICE (service), contact, NULL, NULL); - g_object_unref (contact); - - uhm_server_end_trace (mock_server); - - /* It takes a few seconds for the contacts to reliably propagate around Google's servers. Distributed systems are so fun. Not. - * Thankfully, we don't have to wait when running against the mock server. */ - if (uhm_server_get_enable_online (mock_server) == TRUE) { - g_usleep (G_USEC_PER_SEC * 5); - } -} - -static void -tear_down_query_all_contacts (QueryAllContactsData *data, gconstpointer service) -{ - gdata_test_mock_server_start_trace (mock_server, "teardown-query-all-contacts"); - - /* Delete the new contacts */ - g_assert (gdata_service_delete_entry (GDATA_SERVICE (service), gdata_contacts_service_get_primary_authorization_domain (), - GDATA_ENTRY (data->contact1), NULL, NULL) == TRUE); - g_object_unref (data->contact1); - - g_assert (gdata_service_delete_entry (GDATA_SERVICE (service), gdata_contacts_service_get_primary_authorization_domain (), - GDATA_ENTRY (data->contact2), NULL, NULL) == TRUE); - g_object_unref (data->contact2); - - g_assert (gdata_service_delete_entry (GDATA_SERVICE (service), gdata_contacts_service_get_primary_authorization_domain (), - GDATA_ENTRY (data->contact3), NULL, NULL) == TRUE); - g_object_unref (data->contact3); - - uhm_server_end_trace (mock_server); -} - -static void -test_query_all_contacts (QueryAllContactsData *data, gconstpointer service) -{ - GDataFeed *feed; - GError *error = NULL; - - gdata_test_mock_server_start_trace (mock_server, "query-all-contacts"); - - feed = gdata_contacts_service_query_contacts (GDATA_CONTACTS_SERVICE (service), NULL, NULL, NULL, NULL, &error); - g_assert_no_error (error); - g_assert (GDATA_IS_FEED (feed)); - g_clear_error (&error); - - /* TODO: check entries, kinds and feed properties */ - - g_object_unref (feed); - - uhm_server_end_trace (mock_server); -} - -GDATA_ASYNC_CLOSURE_FUNCTIONS (query_all_contacts, QueryAllContactsData); - -GDATA_ASYNC_TEST_FUNCTIONS (query_all_contacts, QueryAllContactsData, -G_STMT_START { - gdata_contacts_service_query_contacts_async (GDATA_CONTACTS_SERVICE (service), NULL, cancellable, NULL, - NULL, NULL, async_ready_callback, async_data); -} G_STMT_END, -G_STMT_START { - GDataFeed *feed; - - feed = gdata_service_query_finish (GDATA_SERVICE (obj), async_result, &error); - - if (error == NULL) { - g_assert (GDATA_IS_FEED (feed)); - /* TODO: Tests? */ - - g_object_unref (feed); - } else { - g_assert (feed == NULL); - } -} G_STMT_END); - -static void -test_query_all_contacts_async_progress_closure (QueryAllContactsData *query_data, gconstpointer service) -{ - GDataAsyncProgressClosure *data = g_slice_new0 (GDataAsyncProgressClosure); - - gdata_test_mock_server_start_trace (mock_server, "query-all-contacts-async-progress-closure"); - - data->main_loop = g_main_loop_new (NULL, TRUE); - - gdata_contacts_service_query_contacts_async (GDATA_CONTACTS_SERVICE (service), NULL, NULL, - (GDataQueryProgressCallback) gdata_test_async_progress_callback, - data, (GDestroyNotify) gdata_test_async_progress_closure_free, - (GAsyncReadyCallback) gdata_test_async_progress_finish_callback, data); - g_main_loop_run (data->main_loop); - g_main_loop_unref (data->main_loop); - - /* Check that both callbacks were called exactly once */ - g_assert_cmpuint (data->progress_destroy_notify_count, ==, 1); - g_assert_cmpuint (data->async_ready_notify_count, ==, 1); - - g_slice_free (GDataAsyncProgressClosure, data); - - uhm_server_end_trace (mock_server); -} - -typedef struct { - GDataContactsContact *new_contact; -} InsertData; - -static void -set_up_insert (InsertData *data, gconstpointer service) -{ - data->new_contact = NULL; -} - -static void -tear_down_insert (InsertData *data, gconstpointer service) -{ - gdata_test_mock_server_start_trace (mock_server, "teardown-insert"); - - /* Delete the new contact */ - g_assert (gdata_service_delete_entry (GDATA_SERVICE (service), gdata_contacts_service_get_primary_authorization_domain (), - GDATA_ENTRY (data->new_contact), NULL, NULL) == TRUE); - - g_object_unref (data->new_contact); - - uhm_server_end_trace (mock_server); -} - -static void -test_contact_insert (InsertData *data, gconstpointer service) -{ - GDataContactsContact *contact, *new_contact; - GDataGDName *name, *name2; - GDataGDEmailAddress *email_address1, *email_address2; - GDataGDPhoneNumber *phone_number1, *phone_number2; - GDataGDIMAddress *im_address; - GDataGDOrganization *org; - GDataGDPostalAddress *postal_address; - GDataGContactJot *jot; - GDataGContactRelation *relation; - GDataGContactWebsite *website; - GDataGContactEvent *event; - GDataGContactCalendar *calendar; - GDataGContactExternalID *external_id; - GDataGContactLanguage *language; - GList *list; - GDate date; - GHashTable *properties; - gint64 edited, creation_time; - GError *error = NULL; - - gdata_test_mock_server_start_trace (mock_server, "contact-insert"); - - contact = gdata_contacts_contact_new (NULL); - - /* Check the kind is present and correct */ - g_assert (GDATA_IS_CONTACTS_CONTACT (contact)); - gdata_test_compare_kind (GDATA_ENTRY (contact), "http://schemas.google.com/contact/2008#contact", NULL); - - /* Set and check the name (to check if the title of the entry is updated) */ - gdata_entry_set_title (GDATA_ENTRY (contact), "Elizabeth Bennet"); - name = gdata_contacts_contact_get_name (contact); - gdata_gd_name_set_full_name (name, "Lizzie Bennet"); - - name2 = gdata_gd_name_new ("John", "Smith"); - gdata_gd_name_set_full_name (name2, "John Smith"); - gdata_contacts_contact_set_name (contact, name2); - g_object_unref (name2); - - gdata_contacts_contact_set_nickname (contact, "Big J"); - gdata_contacts_contact_set_file_as (contact, "J, Big"); - g_date_set_dmy (&date, 1, 1, 1900); - gdata_contacts_contact_set_birthday (contact, &date, FALSE); - gdata_entry_set_content (GDATA_ENTRY (contact), "Notes"); - gdata_contacts_contact_set_billing_information (contact, "Big J Enterprises, Ltd."); - gdata_contacts_contact_set_directory_server (contact, "This is a server"); - gdata_contacts_contact_set_gender (contact, GDATA_CONTACTS_GENDER_MALE); - gdata_contacts_contact_set_initials (contact, "A. B. C."); - gdata_contacts_contact_set_maiden_name (contact, "Smith"); - gdata_contacts_contact_set_mileage (contact, "12km"); - gdata_contacts_contact_set_occupation (contact, "Professional bum"); - gdata_contacts_contact_set_priority (contact, GDATA_CONTACTS_PRIORITY_HIGH); - gdata_contacts_contact_set_sensitivity (contact, GDATA_CONTACTS_SENSITIVITY_PERSONAL); - gdata_contacts_contact_set_short_name (contact, "Jon"); - gdata_contacts_contact_set_subject (contact, "Charity work"); - - email_address1 = gdata_gd_email_address_new ("liz@gmail.com", GDATA_GD_EMAIL_ADDRESS_WORK, NULL, FALSE); - gdata_contacts_contact_add_email_address (contact, email_address1); - g_object_unref (email_address1); - - email_address2 = gdata_gd_email_address_new ("liz@example.org", GDATA_GD_EMAIL_ADDRESS_HOME, NULL, FALSE); - gdata_contacts_contact_add_email_address (contact, email_address2); - g_object_unref (email_address2); - - phone_number1 = gdata_gd_phone_number_new ("(206)555-1212", GDATA_GD_PHONE_NUMBER_WORK, NULL, NULL, TRUE); - gdata_contacts_contact_add_phone_number (contact, phone_number1); - g_object_unref (phone_number1); - - phone_number2 = gdata_gd_phone_number_new ("(206)555-1213", GDATA_GD_PHONE_NUMBER_HOME, NULL, NULL, FALSE); - gdata_contacts_contact_add_phone_number (contact, phone_number2); - g_object_unref (phone_number2); - - im_address = gdata_gd_im_address_new ("liz@gmail.com", GDATA_GD_IM_PROTOCOL_GOOGLE_TALK, GDATA_GD_IM_ADDRESS_HOME, NULL, FALSE); - gdata_contacts_contact_add_im_address (contact, im_address); - g_object_unref (im_address); - - postal_address = gdata_gd_postal_address_new (GDATA_GD_POSTAL_ADDRESS_WORK, NULL, TRUE); - gdata_gd_postal_address_set_street (postal_address, "1600 Amphitheatre Pkwy Mountain View"); - gdata_contacts_contact_add_postal_address (contact, postal_address); - g_object_unref (postal_address); - - org = gdata_gd_organization_new ("OrgCorp", "President", GDATA_GD_ORGANIZATION_WORK, NULL, FALSE); - gdata_contacts_contact_add_organization (contact, org); - g_object_unref (org); - - jot = gdata_gcontact_jot_new ("This is a jot.", GDATA_GCONTACT_JOT_OTHER); - gdata_contacts_contact_add_jot (contact, jot); - g_object_unref (jot); - - relation = gdata_gcontact_relation_new ("Brian Haddock", GDATA_GCONTACT_RELATION_FRIEND, NULL); - gdata_contacts_contact_add_relation (contact, relation); - g_object_unref (relation); - - website = gdata_gcontact_website_new ("http://example.com/", GDATA_GCONTACT_WEBSITE_PROFILE, NULL, TRUE); - gdata_contacts_contact_add_website (contact, website); - g_object_unref (website); - - event = gdata_gcontact_event_new (&date, GDATA_GCONTACT_EVENT_ANNIVERSARY, NULL); - gdata_contacts_contact_add_event (contact, event); - g_object_unref (event); - - calendar = gdata_gcontact_calendar_new ("http://calendar.example.com/", GDATA_GCONTACT_CALENDAR_HOME, NULL, TRUE); - gdata_contacts_contact_add_calendar (contact, calendar); - g_object_unref (calendar); - - external_id = gdata_gcontact_external_id_new ("Number Six", GDATA_GCONTACT_EXTERNAL_ID_ORGANIZATION, NULL); - gdata_contacts_contact_add_external_id (contact, external_id); - g_object_unref (external_id); - - gdata_contacts_contact_add_hobby (contact, "Rowing"); - - language = gdata_gcontact_language_new ("en-GB", NULL); - gdata_contacts_contact_add_language (contact, language); - g_object_unref (language); - - /* Add some extended properties */ - g_assert (gdata_contacts_contact_set_extended_property (contact, "TITLE", NULL) == TRUE); - g_assert (gdata_contacts_contact_set_extended_property (contact, "ROLE", "") == TRUE); - g_assert (gdata_contacts_contact_set_extended_property (contact, "CALURI", "http://example.com/") == TRUE); - - /* Add some user-defined fields */ - gdata_contacts_contact_set_user_defined_field (contact, "Favourite colour", "Blue"); - gdata_contacts_contact_set_user_defined_field (contact, "Owes me", "£10"); - gdata_contacts_contact_set_user_defined_field (contact, "My notes", ""); - gdata_contacts_contact_set_user_defined_field (contact, "", "Foo"); /* bgo#648058 */ - - /* Insert the contact */ - new_contact = data->new_contact = gdata_contacts_service_insert_contact (GDATA_CONTACTS_SERVICE (service), contact, NULL, &error); - g_assert_no_error (error); - g_assert (GDATA_IS_CONTACTS_CONTACT (new_contact)); - gdata_test_compare_kind (GDATA_ENTRY (new_contact), "http://schemas.google.com/contact/2008#contact", NULL); - g_clear_error (&error); - - /* Check its edited date. Yes, we have to allow the edited time to possibly precede the creation time because Google's - * servers can allow this to happen. Somehow. - * This check isn't run when testing against a mock server because the dates in the trace file may be waaaay out of date. */ - edited = gdata_contacts_contact_get_edited (contact); - if (uhm_server_get_enable_online (mock_server) == TRUE) { - creation_time = gdata_contacts_contact_get_edited (new_contact); - g_assert_cmpint (creation_time + TIME_FUZZINESS, >=, edited); - g_assert_cmpint (creation_time - TIME_FUZZINESS, <=, edited); - } - - /* Various properties */ - g_assert_cmpstr (gdata_contacts_contact_get_nickname (new_contact), ==, "Big J"); - g_assert_cmpstr (gdata_contacts_contact_get_file_as (new_contact), ==, "J, Big"); - g_assert (gdata_contacts_contact_get_birthday (new_contact, &date) == FALSE); - g_assert (g_date_valid (&date) == TRUE); - g_assert_cmpuint (g_date_get_month (&date), ==, 1); - g_assert_cmpuint (g_date_get_day (&date), ==, 1); - g_assert_cmpstr (gdata_contacts_contact_get_billing_information (new_contact), ==, "Big J Enterprises, Ltd."); - g_assert_cmpstr (gdata_contacts_contact_get_directory_server (new_contact), ==, "This is a server"); - g_assert_cmpstr (gdata_contacts_contact_get_gender (new_contact), ==, GDATA_CONTACTS_GENDER_MALE); - g_assert_cmpstr (gdata_contacts_contact_get_initials (new_contact), ==, "A. B. C."); - g_assert_cmpstr (gdata_contacts_contact_get_maiden_name (new_contact), ==, "Smith"); - g_assert_cmpstr (gdata_contacts_contact_get_mileage (new_contact), ==, "12km"); - g_assert_cmpstr (gdata_contacts_contact_get_occupation (new_contact), ==, "Professional bum"); - /* FIXME: https://code.google.com/a/google.com/p/apps-api-issues/issues/detail?id=3662 - * g_assert_cmpstr (gdata_contacts_contact_get_priority (new_contact), ==, GDATA_CONTACTS_PRIORITY_HIGH); - * g_assert_cmpstr (gdata_contacts_contact_get_sensitivity (new_contact), ==, GDATA_CONTACTS_SENSITIVITY_PERSONAL); */ - g_assert_cmpstr (gdata_contacts_contact_get_short_name (new_contact), ==, "Jon"); - g_assert_cmpstr (gdata_contacts_contact_get_subject (new_contact), ==, "Charity work"); - - /* E-mail addresses */ - list = gdata_contacts_contact_get_email_addresses (new_contact); - g_assert_cmpuint (g_list_length (list), ==, 2); - g_assert (GDATA_IS_GD_EMAIL_ADDRESS (list->data)); - - g_assert (gdata_contacts_contact_get_primary_email_address (new_contact) == NULL); - - /* IM addresses */ - list = gdata_contacts_contact_get_im_addresses (new_contact); - g_assert_cmpuint (g_list_length (list), ==, 1); - g_assert (GDATA_IS_GD_IM_ADDRESS (list->data)); - - g_assert (gdata_contacts_contact_get_primary_im_address (new_contact) == NULL); - - /* Phone numbers */ - list = gdata_contacts_contact_get_phone_numbers (new_contact); - g_assert_cmpuint (g_list_length (list), ==, 2); - g_assert (GDATA_IS_GD_PHONE_NUMBER (list->data)); - - g_assert (GDATA_IS_GD_PHONE_NUMBER (gdata_contacts_contact_get_primary_phone_number (new_contact))); - - /* Postal addresses */ - list = gdata_contacts_contact_get_postal_addresses (new_contact); - g_assert_cmpuint (g_list_length (list), ==, 1); - g_assert (GDATA_IS_GD_POSTAL_ADDRESS (list->data)); - - g_assert (GDATA_IS_GD_POSTAL_ADDRESS (gdata_contacts_contact_get_primary_postal_address (new_contact))); - - /* Organizations */ - list = gdata_contacts_contact_get_organizations (new_contact); - g_assert_cmpuint (g_list_length (list), ==, 1); - g_assert (GDATA_IS_GD_ORGANIZATION (list->data)); - - g_assert (gdata_contacts_contact_get_primary_organization (new_contact) == NULL); - - /* Jots */ - list = gdata_contacts_contact_get_jots (new_contact); - g_assert_cmpuint (g_list_length (list), ==, 1); - g_assert (GDATA_IS_GCONTACT_JOT (list->data)); - - /* Relations */ - list = gdata_contacts_contact_get_relations (new_contact); - g_assert_cmpuint (g_list_length (list), ==, 1); - g_assert (GDATA_IS_GCONTACT_RELATION (list->data)); - - /* Websites */ - list = gdata_contacts_contact_get_websites (new_contact); - g_assert_cmpuint (g_list_length (list), ==, 1); - g_assert (GDATA_IS_GCONTACT_WEBSITE (list->data)); - - g_assert (GDATA_IS_GCONTACT_WEBSITE (gdata_contacts_contact_get_primary_website (new_contact))); - - /* Events */ - list = gdata_contacts_contact_get_events (new_contact); - g_assert_cmpuint (g_list_length (list), ==, 1); - g_assert (GDATA_IS_GCONTACT_EVENT (list->data)); - - /* Calendars */ - list = gdata_contacts_contact_get_calendars (new_contact); - g_assert_cmpuint (g_list_length (list), ==, 1); - g_assert (GDATA_IS_GCONTACT_CALENDAR (list->data)); - - g_assert (GDATA_IS_GCONTACT_CALENDAR (gdata_contacts_contact_get_primary_calendar (new_contact))); - - /* External IDs */ - list = gdata_contacts_contact_get_external_ids (new_contact); - g_assert_cmpuint (g_list_length (list), ==, 1); - g_assert (GDATA_IS_GCONTACT_EXTERNAL_ID (list->data)); - - /* Languages */ - list = gdata_contacts_contact_get_languages (new_contact); - g_assert_cmpuint (g_list_length (list), ==, 1); - g_assert (GDATA_IS_GCONTACT_LANGUAGE (list->data)); - - /* Hobbies */ - list = gdata_contacts_contact_get_hobbies (new_contact); - g_assert_cmpuint (g_list_length (list), ==, 1); - g_assert_cmpstr (list->data, ==, "Rowing"); - - /* Extended properties */ - g_assert_cmpstr (gdata_contacts_contact_get_extended_property (new_contact, "CALURI"), ==, "http://example.com/"); - g_assert (gdata_contacts_contact_get_extended_property (new_contact, "non-existent") == NULL); - - properties = gdata_contacts_contact_get_extended_properties (new_contact); - g_assert (properties != NULL); - g_assert_cmpuint (g_hash_table_size (properties), ==, 1); - - /* User-defined fields */ - g_assert_cmpstr (gdata_contacts_contact_get_user_defined_field (new_contact, "Favourite colour"), ==, "Blue"); - g_assert_cmpstr (gdata_contacts_contact_get_user_defined_field (new_contact, "Owes me"), ==, "£10"); - g_assert_cmpstr (gdata_contacts_contact_get_user_defined_field (new_contact, "My notes"), ==, ""); - g_assert_cmpstr (gdata_contacts_contact_get_user_defined_field (new_contact, ""), ==, "Foo"); - - properties = gdata_contacts_contact_get_user_defined_fields (new_contact); - g_assert (properties != NULL); - g_assert_cmpuint (g_hash_table_size (properties), ==, 4); - - /* Groups */ - list = gdata_contacts_contact_get_groups (new_contact); - g_assert (list == NULL); - - /* Deleted? */ - g_assert (gdata_contacts_contact_is_deleted (new_contact) == FALSE); - - /* TODO: check entries and feed properties */ - - g_object_unref (contact); - - uhm_server_end_trace (mock_server); -} - -static void -test_contact_update (TempContactData *data, gconstpointer service) -{ - GDataContactsContact *new_contact; - GError *error = NULL; - - gdata_test_mock_server_start_trace (mock_server, "contact-update"); - - /* Update the contact's name and add an extended property */ - gdata_entry_set_title (GDATA_ENTRY (data->contact), "John Wilson"); - g_assert (gdata_contacts_contact_set_extended_property (data->contact, "contact-test", "value")); - - /* Update the contact */ - new_contact = GDATA_CONTACTS_CONTACT (gdata_service_update_entry (GDATA_SERVICE (service), - gdata_contacts_service_get_primary_authorization_domain (), - GDATA_ENTRY (data->contact), NULL, &error)); - g_assert_no_error (error); - g_assert (GDATA_IS_CONTACTS_CONTACT (new_contact)); - gdata_test_compare_kind (GDATA_ENTRY (new_contact), "http://schemas.google.com/contact/2008#contact", NULL); - g_clear_error (&error); - - /* Check a few properties */ - g_assert_cmpstr (gdata_entry_get_title (GDATA_ENTRY (new_contact)), ==, "John Wilson"); - g_assert_cmpstr (gdata_contacts_contact_get_extended_property (new_contact, "contact-test"), ==, "value"); - g_assert (gdata_contacts_contact_is_deleted (new_contact) == FALSE); - - g_object_unref (new_contact); - - uhm_server_end_trace (mock_server); -} - -typedef struct { - GDataContactsGroup *group1; - GDataContactsGroup *group2; - GDataContactsGroup *group3; -} QueryAllGroupsData; - -static void -set_up_query_all_groups (QueryAllGroupsData *data, gconstpointer service) -{ - GDataContactsGroup *group; - - gdata_test_mock_server_start_trace (mock_server, "setup-query-all-groups"); - - group = gdata_contacts_group_new (NULL); - gdata_entry_set_title (GDATA_ENTRY (group), "Test Group 1"); - data->group1 = gdata_contacts_service_insert_group (GDATA_CONTACTS_SERVICE (service), group, NULL, NULL); - g_assert (GDATA_IS_CONTACTS_GROUP (data->group1)); - g_object_unref (group); - - group = gdata_contacts_group_new (NULL); - gdata_entry_set_title (GDATA_ENTRY (group), "Test Group 2"); - data->group2 = gdata_contacts_service_insert_group (GDATA_CONTACTS_SERVICE (service), group, NULL, NULL); - g_assert (GDATA_IS_CONTACTS_GROUP (data->group2)); - g_object_unref (group); - - group = gdata_contacts_group_new (NULL); - gdata_entry_set_title (GDATA_ENTRY (group), "Test Group 3"); - data->group3 = gdata_contacts_service_insert_group (GDATA_CONTACTS_SERVICE (service), group, NULL, NULL); - g_assert (GDATA_IS_CONTACTS_GROUP (data->group3)); - g_object_unref (group); - - uhm_server_end_trace (mock_server); - - /* HACK! Guess what? Distributed system inconsistency strikes again! */ - if (uhm_server_get_enable_online (mock_server) == TRUE) { - sleep (10); - } -} - -static void -tear_down_query_all_groups (QueryAllGroupsData *data, gconstpointer service) -{ - gdata_test_mock_server_start_trace (mock_server, "teardown-query-all-groups"); - - g_assert (gdata_service_delete_entry (GDATA_SERVICE (service), gdata_contacts_service_get_primary_authorization_domain (), - GDATA_ENTRY (data->group1), NULL, NULL) == TRUE); - g_object_unref (data->group1); - - g_assert (gdata_service_delete_entry (GDATA_SERVICE (service), gdata_contacts_service_get_primary_authorization_domain (), - GDATA_ENTRY (data->group2), NULL, NULL) == TRUE); - g_object_unref (data->group2); - - g_assert (gdata_service_delete_entry (GDATA_SERVICE (service), gdata_contacts_service_get_primary_authorization_domain (), - GDATA_ENTRY (data->group3), NULL, NULL) == TRUE); - g_object_unref (data->group3); - - uhm_server_end_trace (mock_server); -} - -static void -test_query_all_groups (QueryAllGroupsData *data, gconstpointer service) -{ - GDataFeed *feed; - GError *error = NULL; - - gdata_test_mock_server_start_trace (mock_server, "query-all-groups"); - - feed = gdata_contacts_service_query_groups (GDATA_CONTACTS_SERVICE (service), NULL, NULL, NULL, NULL, &error); - g_assert_no_error (error); - g_assert (GDATA_IS_FEED (feed)); - g_clear_error (&error); - - /* TODO: check entries, kinds and feed properties */ - - g_object_unref (feed); - - uhm_server_end_trace (mock_server); -} - -GDATA_ASYNC_CLOSURE_FUNCTIONS (query_all_groups, QueryAllGroupsData); - -GDATA_ASYNC_TEST_FUNCTIONS (query_all_groups, QueryAllGroupsData, -G_STMT_START { - gdata_contacts_service_query_groups_async (GDATA_CONTACTS_SERVICE (service), NULL, cancellable, NULL, NULL, NULL, - async_ready_callback, async_data); -} G_STMT_END, -G_STMT_START { - GDataFeed *feed; - - feed = gdata_service_query_finish (GDATA_SERVICE (obj), async_result, &error); - - if (error == NULL) { - g_assert (GDATA_IS_FEED (feed)); - /* TODO: Tests? */ - - g_object_unref (feed); - } else { - g_assert (feed == NULL); - } -} G_STMT_END); - -static void -test_query_all_groups_async_progress_closure (QueryAllGroupsData *query_data, gconstpointer service) -{ - GDataAsyncProgressClosure *data = g_slice_new0 (GDataAsyncProgressClosure); - - gdata_test_mock_server_start_trace (mock_server, "query-all-groups-async-progress-closure"); - - data->main_loop = g_main_loop_new (NULL, TRUE); - - gdata_contacts_service_query_groups_async (GDATA_CONTACTS_SERVICE (service), NULL, NULL, - (GDataQueryProgressCallback) gdata_test_async_progress_callback, - data, (GDestroyNotify) gdata_test_async_progress_closure_free, - (GAsyncReadyCallback) gdata_test_async_progress_finish_callback, data); - - g_main_loop_run (data->main_loop); - g_main_loop_unref (data->main_loop); - - /* Check that both callbacks were called exactly once */ - g_assert_cmpuint (data->progress_destroy_notify_count, ==, 1); - g_assert_cmpuint (data->async_ready_notify_count, ==, 1); - - g_slice_free (GDataAsyncProgressClosure, data); - - uhm_server_end_trace (mock_server); -} - -typedef struct { - GDataContactsGroup *new_group; -} InsertGroupData; - -static void -set_up_insert_group (InsertGroupData *data, gconstpointer service) -{ - data->new_group = NULL; -} - -static void -tear_down_insert_group (InsertGroupData *data, gconstpointer service) -{ - /* HACK! Distributed systems suck. */ - if (uhm_server_get_enable_online (mock_server) == TRUE) { - sleep (10); - } - - gdata_test_mock_server_start_trace (mock_server, "teardown-insert-group"); - - /* Delete the group, just to be tidy */ - g_assert (gdata_service_delete_entry (GDATA_SERVICE (service), gdata_contacts_service_get_primary_authorization_domain (), - GDATA_ENTRY (data->new_group), NULL, NULL) == TRUE); - g_object_unref (data->new_group); - - uhm_server_end_trace (mock_server); -} - -static void -test_group_insert (InsertGroupData *data, gconstpointer service) -{ - GDataContactsGroup *group, *new_group; - gint64 time_val; - GHashTable *properties; - GError *error = NULL; - - gdata_test_mock_server_start_trace (mock_server, "group-insert"); - - time_val = g_get_real_time () / G_USEC_PER_SEC; - - group = gdata_contacts_group_new (NULL); - - /* Check the kind is present and correct */ - g_assert (GDATA_IS_CONTACTS_GROUP (group)); - gdata_test_compare_kind (GDATA_ENTRY (group), "http://schemas.google.com/contact/2008#group", NULL); - - /* Set various properties */ - gdata_entry_set_title (GDATA_ENTRY (group), "New Group!"); - g_assert (gdata_contacts_group_set_extended_property (group, "foobar", "barfoo") == TRUE); - - /* Insert the group */ - new_group = data->new_group = gdata_contacts_service_insert_group (GDATA_CONTACTS_SERVICE (service), group, NULL, &error); - g_assert_no_error (error); - g_assert (GDATA_IS_CONTACTS_GROUP (new_group)); - gdata_test_compare_kind (GDATA_ENTRY (new_group), "http://schemas.google.com/contact/2008#group", NULL); - g_clear_error (&error); - - /* Check the properties. Time-based properties can't be checked when running against a mock server, since - * the trace files may be quite old. */ - if (uhm_server_get_enable_online (mock_server) == TRUE) { - g_assert_cmpint (gdata_contacts_group_get_edited (new_group), >=, time_val); - } - g_assert (gdata_contacts_group_is_deleted (new_group) == FALSE); - g_assert (gdata_contacts_group_get_system_group_id (new_group) == NULL); - - properties = gdata_contacts_group_get_extended_properties (new_group); - g_assert (properties != NULL); - g_assert_cmpint (g_hash_table_size (properties), ==, 1); - g_assert_cmpstr (gdata_contacts_group_get_extended_property (new_group, "foobar"), ==, "barfoo"); - - g_object_unref (group); - - uhm_server_end_trace (mock_server); -} - -GDATA_ASYNC_CLOSURE_FUNCTIONS (insert_group, InsertGroupData); - -GDATA_ASYNC_TEST_FUNCTIONS (group_insert, InsertGroupData, -G_STMT_START { - GDataContactsGroup *group; - - group = gdata_contacts_group_new (NULL); - - /* Check the kind is present and correct */ - g_assert (GDATA_IS_CONTACTS_GROUP (group)); - gdata_test_compare_kind (GDATA_ENTRY (group), "http://schemas.google.com/contact/2008#group", NULL); - - /* Set various properties */ - gdata_entry_set_title (GDATA_ENTRY (group), "New Group!"); - g_assert (gdata_contacts_group_set_extended_property (group, "foobar", "barfoo") == TRUE); - - gdata_contacts_service_insert_group_async (GDATA_CONTACTS_SERVICE (service), group, cancellable, async_ready_callback, async_data); - - g_object_unref (group); -} G_STMT_END, -G_STMT_START { - GDataEntry *entry; - - entry = gdata_service_insert_entry_finish (GDATA_SERVICE (obj), async_result, &error); - - if (error == NULL) { - g_assert (GDATA_IS_CONTACTS_GROUP (entry)); - /* TODO: Tests? */ - - data->new_group = GDATA_CONTACTS_GROUP (entry); - } else { - g_assert (entry == NULL); - } -} G_STMT_END); - -static void -test_contact_properties (void) -{ - GDataContactsContact *contact; - GDataGDName *name, *name2; - GDataGDEmailAddress *email_address1, *email_address2; - GDataGDPhoneNumber *phone_number1, *phone_number2; - GDataGDIMAddress *im_address; - GDataGDOrganization *org; - GDataGDPostalAddress *postal_address; - GDataGContactJot *jot; - GDataGContactRelation *relation; - GDataGContactWebsite *website; - GDataGContactEvent *event; - GDataGContactCalendar *calendar; - GDataGContactExternalID *external_id; - GDataGContactLanguage *language; - gchar *nickname, *file_as, *billing_information, *directory_server, *gender, *initials, *maiden_name, *mileage, *occupation; - gchar *priority, *sensitivity, *short_name, *subject, *photo_etag; - GDate date, *date2; - gint64 current_time; - gint64 edited; - gboolean deleted, birthday_has_year; - - contact = gdata_contacts_contact_new (NULL); - current_time = g_get_real_time () / G_USEC_PER_SEC; - - /* Check the kind is present and correct */ - g_assert (GDATA_IS_CONTACTS_CONTACT (contact)); - gdata_test_compare_kind (GDATA_ENTRY (contact), "http://schemas.google.com/contact/2008#contact", NULL); - - /* Set and check the name (to check if the title of the entry is updated) */ - gdata_entry_set_title (GDATA_ENTRY (contact), "Elizabeth Bennet"); - name = gdata_contacts_contact_get_name (contact); - g_assert_cmpstr (gdata_gd_name_get_full_name (name), ==, "Elizabeth Bennet"); - gdata_gd_name_set_full_name (name, "Lizzie Bennet"); - g_assert_cmpstr (gdata_entry_get_title (GDATA_ENTRY (contact)), ==, "Lizzie Bennet"); - - name2 = gdata_gd_name_new ("John", "Smith"); - gdata_gd_name_set_full_name (name2, "John Smith"); - gdata_contacts_contact_set_name (contact, name2); - g_object_unref (name2); - g_assert_cmpstr (gdata_entry_get_title (GDATA_ENTRY (contact)), ==, "John Smith"); - - gdata_contacts_contact_set_nickname (contact, "Big J"); - gdata_contacts_contact_set_file_as (contact, "J, Big"); - g_date_set_dmy (&date, 1, 1, 1900); - gdata_contacts_contact_set_birthday (contact, &date, FALSE); - gdata_entry_set_content (GDATA_ENTRY (contact), "Notes"); - gdata_contacts_contact_set_billing_information (contact, "Big J Enterprises, Ltd."); - gdata_contacts_contact_set_directory_server (contact, "This is a server"); - gdata_contacts_contact_set_gender (contact, GDATA_CONTACTS_GENDER_MALE); - gdata_contacts_contact_set_initials (contact, "A. B. C."); - gdata_contacts_contact_set_maiden_name (contact, "Smith"); - gdata_contacts_contact_set_mileage (contact, "12km"); - gdata_contacts_contact_set_occupation (contact, "Professional bum"); - gdata_contacts_contact_set_priority (contact, GDATA_CONTACTS_PRIORITY_HIGH); - gdata_contacts_contact_set_sensitivity (contact, GDATA_CONTACTS_SENSITIVITY_PERSONAL); - gdata_contacts_contact_set_short_name (contact, "Jon"); - gdata_contacts_contact_set_subject (contact, "Charity work"); - - email_address1 = gdata_gd_email_address_new ("liz@gmail.com", GDATA_GD_EMAIL_ADDRESS_WORK, NULL, FALSE); - gdata_contacts_contact_add_email_address (contact, email_address1); - g_object_unref (email_address1); - - email_address2 = gdata_gd_email_address_new ("liz@example.org", GDATA_GD_EMAIL_ADDRESS_HOME, NULL, FALSE); - gdata_contacts_contact_add_email_address (contact, email_address2); - g_object_unref (email_address2); - - phone_number1 = gdata_gd_phone_number_new ("(206)555-1212", GDATA_GD_PHONE_NUMBER_WORK, NULL, NULL, TRUE); - gdata_contacts_contact_add_phone_number (contact, phone_number1); - g_object_unref (phone_number1); - - phone_number2 = gdata_gd_phone_number_new ("(206)555-1213", GDATA_GD_PHONE_NUMBER_HOME, NULL, NULL, FALSE); - gdata_contacts_contact_add_phone_number (contact, phone_number2); - g_object_unref (phone_number2); - - im_address = gdata_gd_im_address_new ("liz@gmail.com", GDATA_GD_IM_PROTOCOL_GOOGLE_TALK, GDATA_GD_IM_ADDRESS_HOME, NULL, FALSE); - gdata_contacts_contact_add_im_address (contact, im_address); - g_object_unref (im_address); - - postal_address = gdata_gd_postal_address_new (GDATA_GD_POSTAL_ADDRESS_WORK, NULL, TRUE); - gdata_gd_postal_address_set_street (postal_address, "1600 Amphitheatre Pkwy Mountain View"); - gdata_contacts_contact_add_postal_address (contact, postal_address); - g_object_unref (postal_address); - - org = gdata_gd_organization_new ("OrgCorp", "President", GDATA_GD_ORGANIZATION_WORK, NULL, FALSE); - gdata_contacts_contact_add_organization (contact, org); - g_object_unref (org); - - jot = gdata_gcontact_jot_new ("This is a jot.", GDATA_GCONTACT_JOT_OTHER); - gdata_contacts_contact_add_jot (contact, jot); - g_object_unref (jot); - - relation = gdata_gcontact_relation_new ("Brian Haddock", GDATA_GCONTACT_RELATION_FRIEND, NULL); - gdata_contacts_contact_add_relation (contact, relation); - g_object_unref (relation); - - website = gdata_gcontact_website_new ("http://example.com/", GDATA_GCONTACT_WEBSITE_PROFILE, NULL, TRUE); - gdata_contacts_contact_add_website (contact, website); - g_object_unref (website); - - event = gdata_gcontact_event_new (&date, GDATA_GCONTACT_EVENT_ANNIVERSARY, NULL); - gdata_contacts_contact_add_event (contact, event); - g_object_unref (event); - - calendar = gdata_gcontact_calendar_new ("http://calendar.example.com/", GDATA_GCONTACT_CALENDAR_HOME, NULL, TRUE); - gdata_contacts_contact_add_calendar (contact, calendar); - g_object_unref (calendar); - - external_id = gdata_gcontact_external_id_new ("Number Six", GDATA_GCONTACT_EXTERNAL_ID_ORGANIZATION, NULL); - gdata_contacts_contact_add_external_id (contact, external_id); - g_object_unref (external_id); - - gdata_contacts_contact_add_hobby (contact, "Rowing"); - - language = gdata_gcontact_language_new ("en-GB", NULL); - gdata_contacts_contact_add_language (contact, language); - g_object_unref (language); - - /* Add some extended properties */ - g_assert (gdata_contacts_contact_set_extended_property (contact, "TITLE", NULL) == TRUE); - g_assert (gdata_contacts_contact_set_extended_property (contact, "ROLE", "") == TRUE); - g_assert (gdata_contacts_contact_set_extended_property (contact, "CALURI", "http://example.com/") == TRUE); - - /* Add some user-defined fields */ - gdata_contacts_contact_set_user_defined_field (contact, "Favourite colour", "Blue"); - gdata_contacts_contact_set_user_defined_field (contact, "Owes me", "£10"); - gdata_contacts_contact_set_user_defined_field (contact, "My notes", ""); - gdata_contacts_contact_set_user_defined_field (contact, "", "Foo"); /* bgo#648058 */ - - /* Check the properties of the object */ - g_object_get (G_OBJECT (contact), - "edited", &edited, - "deleted", &deleted, - "photo-etag", &photo_etag, - "name", &name, - "nickname", &nickname, - "file-as", &file_as, - "birthday", &date2, - "birthday-has-year", &birthday_has_year, - "billing-information", &billing_information, - "directory-server", &directory_server, - "gender", &gender, - "initials", &initials, - "maiden-name", &maiden_name, - "mileage", &mileage, - "occupation", &occupation, - "priority", &priority, - "sensitivity", &sensitivity, - "short-name", &short_name, - "subject", &subject, - NULL); - - g_assert_cmpint (edited, ==, current_time); - g_assert (deleted == FALSE); - g_assert (photo_etag == NULL); - g_assert (name2 == name); - g_assert_cmpstr (nickname, ==, "Big J"); - g_assert_cmpstr (file_as, ==, "J, Big"); - g_assert (g_date_valid (date2) == TRUE); - g_assert_cmpuint (g_date_get_month (date2), ==, 1); - g_assert_cmpuint (g_date_get_day (date2), ==, 1); - g_assert (birthday_has_year == FALSE); - g_assert_cmpstr (billing_information, ==, "Big J Enterprises, Ltd."); - g_assert_cmpstr (directory_server, ==, "This is a server"); - g_assert_cmpstr (gender, ==, GDATA_CONTACTS_GENDER_MALE); - g_assert_cmpstr (initials, ==, "A. B. C."); - g_assert_cmpstr (maiden_name, ==, "Smith"); - g_assert_cmpstr (mileage, ==, "12km"); - g_assert_cmpstr (occupation, ==, "Professional bum"); - g_assert_cmpstr (priority, ==, GDATA_CONTACTS_PRIORITY_HIGH); - g_assert_cmpstr (sensitivity, ==, GDATA_CONTACTS_SENSITIVITY_PERSONAL); - g_assert_cmpstr (short_name, ==, "Jon"); - g_assert_cmpstr (subject, ==, "Charity work"); - - g_object_unref (name2); - g_free (date2); - g_free (nickname); - g_free (file_as); - g_free (billing_information); - g_free (directory_server); - g_free (gender); - g_free (initials); - g_free (maiden_name); - g_free (mileage); - g_free (occupation); - g_free (priority); - g_free (sensitivity); - g_free (short_name); - g_free (subject); - g_free (photo_etag); - - /* Check the XML */ - gdata_test_assert_xml (contact, - "" - "" - "John Smith" - "Notes" - "" - "" - "John" - "Smith" - "John Smith" - "" - "" - "" - "" - "(206)555-1212" - "(206)555-1213" - "" - "1600 Amphitheatre Pkwy Mountain View" - "" - "" - "OrgCorp" - "President" - "" - "This is a jot." - "Brian Haddock" - "" - "" - "" - "" - "" - "http://example.com/" - "" - "" - "" - "" /* bgo#648058 */ - "Rowing" - "Big J" - "J, Big" - "" - "Big J Enterprises, Ltd." - "This is a server" - "" - "A. B. C." - "Smith" - "12km" - "Professional bum" - "" - "" - "Jon" - "Charity work" - ""); - - /* Try removing some things from the contact and ensure it works */ - gdata_contacts_contact_remove_all_email_addresses (contact); - g_assert (gdata_contacts_contact_get_email_addresses (contact) == NULL); - g_assert (gdata_contacts_contact_get_primary_email_address (contact) == NULL); - - gdata_contacts_contact_remove_all_im_addresses (contact); - g_assert (gdata_contacts_contact_get_im_addresses (contact) == NULL); - g_assert (gdata_contacts_contact_get_primary_im_address (contact) == NULL); - - gdata_contacts_contact_remove_all_phone_numbers (contact); - g_assert (gdata_contacts_contact_get_phone_numbers (contact) == NULL); - g_assert (gdata_contacts_contact_get_primary_phone_number (contact) == NULL); - - gdata_contacts_contact_remove_all_postal_addresses (contact); - g_assert (gdata_contacts_contact_get_postal_addresses (contact) == NULL); - g_assert (gdata_contacts_contact_get_primary_postal_address (contact) == NULL); - - gdata_contacts_contact_remove_all_organizations (contact); - g_assert (gdata_contacts_contact_get_organizations (contact) == NULL); - g_assert (gdata_contacts_contact_get_primary_organization (contact) == NULL); - - gdata_contacts_contact_remove_all_jots (contact); - g_assert (gdata_contacts_contact_get_jots (contact) == NULL); - - gdata_contacts_contact_remove_all_relations (contact); - g_assert (gdata_contacts_contact_get_relations (contact) == NULL); - - gdata_contacts_contact_remove_all_websites (contact); - g_assert (gdata_contacts_contact_get_websites (contact) == NULL); - g_assert (gdata_contacts_contact_get_primary_website (contact) == NULL); - - gdata_contacts_contact_remove_all_events (contact); - g_assert (gdata_contacts_contact_get_events (contact) == NULL); - - gdata_contacts_contact_remove_all_calendars (contact); - g_assert (gdata_contacts_contact_get_calendars (contact) == NULL); - g_assert (gdata_contacts_contact_get_primary_calendar (contact) == NULL); - - gdata_contacts_contact_remove_all_external_ids (contact); - g_assert (gdata_contacts_contact_get_external_ids (contact) == NULL); - - gdata_contacts_contact_remove_all_languages (contact); - g_assert (gdata_contacts_contact_get_languages (contact) == NULL); - - gdata_contacts_contact_remove_all_hobbies (contact); - g_assert (gdata_contacts_contact_get_hobbies (contact) == NULL); -} - -static void -test_contact_escaping (void) -{ - GDataContactsContact *contact; - - contact = gdata_contacts_contact_new (NULL); - gdata_contacts_contact_set_nickname (contact, "Nickname & stuff"); - gdata_contacts_contact_set_file_as (contact, "Stuff, & Nickname"); - gdata_contacts_contact_set_billing_information (contact, "Billing information & stuff"); - gdata_contacts_contact_set_directory_server (contact, "http://foo.com?foo&bar"); - gdata_contacts_contact_set_gender (contact, "Misc. & other"); - gdata_contacts_contact_set_initials (contact, ""); - gdata_contacts_contact_set_maiden_name (contact, "Maiden & name"); - gdata_contacts_contact_set_mileage (contact, "Over the hills & far away"); - gdata_contacts_contact_set_occupation (contact, "Occupation & stuff"); - gdata_contacts_contact_set_priority (contact, "http://foo.com?foo&priority=bar"); - gdata_contacts_contact_set_sensitivity (contact, "http://foo.com?foo&sensitivity=bar"); - gdata_contacts_contact_set_short_name (contact, "Short name & stuff"); - gdata_contacts_contact_set_subject (contact, "Subject & stuff"); - gdata_contacts_contact_add_hobby (contact, "Escaping &s"); - gdata_contacts_contact_set_extended_property (contact, "extended & prop", "Value should be a pre-escaped XML blob."); - gdata_contacts_contact_set_user_defined_field (contact, "User defined field & stuff", "Value & stuff"); - gdata_contacts_contact_add_group (contact, "http://foo.com?foo&bar"); - - /* Check the outputted XML is escaped properly */ - gdata_test_assert_xml (contact, - "" - "" - "" - "" - "" - "" - "Value should be a pre-escaped XML blob." - "" - "" - "" - "Escaping &s" - "Nickname & stuff" - "Stuff, & Nickname" - "Billing information & stuff" - "http://foo.com?foo&bar" - "" - "<AB>" - "Maiden & name" - "Over the hills & far away" - "Occupation & stuff" - "" - "" - "Short name & stuff" - "Subject & stuff" - ""); - g_object_unref (contact); -} - -static void -test_group_escaping (void) -{ - GDataContactsGroup *group; - - group = gdata_contacts_group_new (NULL); - gdata_contacts_group_set_extended_property (group, "extended & prop", "Value should be a pre-escaped XML blob."); - - /* Check the outputted XML is escaped properly */ - gdata_test_assert_xml (group, - "" - "" - "" - "" - "" - "Value should be a pre-escaped XML blob." - "" - ""); - g_object_unref (group); -} - -static void -test_query_uri (void) -{ - gchar *query_uri; - GDataContactsQuery *query = gdata_contacts_query_new ("q"); - - gdata_contacts_query_set_order_by (query, "lastmodified"); - g_assert_cmpstr (gdata_contacts_query_get_order_by (query), ==, "lastmodified"); - - gdata_contacts_query_set_show_deleted (query, FALSE); - g_assert (gdata_contacts_query_show_deleted (query) == FALSE); - - /* Test it with both values of show-deleted */ - query_uri = gdata_query_get_query_uri (GDATA_QUERY (query), "http://example.com"); - g_assert_cmpstr (query_uri, ==, "http://example.com?q=q&orderby=lastmodified&showdeleted=false"); - g_free (query_uri); - - gdata_contacts_query_set_show_deleted (query, TRUE); - g_assert (gdata_contacts_query_show_deleted (query) == TRUE); - - gdata_contacts_query_set_sort_order (query, "descending"); - g_assert_cmpstr (gdata_contacts_query_get_sort_order (query), ==, "descending"); - - gdata_contacts_query_set_group (query, "http://www.google.com/feeds/contacts/groups/jo@gmail.com/base/1234a"); - g_assert_cmpstr (gdata_contacts_query_get_group (query), ==, "http://www.google.com/feeds/contacts/groups/jo@gmail.com/base/1234a"); - - /* Check the built query URI with a normal feed URI */ - query_uri = gdata_query_get_query_uri (GDATA_QUERY (query), "http://example.com"); - g_assert_cmpstr (query_uri, ==, "http://example.com?q=q&orderby=lastmodified&showdeleted=true&sortorder=descending" - "&group=http%3A%2F%2Fwww.google.com%2Ffeeds%2Fcontacts%2Fgroups%2Fjo%40gmail.com%2Fbase%2F1234a"); - g_free (query_uri); - - /* …with a feed URI with a trailing slash */ - query_uri = gdata_query_get_query_uri (GDATA_QUERY (query), "http://example.com/"); - g_assert_cmpstr (query_uri, ==, "http://example.com/?q=q&orderby=lastmodified&showdeleted=true&sortorder=descending" - "&group=http%3A%2F%2Fwww.google.com%2Ffeeds%2Fcontacts%2Fgroups%2Fjo%40gmail.com%2Fbase%2F1234a"); - g_free (query_uri); - - /* …with a feed URI with pre-existing arguments */ - query_uri = gdata_query_get_query_uri (GDATA_QUERY (query), "http://example.com/bar/?test=test&this=that"); - g_assert_cmpstr (query_uri, ==, "http://example.com/bar/?test=test&this=that&q=q&orderby=lastmodified&showdeleted=true&sortorder=descending" - "&group=http%3A%2F%2Fwww.google.com%2Ffeeds%2Fcontacts%2Fgroups%2Fjo%40gmail.com%2Fbase%2F1234a"); - g_free (query_uri); - - g_object_unref (query); -} - -static void -test_query_etag (void) -{ - GDataContactsQuery *query = gdata_contacts_query_new (NULL); - - /* Test that setting any property will unset the ETag */ - g_test_bug ("613529"); - -#define CHECK_ETAG(C) \ - gdata_query_set_etag (GDATA_QUERY (query), "foobar"); \ - (C); \ - g_assert (gdata_query_get_etag (GDATA_QUERY (query)) == NULL); - - CHECK_ETAG (gdata_contacts_query_set_order_by (query, "foobar")) - CHECK_ETAG (gdata_contacts_query_set_show_deleted (query, FALSE)) - CHECK_ETAG (gdata_contacts_query_set_sort_order (query, "shizzle")) - CHECK_ETAG (gdata_contacts_query_set_group (query, "support group")) - -#undef CHECK_ETAG - - g_object_unref (query); -} - -static void -test_query_properties (void) -{ - gchar *order_by, *sort_order, *group; - gboolean show_deleted; - guint start_index, max_results; - GDataContactsQuery *query = gdata_contacts_query_new_with_limits ("q", 1, 10); - - /* Set the properties */ - g_object_set (G_OBJECT (query), - "order-by", "lastmodified", - "show-deleted", TRUE, - "sort-order", "descending", - "group", "http://www.google.com/feeds/contacts/groups/jo@gmail.com/base/1234a", - NULL); - - /* Check the query's properties */ - g_object_get (G_OBJECT (query), - "order-by", &order_by, - "show-deleted", &show_deleted, - "sort-order", &sort_order, - "group", &group, - "start-index", &start_index, - "max-results", &max_results, - NULL); - - g_assert_cmpstr (order_by, ==, "lastmodified"); - g_assert (show_deleted == TRUE); - g_assert_cmpstr (sort_order, ==, "descending"); - g_assert_cmpstr (group, ==, "http://www.google.com/feeds/contacts/groups/jo@gmail.com/base/1234a"); - g_assert_cmpuint (start_index, ==, 1); - g_assert_cmpuint (max_results, ==, 10); - - g_free (order_by); - g_free (sort_order); - g_free (group); - - g_object_unref (query); -} - -static void -test_contact_parser_minimal (void) -{ - GDataContactsContact *contact; - GDate birthday; - GError *error = NULL; - - g_test_bug ("580330"); - - contact = GDATA_CONTACTS_CONTACT (gdata_parsable_new_from_xml (GDATA_TYPE_CONTACTS_CONTACT, - "" - "http://www.google.com/m8/feeds/contacts/libgdata.test@googlemail.com/base/1b46cdd20bfbee3b" - "2009-04-25T15:21:53.688Z" - "2009-04-25T15:21:53.688Z" - "" - "" /* Here's where it all went wrong */ - "" - "" - "" - "" - "", -1, &error)); - g_assert_no_error (error); - g_assert (GDATA_IS_CONTACTS_CONTACT (contact)); - gdata_test_compare_kind (GDATA_ENTRY (contact), "http://schemas.google.com/contact/2008#contact", NULL); - g_clear_error (&error); - - /* Check the contact's properties */ - g_assert (gdata_entry_get_title (GDATA_ENTRY (contact)) != NULL); - g_assert (*gdata_entry_get_title (GDATA_ENTRY (contact)) == '\0'); - - /* TODO: Check the other properties */ - - g_assert (gdata_contacts_contact_get_nickname (contact) == NULL); - g_assert (gdata_contacts_contact_get_file_as (contact) == NULL); - g_assert (gdata_contacts_contact_get_birthday (contact, &birthday) == FALSE); - g_assert (g_date_valid (&birthday) == FALSE); - g_assert (gdata_contacts_contact_get_billing_information (contact) == NULL); - g_assert (gdata_contacts_contact_get_directory_server (contact) == NULL); - g_assert (gdata_contacts_contact_get_gender (contact) == NULL); - g_assert (gdata_contacts_contact_get_initials (contact) == NULL); - g_assert (gdata_contacts_contact_get_maiden_name (contact) == NULL); - g_assert (gdata_contacts_contact_get_mileage (contact) == NULL); - g_assert (gdata_contacts_contact_get_occupation (contact) == NULL); - g_assert (gdata_contacts_contact_get_priority (contact) == NULL); - g_assert (gdata_contacts_contact_get_sensitivity (contact) == NULL); - g_assert (gdata_contacts_contact_get_short_name (contact) == NULL); - g_assert (gdata_contacts_contact_get_subject (contact) == NULL); - g_assert (gdata_contacts_contact_get_jots (contact) == NULL); - g_assert (gdata_contacts_contact_get_relations (contact) == NULL); - g_assert (gdata_contacts_contact_get_websites (contact) == NULL); - g_assert (gdata_contacts_contact_get_primary_website (contact) == NULL); - g_assert (gdata_contacts_contact_get_events (contact) == NULL); - g_assert (gdata_contacts_contact_get_calendars (contact) == NULL); - g_assert (gdata_contacts_contact_get_primary_calendar (contact) == NULL); - g_assert (gdata_contacts_contact_get_external_ids (contact) == NULL); - g_assert (gdata_contacts_contact_get_languages (contact) == NULL); - g_assert (gdata_contacts_contact_get_hobbies (contact) == NULL); - - g_object_unref (contact); -} - -static void -test_contact_parser_normal (void) -{ - GDataContactsContact *contact; - GDate date; - GList *list; - GError *error = NULL; - - contact = GDATA_CONTACTS_CONTACT (gdata_parsable_new_from_xml (GDATA_TYPE_CONTACTS_CONTACT, - "" - "http://www.google.com/m8/feeds/contacts/libgdata.test@googlemail.com/base/1b46cdd20bfbee3b" - "2009-04-25T15:21:53.688Z" - "2009-04-25T15:21:53.688Z" - "" - "" /* Here's where it all went wrong */ - "" - "" - "" - "" - "" /* https://bugzilla.gnome.org/show_bug.cgi?id=734863 */ - "" - "" - "" - "" - "" - "Agent Smith" - "Smith, Agent" - "" - "Foo & Bar Inc." - "Directory & server" - "" - "X. Y. Z." - "Foo" - "15km" - "Occupied" - "" - "" - "Smith" - "Film buddy" - "Moved house on 2010-02-14 to the North Pole." - "Owes me ten pounds." - "" /* Empty on purpose */ - "Darth Vader" - "Rob Halford" - "" - "" - "" - "" /* empty on purpose; see bgo#790671 */ - "" - "" - "" - "" - "" - "" - "" - "" - "" - "Programming" - "Heavy metal" - "Heavy metal" /* Test that duplicates get merged */ - "", -1, &error)); - g_assert_no_error (error); - g_assert (GDATA_IS_CONTACTS_CONTACT (contact)); - gdata_test_compare_kind (GDATA_ENTRY (contact), "http://schemas.google.com/contact/2008#contact", NULL); - g_clear_error (&error); - - /* TODO: Check the other properties */ - - g_assert_cmpstr (gdata_contacts_contact_get_nickname (contact), ==, "Agent Smith"); - g_assert_cmpstr (gdata_contacts_contact_get_file_as (contact), ==, "Smith, Agent"); - g_assert_cmpstr (gdata_contacts_contact_get_billing_information (contact), ==, "Foo & Bar Inc."); - g_assert_cmpstr (gdata_contacts_contact_get_directory_server (contact), ==, "Directory & server"); - g_assert_cmpstr (gdata_contacts_contact_get_gender (contact), ==, GDATA_CONTACTS_GENDER_FEMALE); - g_assert_cmpstr (gdata_contacts_contact_get_initials (contact), ==, "X. Y. Z."); - g_assert_cmpstr (gdata_contacts_contact_get_maiden_name (contact), ==, "Foo"); - g_assert_cmpstr (gdata_contacts_contact_get_mileage (contact), ==, "15km"); - g_assert_cmpstr (gdata_contacts_contact_get_occupation (contact), ==, "Occupied"); - g_assert_cmpstr (gdata_contacts_contact_get_priority (contact), ==, GDATA_CONTACTS_PRIORITY_LOW); - g_assert_cmpstr (gdata_contacts_contact_get_sensitivity (contact), ==, GDATA_CONTACTS_SENSITIVITY_CONFIDENTIAL); - g_assert_cmpstr (gdata_contacts_contact_get_short_name (contact), ==, "Smith"); - g_assert_cmpstr (gdata_contacts_contact_get_subject (contact), ==, "Film buddy"); - - /* Birthday */ - g_assert (gdata_contacts_contact_get_birthday (contact, &date) == TRUE); - g_assert (g_date_valid (&date) == TRUE); - g_assert_cmpuint (g_date_get_year (&date), ==, 2010); - g_assert_cmpuint (g_date_get_month (&date), ==, 12); - g_assert_cmpuint (g_date_get_day (&date), ==, 3); - - /* Jots */ - list = gdata_contacts_contact_get_jots (contact); - g_assert_cmpuint (g_list_length (list), ==, 3); - - g_assert (GDATA_IS_GCONTACT_JOT (list->data)); - g_assert_cmpstr (gdata_gcontact_jot_get_content (GDATA_GCONTACT_JOT (list->data)), ==, "Moved house on 2010-02-14 to the North Pole."); - g_assert_cmpstr (gdata_gcontact_jot_get_relation_type (GDATA_GCONTACT_JOT (list->data)), ==, GDATA_GCONTACT_JOT_HOME); - - list = list->next; - g_assert (GDATA_IS_GCONTACT_JOT (list->data)); - g_assert_cmpstr (gdata_gcontact_jot_get_content (GDATA_GCONTACT_JOT (list->data)), ==, "Owes me ten pounds."); - g_assert_cmpstr (gdata_gcontact_jot_get_relation_type (GDATA_GCONTACT_JOT (list->data)), ==, GDATA_GCONTACT_JOT_USER); - - list = list->next; - g_assert (GDATA_IS_GCONTACT_JOT (list->data)); - g_assert (gdata_gcontact_jot_get_content (GDATA_GCONTACT_JOT (list->data)) == NULL); - g_assert_cmpstr (gdata_gcontact_jot_get_relation_type (GDATA_GCONTACT_JOT (list->data)), ==, GDATA_GCONTACT_JOT_OTHER); - - /* Relations */ - list = gdata_contacts_contact_get_relations (contact); - g_assert_cmpuint (g_list_length (list), ==, 2); - - g_assert (GDATA_IS_GCONTACT_RELATION (list->data)); - g_assert_cmpstr (gdata_gcontact_relation_get_name (GDATA_GCONTACT_RELATION (list->data)), ==, "Darth Vader"); - g_assert_cmpstr (gdata_gcontact_relation_get_relation_type (GDATA_GCONTACT_RELATION (list->data)), ==, GDATA_GCONTACT_RELATION_FATHER); - g_assert (gdata_gcontact_relation_get_label (GDATA_GCONTACT_RELATION (list->data)) == NULL); - - list = list->next; - g_assert (GDATA_IS_GCONTACT_RELATION (list->data)); - g_assert_cmpstr (gdata_gcontact_relation_get_name (GDATA_GCONTACT_RELATION (list->data)), ==, "Rob Halford"); - g_assert (gdata_gcontact_relation_get_relation_type (GDATA_GCONTACT_RELATION (list->data)) == NULL); - g_assert_cmpstr (gdata_gcontact_relation_get_label (GDATA_GCONTACT_RELATION (list->data)), ==, "Favourite singer"); - - /* Websites */ - list = gdata_contacts_contact_get_websites (contact); - g_assert_cmpuint (g_list_length (list), ==, 3); - /* Note the empty website should *not* be present. See bgo#790671. */ - - g_assert (GDATA_IS_GCONTACT_WEBSITE (list->data)); - g_assert_cmpstr (gdata_gcontact_website_get_uri (GDATA_GCONTACT_WEBSITE (list->data)), ==, "http://example.com"); - g_assert_cmpstr (gdata_gcontact_website_get_relation_type (GDATA_GCONTACT_WEBSITE (list->data)), ==, GDATA_GCONTACT_WEBSITE_HOME_PAGE); - g_assert_cmpstr (gdata_gcontact_website_get_label (GDATA_GCONTACT_WEBSITE (list->data)), ==, "Home tab #1"); - g_assert (gdata_gcontact_website_is_primary (GDATA_GCONTACT_WEBSITE (list->data)) == TRUE); - - g_assert (gdata_contacts_contact_get_primary_website (contact) == list->data); - - list = list->next; - g_assert (GDATA_IS_GCONTACT_WEBSITE (list->data)); - g_assert_cmpstr (gdata_gcontact_website_get_uri (GDATA_GCONTACT_WEBSITE (list->data)), ==, "http://example.com"); - g_assert_cmpstr (gdata_gcontact_website_get_relation_type (GDATA_GCONTACT_WEBSITE (list->data)), ==, GDATA_GCONTACT_WEBSITE_WORK); - g_assert (gdata_gcontact_website_get_label (GDATA_GCONTACT_WEBSITE (list->data)) == NULL); - g_assert (gdata_gcontact_website_is_primary (GDATA_GCONTACT_WEBSITE (list->data)) == FALSE); - - list = list->next; - g_assert (GDATA_IS_GCONTACT_WEBSITE (list->data)); - g_assert_cmpstr (gdata_gcontact_website_get_uri (GDATA_GCONTACT_WEBSITE (list->data)), ==, "http://bar.com"); - g_assert_cmpstr (gdata_gcontact_website_get_relation_type (GDATA_GCONTACT_WEBSITE (list->data)), ==, GDATA_GCONTACT_WEBSITE_PROFILE); - g_assert (gdata_gcontact_website_get_label (GDATA_GCONTACT_WEBSITE (list->data)) == NULL); - g_assert (gdata_gcontact_website_is_primary (GDATA_GCONTACT_WEBSITE (list->data)) == FALSE); - - /* Events */ - list = gdata_contacts_contact_get_events (contact); - g_assert_cmpuint (g_list_length (list), ==, 2); - - g_assert (GDATA_IS_GCONTACT_EVENT (list->data)); - gdata_gcontact_event_get_date (GDATA_GCONTACT_EVENT (list->data), &date); - g_assert (g_date_valid (&date) == TRUE); - g_assert_cmpuint (g_date_get_year (&date), ==, 2010); - g_assert_cmpuint (g_date_get_month (&date), ==, 3); - g_assert_cmpuint (g_date_get_day (&date), ==, 4); - g_assert_cmpstr (gdata_gcontact_event_get_relation_type (GDATA_GCONTACT_EVENT (list->data)), ==, GDATA_GCONTACT_EVENT_ANNIVERSARY); - g_assert (gdata_gcontact_event_get_label (GDATA_GCONTACT_EVENT (list->data)) == NULL); - - list = list->next; - g_assert (GDATA_IS_GCONTACT_EVENT (list->data)); - gdata_gcontact_event_get_date (GDATA_GCONTACT_EVENT (list->data), &date); - g_assert (g_date_valid (&date) == TRUE); - g_assert_cmpuint (g_date_get_year (&date), ==, 1900); - g_assert_cmpuint (g_date_get_month (&date), ==, 1); - g_assert_cmpuint (g_date_get_day (&date), ==, 1); - g_assert (gdata_gcontact_event_get_relation_type (GDATA_GCONTACT_EVENT (list->data)) == NULL); - g_assert_cmpstr (gdata_gcontact_event_get_label (GDATA_GCONTACT_EVENT (list->data)), ==, "Foobar"); - - /* Calendars */ - list = gdata_contacts_contact_get_calendars (contact); - g_assert_cmpuint (g_list_length (list), ==, 3); - - g_assert (GDATA_IS_GCONTACT_CALENDAR (list->data)); - g_assert_cmpstr (gdata_gcontact_calendar_get_uri (GDATA_GCONTACT_CALENDAR (list->data)), ==, "http://example.com/"); - g_assert_cmpstr (gdata_gcontact_calendar_get_relation_type (GDATA_GCONTACT_CALENDAR (list->data)), ==, GDATA_GCONTACT_CALENDAR_FREE_BUSY); - g_assert (gdata_gcontact_calendar_get_label (GDATA_GCONTACT_CALENDAR (list->data)) == NULL); - g_assert (gdata_gcontact_calendar_is_primary (GDATA_GCONTACT_CALENDAR (list->data)) == TRUE); - - g_assert (gdata_contacts_contact_get_primary_calendar (contact) == list->data); - - list = list->next; - g_assert (GDATA_IS_GCONTACT_CALENDAR (list->data)); - g_assert_cmpstr (gdata_gcontact_calendar_get_uri (GDATA_GCONTACT_CALENDAR (list->data)), ==, "http://example.com/"); - g_assert (gdata_gcontact_calendar_get_relation_type (GDATA_GCONTACT_CALENDAR (list->data)) == NULL); - g_assert_cmpstr (gdata_gcontact_calendar_get_label (GDATA_GCONTACT_CALENDAR (list->data)), ==, "Gig list"); - g_assert (gdata_gcontact_calendar_is_primary (GDATA_GCONTACT_CALENDAR (list->data)) == FALSE); - - list = list->next; - g_assert (GDATA_IS_GCONTACT_CALENDAR (list->data)); - g_assert_cmpstr (gdata_gcontact_calendar_get_uri (GDATA_GCONTACT_CALENDAR (list->data)), ==, "http://foo.com/calendar"); - g_assert_cmpstr (gdata_gcontact_calendar_get_relation_type (GDATA_GCONTACT_CALENDAR (list->data)), ==, GDATA_GCONTACT_CALENDAR_HOME); - g_assert (gdata_gcontact_calendar_get_label (GDATA_GCONTACT_CALENDAR (list->data)) == NULL); - g_assert (gdata_gcontact_calendar_is_primary (GDATA_GCONTACT_CALENDAR (list->data)) == FALSE); - - /* External IDs */ - list = gdata_contacts_contact_get_external_ids (contact); - g_assert_cmpuint (g_list_length (list), ==, 2); - - g_assert (GDATA_IS_GCONTACT_EXTERNAL_ID (list->data)); - g_assert (GDATA_IS_GCONTACT_EXTERNAL_ID (list->next->data)); - - /* Languages */ - list = gdata_contacts_contact_get_languages (contact); - g_assert_cmpuint (g_list_length (list), ==, 2); - - g_assert (GDATA_IS_GCONTACT_LANGUAGE (list->data)); - g_assert (GDATA_IS_GCONTACT_LANGUAGE (list->next->data)); - - /* Hobbies */ - list = gdata_contacts_contact_get_hobbies (contact); - g_assert_cmpuint (g_list_length (list), ==, 2); - - g_assert_cmpstr (list->data, ==, "Programming"); - g_assert_cmpstr (list->next->data, ==, "Heavy metal"); - - g_object_unref (contact); -} - -static void -test_contact_parser_error_handling (void) -{ - GDataContactsContact *contact; - GError *error = NULL; - -#define TEST_XML_ERROR_HANDLING(x) \ - contact = GDATA_CONTACTS_CONTACT (gdata_parsable_new_from_xml (GDATA_TYPE_CONTACTS_CONTACT,\ - ""\ - x\ - "", -1, &error));\ - g_assert_error (error, GDATA_SERVICE_ERROR, GDATA_SERVICE_ERROR_PROTOCOL_ERROR);\ - g_assert (contact == NULL);\ - g_clear_error (&error) - - /* app:edited */ - TEST_XML_ERROR_HANDLING ("this shouldn't parse"); - - /* gd:name */ - TEST_XML_ERROR_HANDLING ("SpartacusSpartacus"); - - /* gd:email */ - TEST_XML_ERROR_HANDLING ("neither should this"); - - /* gd:im */ - TEST_XML_ERROR_HANDLING ("nor this"); - - /* gd:phoneNumber */ - TEST_XML_ERROR_HANDLING (""); - - /* gd:structuredPostalAddress */ - TEST_XML_ERROR_HANDLING (""); - - /* gd:organization */ - TEST_XML_ERROR_HANDLING (""); - - /* gd:extendedProperty */ - TEST_XML_ERROR_HANDLING (""); - - /* gContact:userDefinedField */ - TEST_XML_ERROR_HANDLING (""); /* no key or value */ - TEST_XML_ERROR_HANDLING (""); /* no value */ - TEST_XML_ERROR_HANDLING (""); /* no key */ - - /* gContact:groupMembershipInfo */ - TEST_XML_ERROR_HANDLING (""); - TEST_XML_ERROR_HANDLING (""); - - /* gContact:nickname */ - TEST_XML_ERROR_HANDLING (""); /* missing content */ - TEST_XML_ERROR_HANDLING ("Nickname 1Duplicate!"); /* duplicate */ - - /* gContact:fileAs */ - TEST_XML_ERROR_HANDLING (""); /* missing content */ - TEST_XML_ERROR_HANDLING ("File As 1Duplicate!"); /* duplicate */ - - /* gContact:birthday */ - TEST_XML_ERROR_HANDLING (""); /* missing "when" attribute */ - TEST_XML_ERROR_HANDLING (""); /* invalid date */ - TEST_XML_ERROR_HANDLING (""); /* duplicate */ - - /* gContact:billingInformation */ - TEST_XML_ERROR_HANDLING (""); /* missing content */ - TEST_XML_ERROR_HANDLING ("foo" - "Dupe!"); /* duplicate */ - - /* gContact:directoryServer */ - TEST_XML_ERROR_HANDLING (""); /* missing content */ - TEST_XML_ERROR_HANDLING ("foo" - "Dupe!"); /* duplicate */ - - /* gContact:gender */ - TEST_XML_ERROR_HANDLING (""); /* missing content */ - TEST_XML_ERROR_HANDLING (""); /* duplicate */ - - /* gContact:initials */ - TEST_XML_ERROR_HANDLING (""); /* missing content */ - TEST_XML_ERROR_HANDLING ("AB"); /* duplicate */ - - /* gContact:maidenName */ - TEST_XML_ERROR_HANDLING (""); /* missing content */ - TEST_XML_ERROR_HANDLING ("AB"); /* duplicate */ - - /* gContact:mileage */ - TEST_XML_ERROR_HANDLING (""); /* missing content */ - TEST_XML_ERROR_HANDLING ("12 mi12 mi"); /* duplicate */ - - /* gContact:occupation */ - TEST_XML_ERROR_HANDLING (""); /* missing content */ - TEST_XML_ERROR_HANDLING ("FooBar"); /* duplicate */ - - /* gContact:priority */ - TEST_XML_ERROR_HANDLING (""); /* missing rel param */ - TEST_XML_ERROR_HANDLING (""); /* empty rel param */ - TEST_XML_ERROR_HANDLING (""); /* duplicate */ - - /* gContact:sensitivity */ - TEST_XML_ERROR_HANDLING (""); /* missing rel param */ - TEST_XML_ERROR_HANDLING (""); /* empty rel param */ - TEST_XML_ERROR_HANDLING (""); /* duplicate */ - - /* gContact:shortName */ - TEST_XML_ERROR_HANDLING (""); /* missing content */ - TEST_XML_ERROR_HANDLING ("FooBar"); /* duplicate */ - - /* gContact:subject */ - TEST_XML_ERROR_HANDLING (""); /* missing content */ - TEST_XML_ERROR_HANDLING ("FooBar"); /* duplicate */ - - /* gContact:jot */ - TEST_XML_ERROR_HANDLING (""); - - /* gContact:relation */ - TEST_XML_ERROR_HANDLING (""); - - /* gContact:website errors are ignored (see bgo#790671) */ - - /* gContact:event */ - TEST_XML_ERROR_HANDLING (""); - - /* gContact:calendar */ - TEST_XML_ERROR_HANDLING (""); - - /* gContact:externalId */ - TEST_XML_ERROR_HANDLING (""); - - /* gContact:language */ - TEST_XML_ERROR_HANDLING (""); - - /* gContact:hobby */ - TEST_XML_ERROR_HANDLING (""); - -#undef TEST_XML_ERROR_HANDLING -} - -static void -test_group_properties (void) -{ - GDataContactsGroup *group; - gint64 time_val; - GHashTable *properties; - gint64 edited; - gboolean deleted; - gchar *system_group_id; - - group = gdata_contacts_group_new (NULL); - - /* Check the kind is present and correct */ - g_assert (GDATA_IS_CONTACTS_GROUP (group)); - gdata_test_compare_kind (GDATA_ENTRY (group), "http://schemas.google.com/contact/2008#group", NULL); - - /* Set various properties */ - gdata_entry_set_title (GDATA_ENTRY (group), "New Group!"); - g_assert (gdata_contacts_group_set_extended_property (group, "foobar", "barfoo") == TRUE); - - /* Check various properties */ - time_val = g_get_real_time () / G_USEC_PER_SEC; - g_assert_cmpint (gdata_contacts_group_get_edited (group), ==, time_val); - g_assert (gdata_contacts_group_is_deleted (group) == FALSE); - g_assert (gdata_contacts_group_get_system_group_id (group) == NULL); - - properties = gdata_contacts_group_get_extended_properties (group); - g_assert (properties != NULL); - g_assert_cmpint (g_hash_table_size (properties), ==, 1); - g_assert_cmpstr (gdata_contacts_group_get_extended_property (group, "foobar"), ==, "barfoo"); - - /* Check the properties a different way */ - g_object_get (G_OBJECT (group), - "edited", &edited, - "deleted", &deleted, - "system-group-id", &system_group_id, - NULL); - - g_assert_cmpint (edited, ==, time_val); - g_assert (deleted == FALSE); - g_assert (system_group_id == NULL); - - g_free (system_group_id); - - /* Check the XML */ - gdata_test_assert_xml (group, - "" - "" - "New Group!" - "New Group!" - "" - "barfoo" - ""); - - g_object_unref (group); -} - -static void -test_group_parser_normal (void) -{ - GDataContactsGroup *group; - GHashTable *properties; - GError *error = NULL; - - group = GDATA_CONTACTS_GROUP (gdata_parsable_new_from_xml (GDATA_TYPE_CONTACTS_GROUP, - "" - "" - "http://www.google.com/feeds/groups/jo%40gmail.com/base/1234" - "2005-01-18T21:00:00Z" - "2006-01-01T00:00:00Z" - "2006-01-01T00:00:00Z" - "Salsa class members" - "" - "" - "" - "Some text." - "" - "Foobar." - "" - "" - "", -1, &error)); - g_assert_no_error (error); - g_assert (GDATA_IS_CONTACTS_GROUP (group)); - gdata_test_compare_kind (GDATA_ENTRY (group), "http://schemas.google.com/contact/2008#group", NULL); - g_clear_error (&error); - - g_assert_cmpint (gdata_contacts_group_get_edited (group), ==, 1136073600); - g_assert (gdata_contacts_group_is_deleted (group) == TRUE); - g_assert (gdata_contacts_group_get_system_group_id (group) == NULL); - - g_assert_cmpstr (gdata_contacts_group_get_extended_property (group, "more info"), ==, "Some text."); - g_assert_cmpstr (gdata_contacts_group_get_extended_property (group, "extra info"), ==, "Foobar."); - - properties = gdata_contacts_group_get_extended_properties (group); - g_assert_cmpint (g_hash_table_size (properties), ==, 2); - - g_object_unref (group); -} - -static void -test_group_parser_system (void) -{ - GDataContactsGroup *group; - GError *error = NULL; - - group = GDATA_CONTACTS_GROUP (gdata_parsable_new_from_xml (GDATA_TYPE_CONTACTS_GROUP, - "" - "" - "http://www.google.com/feeds/groups/jo%40gmail.com/base/1234" - "2005-01-18T21:00:00Z" - "2006-01-01T00:00:00Z" - "2006-01-01T00:00:00Z" - "Salsa class members" - "" - "" - "" - "" - "", -1, &error)); - g_assert_no_error (error); - g_assert (GDATA_IS_CONTACTS_GROUP (group)); - gdata_test_compare_kind (GDATA_ENTRY (group), "http://schemas.google.com/contact/2008#group", NULL); - g_clear_error (&error); - - g_assert_cmpint (gdata_contacts_group_get_edited (group), ==, 1136073600); - g_assert (gdata_contacts_group_is_deleted (group) == FALSE); - g_assert_cmpstr (gdata_contacts_group_get_system_group_id (group), ==, GDATA_CONTACTS_GROUP_CONTACTS); - - g_object_unref (group); -} - -static void -test_group_parser_error_handling (void) -{ - GDataContactsGroup *group; - GError *error = NULL; - -#define TEST_XML_ERROR_HANDLING(x) \ - group = GDATA_CONTACTS_GROUP (gdata_parsable_new_from_xml (GDATA_TYPE_CONTACTS_GROUP,\ - ""\ - x\ - "", -1, &error));\ - g_assert_error (error, GDATA_SERVICE_ERROR, GDATA_SERVICE_ERROR_PROTOCOL_ERROR);\ - g_assert (group == NULL);\ - g_clear_error (&error) - - /* app:edited */ - TEST_XML_ERROR_HANDLING ("this shouldn't parse"); - - /* gd:deleted */ - TEST_XML_ERROR_HANDLING (""); - - /* gd:extendedProperty */ - TEST_XML_ERROR_HANDLING (""); - - /* gContact:systemGroup */ - TEST_XML_ERROR_HANDLING (""); - TEST_XML_ERROR_HANDLING (""); - -#undef TEST_XML_ERROR_HANDLING -} - -static void -test_photo_has_photo (gconstpointer service) -{ - GDataContactsContact *contact; - gsize length = 0; - gchar *content_type = NULL; - GError *error = NULL; - - contact = GDATA_CONTACTS_CONTACT (gdata_parsable_new_from_xml (GDATA_TYPE_CONTACTS_CONTACT, - "" - "http://www.google.com/m8/feeds/contacts/libgdata.test@googlemail.com/base/1b46cdd20bfbee3b" - "2009-04-25T15:21:53.688Z" - "" - "" /* Here's where it all went wrong */ - "" - "", -1, &error)); - g_assert_no_error (error); - g_assert (GDATA_IS_CONTACTS_CONTACT (contact)); - gdata_test_compare_kind (GDATA_ENTRY (contact), "http://schemas.google.com/contact/2008#contact", NULL); - g_clear_error (&error); - - /* Check for no photo */ - g_assert (gdata_contacts_contact_get_photo_etag (contact) == NULL); - g_assert (gdata_contacts_contact_get_photo (contact, GDATA_CONTACTS_SERVICE (service), &length, &content_type, NULL, &error) == NULL); - g_assert_cmpint (length, ==, 0); - g_assert (content_type == NULL); - g_assert_no_error (error); - - g_clear_error (&error); - g_free (content_type); - g_object_unref (contact); - - /* Try again with a photo */ - contact = GDATA_CONTACTS_CONTACT (gdata_parsable_new_from_xml (GDATA_TYPE_CONTACTS_CONTACT, - "" - "http://www.google.com/m8/feeds/contacts/libgdata.test@googlemail.com/base/1b46cdd20bfbee3b" - "2009-04-25T15:21:53.688Z" - "" - "" /* Here's where it all went wrong */ - "" - "", -1, &error)); - g_assert_no_error (error); - g_assert (GDATA_IS_CONTACTS_CONTACT (contact)); - gdata_test_compare_kind (GDATA_ENTRY (contact), "http://schemas.google.com/contact/2008#contact", NULL); - g_clear_error (&error); - - g_assert (gdata_contacts_contact_get_photo_etag (contact) != NULL); - g_object_unref (contact); -} - -static void -test_photo_add (TempContactData *data, gconstpointer service) -{ - guint8 *photo_data; - gsize length; - gboolean retval; - gchar *path = NULL; - GError *error = NULL; - - gdata_test_mock_server_start_trace (mock_server, "photo-add"); - - /* Get the photo */ - path = g_test_build_filename (G_TEST_DIST, "photo.jpg", NULL); - g_assert (g_file_get_contents (path, (gchar**) &photo_data, &length, NULL) == TRUE); - g_free (path); - - /* Add it to the contact */ - retval = gdata_contacts_contact_set_photo (data->contact, GDATA_CONTACTS_SERVICE (service), photo_data, length, "image/jpeg", NULL, &error); - g_assert_no_error (error); - g_assert (retval == TRUE); - - g_clear_error (&error); - g_free (photo_data); - - uhm_server_end_trace (mock_server); -} - -GDATA_ASYNC_TEST_FUNCTIONS (photo_add, TempContactData, -G_STMT_START { - guint8 *photo_data; - gsize length; - gchar *path = NULL; - - /* Get the photo */ - path = g_test_build_filename (G_TEST_DIST, "photo.jpg", NULL); - g_assert (g_file_get_contents (path, (gchar**) &photo_data, &length, NULL) == TRUE); - g_free (path); - - /* Add it to the contact asynchronously */ - gdata_contacts_contact_set_photo_async (data->contact, GDATA_CONTACTS_SERVICE (service), photo_data, length, "image/jpeg", cancellable, - async_ready_callback, async_data); - - g_free (photo_data); -} G_STMT_END, -G_STMT_START { - GDataContactsContact *contact = GDATA_CONTACTS_CONTACT (obj); - gboolean success; - - success = gdata_contacts_contact_set_photo_finish (contact, async_result, &error); - - if (error == NULL) { - g_assert (success == TRUE); - g_assert (gdata_contacts_contact_get_photo_etag (contact) != NULL); - } else { - g_assert (success == FALSE); - /*g_assert (gdata_contacts_contact_get_photo_etag (contact) == NULL);*/ - - /* Bail out on a conflict error, since it means the addition went through - * (but not fast enough for libgdata to return success rather than cancellation). */ - if (g_error_matches (error, GDATA_SERVICE_ERROR, GDATA_SERVICE_ERROR_CONFLICT) == TRUE) { - g_clear_error (&error); - async_data->cancellation_successful = FALSE; - } - } -} G_STMT_END); - -static void -add_photo_to_contact (GDataContactsService *service, GDataContactsContact **contact) -{ - guint8 *photo_data; - gsize length; - GDataEntry *updated_contact; - gchar *path = NULL; - - /* Get the photo and add it to the contact */ - path = g_test_build_filename (G_TEST_DIST, "photo.jpg", NULL); - g_assert (g_file_get_contents (path, (gchar**) &photo_data, &length, NULL) == TRUE); - g_assert (gdata_contacts_contact_set_photo (*contact, service, photo_data, length, "image/jpeg", NULL, NULL) == TRUE); - - g_free (path); - g_free (photo_data); - - /* HACK: It fairly consistently seems to take the Google servers about 4 seconds to process uploaded photos. Before this - * time, a query for the photo will return an error. So let's wait for 10. - * Helps: bgo#679072 */ - if (uhm_server_get_enable_online (mock_server) == TRUE) { - sleep (10); - } - - /* Re-query for the contact to get any updated ETags. */ - updated_contact = gdata_service_query_single_entry (GDATA_SERVICE (service), gdata_contacts_service_get_primary_authorization_domain (), - gdata_entry_get_id (GDATA_ENTRY (*contact)), NULL, GDATA_TYPE_CONTACTS_CONTACT, - NULL, NULL); - g_assert (GDATA_IS_CONTACTS_CONTACT (updated_contact)); - - g_object_unref (*contact); - *contact = GDATA_CONTACTS_CONTACT (updated_contact); -} - -typedef TempContactData TempContactWithPhotoData; - -static void -set_up_temp_contact_with_photo (TempContactWithPhotoData *data, gconstpointer service) -{ - set_up_temp_contact ((TempContactData*) data, service); - - gdata_test_mock_server_start_trace (mock_server, "setup-temp-contact-with-photo"); - add_photo_to_contact (GDATA_CONTACTS_SERVICE (service), &data->contact); - uhm_server_end_trace (mock_server); -} - -static void -tear_down_temp_contact_with_photo (TempContactWithPhotoData *data, gconstpointer service) -{ - tear_down_temp_contact ((TempContactData*) data, service); -} - -GDATA_ASYNC_CLOSURE_FUNCTIONS (temp_contact_with_photo, TempContactWithPhotoData); - -static void -test_photo_get (TempContactData *data, gconstpointer service) -{ - guint8 *photo_data; - gchar *content_type = NULL; - gsize length = 0; - GError *error = NULL; - - gdata_test_mock_server_start_trace (mock_server, "photo-get"); - - g_assert (gdata_contacts_contact_get_photo_etag (data->contact) != NULL); - - /* Get the photo from the network */ - photo_data = gdata_contacts_contact_get_photo (data->contact, GDATA_CONTACTS_SERVICE (service), &length, &content_type, NULL, &error); - g_assert_no_error (error); - g_assert (photo_data != NULL); - g_assert (length != 0); - g_assert_cmpstr (content_type, ==, "image/jpeg"); - - g_assert (gdata_contacts_contact_get_photo_etag (data->contact) != NULL); - - g_free (content_type); - g_free (photo_data); - g_clear_error (&error); - - uhm_server_end_trace (mock_server); -} - -GDATA_ASYNC_TEST_FUNCTIONS (photo_get, TempContactData, -G_STMT_START { - g_assert (gdata_contacts_contact_get_photo_etag (data->contact) != NULL); - - /* Get the photo from the network asynchronously */ - gdata_contacts_contact_get_photo_async (data->contact, GDATA_CONTACTS_SERVICE (service), cancellable, async_ready_callback, async_data); -} G_STMT_END, -G_STMT_START { - GDataContactsContact *contact = GDATA_CONTACTS_CONTACT (obj); - guint8 *photo_data; - gsize length; - gchar *content_type; - - /* Finish getting the photo */ - photo_data = gdata_contacts_contact_get_photo_finish (contact, async_result, &length, &content_type, &error); - - if (error == NULL) { - g_assert (photo_data != NULL); - g_assert (length != 0); - g_assert_cmpstr (content_type, ==, "image/jpeg"); - - g_assert (gdata_contacts_contact_get_photo_etag (contact) != NULL); - } else { - g_assert (photo_data == NULL); - g_assert (length == 0); - g_assert (content_type == NULL); - } - - g_free (content_type); - g_free (photo_data); -} G_STMT_END); - -static void -test_photo_delete (TempContactData *data, gconstpointer service) -{ - GError *error = NULL; - - gdata_test_mock_server_start_trace (mock_server, "photo-delete"); - - g_assert (gdata_contacts_contact_get_photo_etag (data->contact) != NULL); - - /* Remove the contact's photo */ - g_assert (gdata_contacts_contact_set_photo (data->contact, GDATA_CONTACTS_SERVICE (service), NULL, 0, NULL, NULL, &error) == TRUE); - g_assert_no_error (error); - - g_assert (gdata_contacts_contact_get_photo_etag (data->contact) == NULL); - - g_clear_error (&error); - - uhm_server_end_trace (mock_server); -} - -static void -test_photo_delete_async_cancellation (GDataAsyncTestData *data, - gconstpointer service) __attribute__((unused)); - -GDATA_ASYNC_TEST_FUNCTIONS (photo_delete, TempContactData, -G_STMT_START { - g_assert (gdata_contacts_contact_get_photo_etag (data->contact) != NULL); - - /* Delete it from the contact asynchronously */ - gdata_contacts_contact_set_photo_async (data->contact, GDATA_CONTACTS_SERVICE (service), NULL, 0, NULL, cancellable, - async_ready_callback, async_data); -} G_STMT_END, -G_STMT_START { - GDataContactsContact *contact = GDATA_CONTACTS_CONTACT (obj); - gboolean success; - - success = gdata_contacts_contact_set_photo_finish (contact, async_result, &error); - - if (error == NULL) { - g_assert (success == TRUE); - g_assert (gdata_contacts_contact_get_photo_etag (contact) == NULL); - } else { - g_assert (success == FALSE); - g_assert (gdata_contacts_contact_get_photo_etag (contact) != NULL); - } -} G_STMT_END); - -static void -test_batch (gconstpointer service) -{ - GDataBatchOperation *operation; - GDataService *service2; - GDataContactsContact *contact, *contact2, *contact3; - GDataEntry *inserted_entry, *inserted_entry2, *inserted_entry3; - gchar *feed_uri; - guint op_id, op_id2, op_id3; - GError *error = NULL, *entry_error = NULL; - - gdata_test_mock_server_start_trace (mock_server, "batch"); - - /* Here we hardcode the feed URI, but it should really be extracted from a contacts feed, as the GDATA_LINK_BATCH link */ - operation = gdata_batchable_create_operation (GDATA_BATCHABLE (service), gdata_contacts_service_get_primary_authorization_domain (), - "https://www.google.com/m8/feeds/contacts/default/full/batch"); - - /* Check the properties of the operation */ - g_assert (gdata_batch_operation_get_service (operation) == service); - g_assert_cmpstr (gdata_batch_operation_get_feed_uri (operation), ==, "https://www.google.com/m8/feeds/contacts/default/full/batch"); - - g_object_get (operation, - "service", &service2, - "feed-uri", &feed_uri, - NULL); - - g_assert (service2 == service); - g_assert_cmpstr (feed_uri, ==, "https://www.google.com/m8/feeds/contacts/default/full/batch"); - - g_object_unref (service2); - g_free (feed_uri); - - /* Run a singleton batch operation to insert a new entry */ - contact = gdata_contacts_contact_new (NULL); - gdata_entry_set_title (GDATA_ENTRY (contact), "Fooish Bar"); - - gdata_test_batch_operation_insertion (operation, GDATA_ENTRY (contact), &inserted_entry, NULL); - g_assert (gdata_test_batch_operation_run (operation, NULL, &error) == TRUE); - g_assert_no_error (error); - - g_clear_error (&error); - g_object_unref (operation); - g_object_unref (contact); - - /* Run another batch operation to insert another entry and query the previous one */ - contact2 = gdata_contacts_contact_new (NULL); - gdata_entry_set_title (GDATA_ENTRY (contact2), "Brian"); - - operation = gdata_batchable_create_operation (GDATA_BATCHABLE (service), gdata_contacts_service_get_primary_authorization_domain (), - "https://www.google.com/m8/feeds/contacts/default/full/batch"); - op_id = gdata_test_batch_operation_insertion (operation, GDATA_ENTRY (contact2), &inserted_entry2, NULL); - op_id2 = gdata_test_batch_operation_query (operation, gdata_entry_get_id (inserted_entry), GDATA_TYPE_CONTACTS_CONTACT, inserted_entry, NULL, - NULL); - g_assert_cmpuint (op_id, !=, op_id2); - - g_assert (gdata_test_batch_operation_run (operation, NULL, &error) == TRUE); - g_assert_no_error (error); - - g_clear_error (&error); - g_object_unref (operation); - g_object_unref (contact2); - - /* Run another batch operation to delete the first entry and a fictitious one to test error handling, and update the second entry */ - gdata_entry_set_title (inserted_entry2, "Toby"); - contact3 = gdata_contacts_contact_new ("foobar"); - - operation = gdata_batchable_create_operation (GDATA_BATCHABLE (service), gdata_contacts_service_get_primary_authorization_domain (), - "https://www.google.com/m8/feeds/contacts/default/full/batch"); - op_id = gdata_test_batch_operation_deletion (operation, inserted_entry, NULL); - op_id2 = gdata_test_batch_operation_deletion (operation, GDATA_ENTRY (contact3), &entry_error); - op_id3 = gdata_test_batch_operation_update (operation, inserted_entry2, &inserted_entry3, NULL); - g_assert_cmpuint (op_id, !=, op_id2); - g_assert_cmpuint (op_id, !=, op_id3); - g_assert_cmpuint (op_id2, !=, op_id3); - - g_assert (gdata_test_batch_operation_run (operation, NULL, &error) == TRUE); - g_assert_no_error (error); - - g_assert_error (entry_error, GDATA_SERVICE_ERROR, GDATA_SERVICE_ERROR_PROTOCOL_ERROR); - - g_clear_error (&error); - g_clear_error (&entry_error); - g_object_unref (operation); - g_object_unref (inserted_entry); - g_object_unref (contact3); - - /* Run another batch operation to update the second entry with the wrong ETag (i.e. pass the old version of the entry to the batch operation - * to test error handling */ -#if 0 - operation = gdata_batchable_create_operation (GDATA_BATCHABLE (service), gdata_contacts_service_get_primary_authorization_domain (), - "https://www.google.com/m8/feeds/contacts/default/full/batch"); - gdata_test_batch_operation_update (operation, inserted_entry2, NULL, &entry_error); - g_assert (gdata_test_batch_operation_run (operation, NULL, &error) == TRUE); - g_assert_no_error (error); - - g_assert_error (entry_error, GDATA_SERVICE_ERROR, GDATA_SERVICE_ERROR_CONFLICT); -#endif - g_clear_error (&error); - g_clear_error (&entry_error); -/* g_object_unref (operation);*/ - g_object_unref (inserted_entry2); - - /* Run a final batch operation to delete the second entry */ -/* operation = gdata_batchable_create_operation (GDATA_BATCHABLE (service), gdata_contacts_service_get_primary_authorization_domain (), - "https://www.google.com/m8/feeds/contacts/default/full/batch"); - gdata_test_batch_operation_deletion (operation, inserted_entry3, NULL); - g_assert (gdata_test_batch_operation_run (operation, NULL, &error) == TRUE); - g_assert_no_error (error); -*/ - g_clear_error (&error); - /*g_object_unref (operation);*/ - g_object_unref (inserted_entry3); - - uhm_server_end_trace (mock_server); -} - -typedef struct { - GDataContactsContact *new_contact; -} BatchAsyncData; - -static void -setup_batch_async (BatchAsyncData *data, gconstpointer service) -{ - GDataContactsContact *contact; - GError *error = NULL; - - gdata_test_mock_server_start_trace (mock_server, "setup-batch-async"); - - /* Insert a new contact which we can query asyncly */ - contact = gdata_contacts_contact_new (NULL); - gdata_entry_set_title (GDATA_ENTRY (contact), "Fooish Bar"); - - data->new_contact = gdata_contacts_service_insert_contact (GDATA_CONTACTS_SERVICE (service), contact, NULL, &error); - g_assert_no_error (error); - g_assert (GDATA_IS_CONTACTS_CONTACT (data->new_contact)); - g_clear_error (&error); - - g_object_unref (contact); - - uhm_server_end_trace (mock_server); -} - -static void -test_batch_async_cb (GDataBatchOperation *operation, GAsyncResult *async_result, GMainLoop *main_loop) -{ - GError *error = NULL; - - /* Clear all pending events (such as callbacks for the operations) */ - while (g_main_context_iteration (NULL, FALSE) == TRUE); - - g_assert (gdata_test_batch_operation_run_finish (operation, async_result, &error) == TRUE); - g_assert_no_error (error); - g_clear_error (&error); - - g_main_loop_quit (main_loop); -} - -static void -test_batch_async (BatchAsyncData *data, gconstpointer service) -{ - GDataBatchOperation *operation; - GMainLoop *main_loop; - - gdata_test_mock_server_start_trace (mock_server, "batch-async"); - - /* Run an async query operation on the contact */ - operation = gdata_batchable_create_operation (GDATA_BATCHABLE (service), gdata_contacts_service_get_primary_authorization_domain (), - "https://www.google.com/m8/feeds/contacts/default/full/batch"); - gdata_test_batch_operation_query (operation, gdata_entry_get_id (GDATA_ENTRY (data->new_contact)), GDATA_TYPE_CONTACTS_CONTACT, - GDATA_ENTRY (data->new_contact), NULL, NULL); - - main_loop = g_main_loop_new (NULL, TRUE); - - gdata_batch_operation_run_async (operation, NULL, (GAsyncReadyCallback) test_batch_async_cb, main_loop); - g_main_loop_run (main_loop); - - g_main_loop_unref (main_loop); - g_object_unref (operation); - - uhm_server_end_trace (mock_server); -} - -static void -test_batch_async_cancellation_cb (GDataBatchOperation *operation, GAsyncResult *async_result, GMainLoop *main_loop) -{ - GError *error = NULL; - - /* Clear all pending events (such as callbacks for the operations) */ - while (g_main_context_iteration (NULL, FALSE) == TRUE); - - g_assert (gdata_test_batch_operation_run_finish (operation, async_result, &error) == FALSE); - g_assert_error (error, G_IO_ERROR, G_IO_ERROR_CANCELLED); - g_clear_error (&error); - - g_main_loop_quit (main_loop); -} - -static void -test_batch_async_cancellation (BatchAsyncData *data, gconstpointer service) -{ - GDataBatchOperation *operation; - GMainLoop *main_loop; - GCancellable *cancellable; - GError *error = NULL; - - gdata_test_mock_server_start_trace (mock_server, "batch-async-cancellation"); - - /* Run an async query operation on the contact */ - operation = gdata_batchable_create_operation (GDATA_BATCHABLE (service), gdata_contacts_service_get_primary_authorization_domain (), - "https://www.google.com/m8/feeds/contacts/default/full/batch"); - gdata_test_batch_operation_query (operation, gdata_entry_get_id (GDATA_ENTRY (data->new_contact)), GDATA_TYPE_CONTACTS_CONTACT, - GDATA_ENTRY (data->new_contact), NULL, &error); - - main_loop = g_main_loop_new (NULL, TRUE); - cancellable = g_cancellable_new (); - - gdata_batch_operation_run_async (operation, cancellable, (GAsyncReadyCallback) test_batch_async_cancellation_cb, main_loop); - g_cancellable_cancel (cancellable); /* this should cancel the operation before it even starts, as we haven't run the main loop yet */ - - g_main_loop_run (main_loop); - - g_assert_error (error, G_IO_ERROR, G_IO_ERROR_CANCELLED); - g_clear_error (&error); - - g_main_loop_unref (main_loop); - g_object_unref (cancellable); - g_object_unref (operation); - - uhm_server_end_trace (mock_server); -} - -static void -teardown_batch_async (BatchAsyncData *data, gconstpointer service) -{ - GError *error = NULL; - - gdata_test_mock_server_start_trace (mock_server, "teardown-batch-async"); - - /* Delete the contact */ - g_assert (gdata_service_delete_entry (GDATA_SERVICE (service), gdata_contacts_service_get_primary_authorization_domain (), - GDATA_ENTRY (data->new_contact), NULL, &error) == TRUE); - g_assert_no_error (error); - g_clear_error (&error); - - g_object_unref (data->new_contact); - - uhm_server_end_trace (mock_server); -} - -static void -test_group_membership (void) -{ - GDataContactsContact *contact; - GList *groups; - - /* Create a new contact with no groups */ - contact = gdata_contacts_contact_new (NULL); - g_assert (GDATA_IS_CONTACTS_CONTACT (contact)); - g_assert (gdata_contacts_contact_get_groups (contact) == NULL); - g_assert (gdata_contacts_contact_is_group_deleted (contact, "http://notagroup.com/") == FALSE); - - /* Add a group */ - gdata_contacts_contact_add_group (contact, "http://foo.com/group1"); - g_assert (gdata_contacts_contact_is_group_deleted (contact, "http://foo.com/group1") == FALSE); - - groups = gdata_contacts_contact_get_groups (contact); - g_assert_cmpint (g_list_length (groups), ==, 1); - g_assert_cmpstr (groups->data, ==, "http://foo.com/group1"); - - /* Add another group */ - gdata_contacts_contact_add_group (contact, "http://foo.com/group2"); - g_assert (gdata_contacts_contact_is_group_deleted (contact, "http://foo.com/group1") == FALSE); - g_assert (gdata_contacts_contact_is_group_deleted (contact, "http://foo.com/group2") == FALSE); - - groups = gdata_contacts_contact_get_groups (contact); - g_assert_cmpint (g_list_length (groups), ==, 2); - if (strcmp (groups->data, "http://foo.com/group1") == 0) - g_assert_cmpstr (groups->next->data, ==, "http://foo.com/group2"); - else if (strcmp (groups->data, "http://foo.com/group2") == 0) - g_assert_cmpstr (groups->next->data, ==, "http://foo.com/group1"); - else - g_assert_not_reached (); - - /* Remove the first group */ - gdata_contacts_contact_remove_group (contact, "http://foo.com/group1"); - g_assert (gdata_contacts_contact_is_group_deleted (contact, "http://foo.com/group1") == FALSE); /* hasn't been propagated to the server */ - - groups = gdata_contacts_contact_get_groups (contact); - g_assert_cmpint (g_list_length (groups), ==, 1); - g_assert_cmpstr (groups->data, ==, "http://foo.com/group2"); - - g_object_unref (contact); -} - -static void -test_contact_id (void) -{ - GDataContactsContact *contact; - GError *error = NULL; - - /* Check that IDs are changed to the full projection when creating a new contact… */ - contact = gdata_contacts_contact_new ("http://www.google.com/m8/feeds/contacts/libgdata.test@googlemail.com/base/1b46cdd20bfbee3b"); - g_assert_cmpstr (gdata_entry_get_id (GDATA_ENTRY (contact)), ==, - "http://www.google.com/m8/feeds/contacts/libgdata.test@googlemail.com/full/1b46cdd20bfbee3b"); - g_object_unref (contact); - - /* …and when creating one from XML. */ - contact = GDATA_CONTACTS_CONTACT (gdata_parsable_new_from_xml (GDATA_TYPE_CONTACTS_CONTACT, - "" - "http://www.google.com/m8/feeds/contacts/libgdata.test@googlemail.com/base/1b46cdd20bfbee3b" - "2009-04-25T15:21:53.688Z" - "" - "Foobar" - "", -1, &error)); - g_assert_no_error (error); - g_assert (GDATA_IS_CONTACTS_CONTACT (contact)); - g_clear_error (&error); - - g_assert_cmpstr (gdata_entry_get_id (GDATA_ENTRY (contact)), ==, - "http://www.google.com/m8/feeds/contacts/libgdata.test@googlemail.com/full/1b46cdd20bfbee3b"); - - g_object_unref (contact); -} - -static void -mock_server_notify_resolver_cb (GObject *object, GParamSpec *pspec, gpointer user_data) -{ - UhmServer *server; - UhmResolver *resolver; - - server = UHM_SERVER (object); - - /* Set up the expected domain names here. This should technically be split up between - * the different unit test suites, but that's too much effort. */ - resolver = uhm_server_get_resolver (server); - - if (resolver != NULL) { - const gchar *ip_address = uhm_server_get_address (server); - - uhm_resolver_add_A (resolver, "www.google.com", ip_address); - uhm_resolver_add_A (resolver, - "accounts.google.com", ip_address); - } -} - -/* Set up a global GDataAuthorizer to be used for all the tests. Unfortunately, - * the Google Contacts API is effectively limited to OAuth2 - * authorisation, so this requires user interaction when online. - * - * If not online, use a dummy authoriser. */ -static GDataAuthorizer * -create_global_authorizer (void) -{ - GDataOAuth2Authorizer *authorizer = NULL; /* owned */ - gchar *authentication_uri, *authorisation_code; - GError *error = NULL; - - /* If not online, just return a dummy authoriser. */ - if (!uhm_server_get_enable_online (mock_server)) { - return GDATA_AUTHORIZER (gdata_dummy_authorizer_new (GDATA_TYPE_CONTACTS_SERVICE)); - } - - /* Otherwise, go through the interactive OAuth dance. */ - gdata_test_mock_server_start_trace (mock_server, "global-authentication"); - authorizer = gdata_oauth2_authorizer_new (CLIENT_ID, CLIENT_SECRET, - REDIRECT_URI, - GDATA_TYPE_CONTACTS_SERVICE); - - /* Get an authentication URI */ - authentication_uri = gdata_oauth2_authorizer_build_authentication_uri (authorizer, NULL, FALSE); - g_assert (authentication_uri != NULL); - - /* Get the authorisation code off the user. */ - authorisation_code = gdata_test_query_user_for_verifier (authentication_uri); - - g_free (authentication_uri); - - if (authorisation_code == NULL) { - /* Skip tests. */ - g_object_unref (authorizer); - authorizer = NULL; - goto skip_test; - } - - /* Authorise the token */ - g_assert (gdata_oauth2_authorizer_request_authorization (authorizer, authorisation_code, NULL, &error)); - g_assert_no_error (error); - -skip_test: - g_free (authorisation_code); - - uhm_server_end_trace (mock_server); - - return GDATA_AUTHORIZER (authorizer); -} - -int -main (int argc, char *argv[]) -{ - gint retval; - GDataAuthorizer *authorizer = NULL; /* owned */ - GDataService *service = NULL; /* owned */ - GFile *trace_directory = NULL; /* owned */ - gchar *path = NULL; /* owned */ - - gdata_test_init (argc, argv); - - mock_server = gdata_test_get_mock_server (); - g_signal_connect (G_OBJECT (mock_server), "notify::resolver", - (GCallback) mock_server_notify_resolver_cb, NULL); - path = g_test_build_filename (G_TEST_DIST, "traces/contacts", NULL); - trace_directory = g_file_new_for_path (path); - g_free (path); - uhm_server_set_trace_directory (mock_server, trace_directory); - g_object_unref (trace_directory); - - authorizer = create_global_authorizer (); - service = GDATA_SERVICE (gdata_contacts_service_new (authorizer)); - - g_test_add_func ("/contacts/authentication", test_authentication); - - g_test_add ("/contacts/contact/insert", InsertData, service, set_up_insert, test_contact_insert, tear_down_insert); - g_test_add ("/contacts/contact/update", TempContactData, service, set_up_temp_contact, test_contact_update, tear_down_temp_contact); - - g_test_add ("/contacts/query/all_contacts", QueryAllContactsData, service, set_up_query_all_contacts, test_query_all_contacts, - tear_down_query_all_contacts); - g_test_add ("/contacts/query/all_contacts/async", GDataAsyncTestData, service, set_up_query_all_contacts_async, - test_query_all_contacts_async, tear_down_query_all_contacts_async); - g_test_add ("/contacts/query/all_contacts/async/progress_closure", QueryAllContactsData, service, - set_up_query_all_contacts, test_query_all_contacts_async_progress_closure, tear_down_query_all_contacts); - g_test_add ("/contacts/query/all_contacts/cancellation", GDataAsyncTestData, service, set_up_query_all_contacts_async, - test_query_all_contacts_async_cancellation, tear_down_query_all_contacts_async); - - g_test_add_data_func ("/contacts/photo/has_photo", service, test_photo_has_photo); - g_test_add ("/contacts/photo/add", TempContactData, service, set_up_temp_contact, test_photo_add, tear_down_temp_contact); - g_test_add ("/contacts/photo/add/async", GDataAsyncTestData, service, set_up_temp_contact_async, test_photo_add_async, - tear_down_temp_contact_async); - g_test_add ("/contacts/photo/add/async/cancellation", GDataAsyncTestData, service, set_up_temp_contact_async, - test_photo_add_async_cancellation, tear_down_temp_contact_async); - g_test_add ("/contacts/photo/get", TempContactData, service, set_up_temp_contact_with_photo, test_photo_get, tear_down_temp_contact); - g_test_add ("/contacts/photo/get/async", GDataAsyncTestData, service, set_up_temp_contact_with_photo_async, test_photo_get_async, - tear_down_temp_contact_with_photo_async); - g_test_add ("/contacts/photo/get/async/cancellation", GDataAsyncTestData, service, set_up_temp_contact_with_photo_async, - test_photo_get_async_cancellation, tear_down_temp_contact_with_photo_async); - - g_test_add ("/contacts/photo/delete", TempContactData, service, set_up_temp_contact_with_photo, test_photo_delete, - tear_down_temp_contact); - g_test_add ("/contacts/photo/delete/async", GDataAsyncTestData, service, set_up_temp_contact_with_photo_async, - test_photo_delete_async, tear_down_temp_contact_with_photo_async); -/* - Too broken to continue running at the moment. - g_test_add ("/contacts/photo/delete/async/cancellation", GDataAsyncTestData, service, set_up_temp_contact_with_photo_async, - test_photo_delete_async_cancellation, tear_down_temp_contact_with_photo_async); -*/ - - g_test_add_data_func ("/contacts/batch", service, test_batch); - g_test_add ("/contacts/batch/async", BatchAsyncData, service, setup_batch_async, test_batch_async, teardown_batch_async); - g_test_add ("/contacts/batch/async/cancellation", BatchAsyncData, service, setup_batch_async, test_batch_async_cancellation, - teardown_batch_async); - - g_test_add ("/contacts/group/query", QueryAllGroupsData, service, set_up_query_all_groups, test_query_all_groups, - tear_down_query_all_groups); - g_test_add ("/contacts/group/query/async", GDataAsyncTestData, service, set_up_query_all_groups_async, - test_query_all_groups_async, tear_down_query_all_groups_async); - g_test_add ("/contacts/group/query/async/progress_closure", QueryAllGroupsData, service, set_up_query_all_groups, - test_query_all_groups_async_progress_closure, tear_down_query_all_groups); - g_test_add ("/contacts/group/query/async/cancellation", GDataAsyncTestData, service, set_up_query_all_groups_async, - test_query_all_groups_async_cancellation, tear_down_query_all_groups_async); - - g_test_add ("/contacts/group/insert", InsertGroupData, service, set_up_insert_group, test_group_insert, tear_down_insert_group); - g_test_add ("/contacts/group/insert/async", GDataAsyncTestData, service, set_up_insert_group_async, test_group_insert_async, - tear_down_insert_group_async); - g_test_add ("/contacts/group/insert/async/cancellation", GDataAsyncTestData, service, set_up_insert_group_async, - test_group_insert_async_cancellation, tear_down_insert_group_async); - - g_test_add_func ("/contacts/contact/properties", test_contact_properties); - g_test_add_func ("/contacts/contact/escaping", test_contact_escaping); - g_test_add_func ("/contacts/contact/parser/minimal", test_contact_parser_minimal); - g_test_add_func ("/contacts/contact/parser/normal", test_contact_parser_normal); - g_test_add_func ("/contacts/contact/parser/error_handling", test_contact_parser_error_handling); - g_test_add_func ("/contacts/contact/id", test_contact_id); - - g_test_add_func ("/contacts/query/uri", test_query_uri); - g_test_add_func ("/contacts/query/etag", test_query_etag); - g_test_add_func ("/contacts/query/properties", test_query_properties); - - g_test_add_func ("/contacts/group/properties", test_group_properties); - g_test_add_func ("/contacts/group/escaping", test_group_escaping); - g_test_add_func ("/contacts/group/parser/normal", test_group_parser_normal); - g_test_add_func ("/contacts/group/parser/system", test_group_parser_system); - g_test_add_func ("/contacts/group/parser/error_handling", test_group_parser_error_handling); - g_test_add_func ("/contacts/group/membership", test_group_membership); - - retval = g_test_run (); - - g_clear_object (&service); - g_clear_object (&authorizer); - - return retval; -} - -G_GNUC_END_IGNORE_DEPRECATIONS diff --git a/gdata/tests/meson.build b/gdata/tests/meson.build index 22648ea8..5717e494 100644 --- a/gdata/tests/meson.build +++ b/gdata/tests/meson.build @@ -17,7 +17,6 @@ tests = { 'authorization': {}, 'buffer': {}, 'calendar': {}, - 'contacts': {}, 'documents': { 'dependencies': [gdk_pixbuf_dep], 'should_fail': true, diff --git a/gdata/tests/traces/contacts/authentication b/gdata/tests/traces/contacts/authentication deleted file mode 100644 index 8698d6b6..00000000 --- a/gdata/tests/traces/contacts/authentication +++ /dev/null @@ -1,35 +0,0 @@ -> POST /o/oauth2/token HTTP/1.1 -> Soup-Debug-Timestamp: 1415489529 -> Soup-Debug: SoupSession 1 (0x15cd370), SoupMessage 1 (0x182f190), SoupSocket 1 (0x18d5b40) -> Host: accounts.google.com -> Content-Type: application/x-www-form-urlencoded -> Accept-Encoding: gzip, deflate -> User-Agent: libgdata/0.17.0 - gzip -> Connection: Keep-Alive -> -> client_id=352818697630-nqu2cmt5quqd6lr17ouoqmb684u84l1f.apps.googleusercontent.com&client_secret=-fA4pHQJxR3zJ-FyAMPQsikg&code=4%2FNua_ECWUtlC6qom7GcJTbcUM_EJPADvfiYd6rsaI2_I.8oJr4XcE9XsaoiIBeO6P2m_S24MjkwI&redirect_uri=urn%3Aietf%3Awg%3Aoauth%3A2.0%3Aoob&grant_type=authorization_code - -< HTTP/1.1 200 OK -< Soup-Debug-Timestamp: 1415489529 -< Soup-Debug: SoupMessage 1 (0x182f190) -< Content-Type: application/json; charset=utf-8 -< Cache-Control: no-cache, no-store, max-age=0, must-revalidate -< Pragma: no-cache -< Expires: Fri, 01 Jan 1990 00:00:00 GMT -< Date: Sat, 08 Nov 2014 23:32:09 GMT -< Content-Disposition: attachment; filename="json.txt"; filename*=UTF-8''json.txt -< Content-Encoding: gzip -< X-Content-Type-Options: nosniff -< X-Frame-Options: SAMEORIGIN -< X-XSS-Protection: 1; mode=block -< Server: GSE -< Alternate-Protocol: 443:quic,p=0.01 -< Transfer-Encoding: chunked -< -< { -< "access_token" : "ya29.uADGgjhB_J0BE91XytCcfZvo9_mpuMXuvZIgekCmnwsm7ibh5nDoFrZg5fsyc8dCR_xSYxaoaD061w", -< "token_type" : "Bearer", -< "expires_in" : 3600, -< "refresh_token" : "1/oPu3xJaZU1U8fZhL9K6ZgvkoisVntA66PE7OuRs3pok" -< } - diff --git a/gdata/tests/traces/contacts/authentication-async b/gdata/tests/traces/contacts/authentication-async deleted file mode 100644 index 09d657bd..00000000 --- a/gdata/tests/traces/contacts/authentication-async +++ /dev/null @@ -1,27 +0,0 @@ -> POST /accounts/ClientLogin HTTP/1.1 -> Soup-Debug-Timestamp: 1375253707 -> Soup-Debug: SoupSession 1 (0x66f500), SoupMessage 1 (0x7d2e60), SoupSocket 1 (0x72a6d0) -> Host: www.google.com -> Content-Type: application/x-www-form-urlencoded -> Accept-Encoding: gzip, deflate -> Connection: Keep-Alive -> -> accountType=HOSTED%5FOR%5FGOOGLE&Email=libgdata%2Etest%40gmail%2Ecom&Passwd=gdata%2Dgdata&service=cp&source=ytapi%2DGNOME%2Dlibgdata%2D444fubtt%2D0 - -< HTTP/1.1 200 OK -< Soup-Debug-Timestamp: 1375253707 -< Soup-Debug: SoupMessage 1 (0x7d2e60) -< Content-Type: text/plain -< Cache-control: no-cache, no-store -< Pragma: no-cache -< Expires: Mon, 01-Jan-1990 00:00:00 GMT -< Date: Wed, 31 Jul 2013 06:55:07 GMT -< X-Content-Type-Options: nosniff -< X-XSS-Protection: 1; mode=block -< Content-Length: 947 -< Server: GSE -< -< SID=DQAAANMAAABLVNYA7llnN5GVblNPXi5xnUpfn_1Nt5rUGq5fgJHP3lGFHSyWeFu8iaAhhTy_IkFR4abU1u0PItdmErKC7BAb4yEUNfBsE_DAJW3QiSX9gsUN9Upn3OGfkWWE9rtc3SuMRRUtVa5uIrI3LFeFpTj-mDugsJ6eLNSXuBX_I2ZXut0cc2cye4-y6sIqgEa6bBitbGbEPUUWUaXzXJUu19acTECE-3-B2krVhb8vfG1AHN5rzSoc1Q_VyilznzxZBPVRfPhJw3Y5IebOCCnZIXPh7WmGG1ZD873sWpj-kpUpcg -< LSID=DQAAANYAAAANiE0kPwbpbCxKR_R7h-ekhx_I6BM74CA7iCX0q8ILYiIGXDhjanJyMF8-YSr48czMnizyxddpEDZQL5v8W6CaLltlzVYSdSEegJ_p9G0_n6dfhQjgn-2d0prbi6g9_KoLs71vaMnTXGma8Honl3n1_cfdI7asujoOns4QUbs4vhk_n9Ag9wJzNjHW5h7dNerxKH4uzqeOMRifAefv3_ZWZdV1jE37C_HM4lrLBkVs4g5Nn7QGbEu4zBRfm6tbUsyGGArm184KaDmtlj56BazwIuMxn2vgWds0PoDaD--qFg -< Auth=DQAAANUAAAANiE0kPwbpbCxKR_R7h-ekhx_I6BM74CA7iCX0q8ILYiIGXDhjanJyMF8-YSr48cy3WO11uK-_KLeoeuvXODGKn-9bqQT-KaNXSV63Iojd-SXaAiAhSaxuNwEGXj5Z7KO_QAebRcA_bmVZzZGO0vjwhBGmnYrukoKPnlexCe2AZeuEyqR-ZY-Hl1JHY3iQ30RK70nlQOM__saeNQYzVz3WzcUjGZQ_0atIQbbOPrlNJvWPUOKBHHVuHDl-TJPvFhdUmvTRCMke4EDhQGxWnq3kfeSnDCzg-OCkD4CAcaOWeQ - diff --git a/gdata/tests/traces/contacts/authentication-async-cancellation b/gdata/tests/traces/contacts/authentication-async-cancellation deleted file mode 100644 index 0b9e2fbd..00000000 --- a/gdata/tests/traces/contacts/authentication-async-cancellation +++ /dev/null @@ -1,27 +0,0 @@ -> POST /accounts/ClientLogin HTTP/1.1 -> Soup-Debug-Timestamp: 1375253708 -> Soup-Debug: SoupSession 1 (0x66f500), SoupMessage 1 (0x7fffe00262a0), SoupSocket 1 (0x7fffe0028190) -> Host: www.google.com -> Content-Type: application/x-www-form-urlencoded -> Accept-Encoding: gzip, deflate -> Connection: Keep-Alive -> -> accountType=HOSTED%5FOR%5FGOOGLE&Email=libgdata%2Etest%40gmail%2Ecom&Passwd=gdata%2Dgdata&service=cp&source=ytapi%2DGNOME%2Dlibgdata%2D444fubtt%2D0 - -< HTTP/1.1 200 OK -< Soup-Debug-Timestamp: 1375253708 -< Soup-Debug: SoupMessage 1 (0x7fffe00262a0) -< Content-Type: text/plain -< Cache-control: no-cache, no-store -< Pragma: no-cache -< Expires: Mon, 01-Jan-1990 00:00:00 GMT -< Date: Wed, 31 Jul 2013 06:55:08 GMT -< X-Content-Type-Options: nosniff -< X-XSS-Protection: 1; mode=block -< Content-Length: 947 -< Server: GSE -< -< SID=DQAAANMAAAAunusdFJGM1KPwpqzc212kxe0mrSl2NxjpDEq5kCraje_aRE5F-vTgUxDFd2J3_7_snxzNa0pX8sGs-NTcnI2d-2q9fGyosn-1M6rPh3qQA8qy42qG0C2HnOOtogVSG4vWM1nI9upHtxzcGSw4npSifFmn1Rxnhv08ZIMjHNJpIfhaCM4fkeSvEsyxn4lFRdXO4xTrtrjhGlTVTG-Dyqw7vq_i-ngOJqNjcxB8Oxx_CwwgVo16TYC88VIyZp5jS_2btuWvoHYmO-fYxCdJVktq_uXbbxPshT32bfNcRxxroQ -< LSID=DQAAANUAAADlUiDDxmgwYEQV4ONy1MTegorp3YgAKT-J--NcNIwz1nJvdKlhFWau_6plMST0IUMr9GoPEokwCv7v3YZnLtK1P7wvqIgdQkP6I22lFNIrINcizDYxO_03NJ0QBVsQ4bFCl_zSdILGLIEtUqeos12Z5RCIbgrYoYG_C4I2OoNH33QfeK4v9eFDgmycbDNIXvIkCVkVkN-UpYw6lgp4M-Mwz6UZ6JM5Ow0mzOXe_X-3ObjimaF0dZhTq4f8eqAvYUIZ9MKtRzfGpMRSnTqR5gC7u0F5aLNY78hcwi2-Jf2gqA -< Auth=DQAAANUAAADlUiDDxmgwYEQV4ONy1MTegorp3YgAKT-J--NcNIwz1nJvdKlhFWau_6plMST0IUMunH-1EPsydhwp7D-n9RF5dIaQg8ezkxVCT2oit_CR7ZIWdyB7LF0F_Nn5fy8S7NWHepGq0pYhHNbCqMUBbr9KWZ6FH_MKT6TmqkrOeWXTuRujoiuv3_F22AIPwJ6coTIyDn5A2FW_YtxU2ZW9mTEbpdFkfwY5MWFoME3wBpxti1C3vVClkEhSr6ZBw5d1Ygiol1jCfzV3BcFtPeHQe6y-A6OAhtDUKb2eeOirjRPr0Q - diff --git a/gdata/tests/traces/contacts/batch b/gdata/tests/traces/contacts/batch deleted file mode 100644 index 1014d9e5..00000000 --- a/gdata/tests/traces/contacts/batch +++ /dev/null @@ -1,242 +0,0 @@ -> POST /m8/feeds/contacts/default/full/batch HTTP/1.1 -> Soup-Debug-Timestamp: 1415490455 -> Soup-Debug: SoupSession 1 (0x1c05240), SoupMessage 1 (0x1ce91c0), SoupSocket 1 (0x1e32c40) -> Host: www.google.com -> Authorization: Bearer ya29.uAB1RRhn3TKLPSfFZeRgrzf68-Gb9tby5F20urDCBwC6B94UqINs1Hvh_iKX3FagPwd0QkLnrSyVRw -> GData-Version: 3 -> Content-Type: application/atom+xml -> Accept-Encoding: gzip, deflate -> User-Agent: libgdata/0.17.0 - gzip -> Connection: Keep-Alive -> -> Batch operation feedbatch12014-11-08T23:47:35ZFooish Bar1Fooish Bar - -< HTTP/1.1 200 OK -< Soup-Debug-Timestamp: 1415490455 -< Soup-Debug: SoupMessage 1 (0x1ce91c0) -< Cache-Control: no-cache, no-store, max-age=0, must-revalidate -< Pragma: no-cache -< Expires: Fri, 01 Jan 1990 00:00:00 GMT -< Date: Sat, 08 Nov 2014 23:47:35 GMT -< Vary: Origin -< Vary: Referer -< Vary: X-Origin -< Content-Type: application/atom+xml; charset=UTF-8 -< X-Content-Type-Options: nosniff -< X-Frame-Options: SAMEORIGIN -< X-XSS-Protection: 1; mode=block -< Server: GSE -< Content-Encoding: gzip -< Alternate-Protocol: 443:quic,p=0.01 -< Transfer-Encoding: chunked -< -< -< -< https://www.google.com/m8/feeds/contacts/libgdata.test%40googlemail.com/full/batch/1415490455683000 -< 2014-11-08T23:47:35.683Z -< Batch operation feed -< -< 1 -< -< -< http://www.google.com/m8/feeds/contacts/libgdata.test%40googlemail.com/base/124aa0c708271161 -< 2014-11-08T23:47:35.557Z -< 2014-11-08T23:47:35.557Z -< -< Fooish Bar -< -< -< -< -< Fooish Bar -< Fooish -< Bar -< -< -< - -> POST /m8/feeds/contacts/default/full/batch HTTP/1.1 -> Soup-Debug-Timestamp: 1415490455 -> Soup-Debug: SoupSession 1 (0x1c05240), SoupMessage 2 (0x1ce92b0), SoupSocket 2 (0x1e32b70) -> Host: www.google.com -> Authorization: Bearer ya29.uAB1RRhn3TKLPSfFZeRgrzf68-Gb9tby5F20urDCBwC6B94UqINs1Hvh_iKX3FagPwd0QkLnrSyVRw -> GData-Version: 3 -> Content-Type: application/atom+xml -> Accept-Encoding: gzip, deflate -> User-Agent: libgdata/0.17.0 - gzip -> Connection: Keep-Alive -> -> Batch operation feedbatch12014-11-08T23:47:35ZBatch operation queryhttps://www.google.com/m8/feeds/contacts/libgdata.test%40googlemail.com/full/124aa0c7082711612014-11-08T23:47:35Z2Brian1Brian - -< HTTP/1.1 200 OK -< Soup-Debug-Timestamp: 1415490456 -< Soup-Debug: SoupMessage 2 (0x1ce92b0) -< Cache-Control: no-cache, no-store, max-age=0, must-revalidate -< Pragma: no-cache -< Expires: Fri, 01 Jan 1990 00:00:00 GMT -< Date: Sat, 08 Nov 2014 23:47:36 GMT -< Vary: Origin -< Vary: Referer -< Vary: X-Origin -< Content-Type: application/atom+xml; charset=UTF-8 -< X-Content-Type-Options: nosniff -< X-Frame-Options: SAMEORIGIN -< X-XSS-Protection: 1; mode=block -< Server: GSE -< Content-Encoding: gzip -< Alternate-Protocol: 443:quic,p=0.01 -< Transfer-Encoding: chunked -< -< -< -< https://www.google.com/m8/feeds/contacts/libgdata.test%40googlemail.com/full/batch/1415490456062000 -< 2014-11-08T23:47:36.062Z -< Batch operation feed -< -< 2 -< -< -< http://www.google.com/m8/feeds/contacts/libgdata.test%40googlemail.com/base/124aa0c708271161 -< 2014-11-08T23:47:35.557Z -< 2014-11-08T23:47:35.557Z -< -< Fooish Bar -< -< -< -< -< Fooish Bar -< Fooish -< Bar -< -< -< -< 1 -< -< -< http://www.google.com/m8/feeds/contacts/libgdata.test%40googlemail.com/base/703f874088829e7d -< 2014-11-08T23:47:35.938Z -< 2014-11-08T23:47:35.938Z -< -< Brian -< -< -< -< -< Brian -< Brian -< -< -< - -> POST /m8/feeds/contacts/default/full/batch HTTP/1.1 -> Soup-Debug-Timestamp: 1415490456 -> Soup-Debug: SoupSession 1 (0x1c05240), SoupMessage 3 (0x1ce93a0), SoupSocket 3 (0x1e32d10) -> Host: www.google.com -> Authorization: Bearer ya29.uAB1RRhn3TKLPSfFZeRgrzf68-Gb9tby5F20urDCBwC6B94UqINs1Hvh_iKX3FagPwd0QkLnrSyVRw -> GData-Version: 3 -> Content-Type: application/atom+xml -> Accept-Encoding: gzip, deflate -> User-Agent: libgdata/0.17.0 - gzip -> Connection: Keep-Alive -> -> Batch operation feedbatch12014-11-08T23:47:36ZTobyhttp://www.google.com/m8/feeds/contacts/libgdata.test%40googlemail.com/full/703f874088829e7d2014-11-08T23:47:35Z3BrianToby -> -> -> -> -> -> -> -> -> -> -> -> -> -> -> -> foobar2Fooish Barhttp://www.google.com/m8/feeds/contacts/libgdata.test%40googlemail.com/full/124aa0c7082711612014-11-08T23:47:35Z1FooishBarFooish Bar -> -> -> -> -> -> -> -> -> -> -> -> -> -> -> -> -> - -< HTTP/1.1 200 OK -< Soup-Debug-Timestamp: 1415490456 -< Soup-Debug: SoupMessage 3 (0x1ce93a0) -< Cache-Control: no-cache, no-store, max-age=0, must-revalidate -< Pragma: no-cache -< Expires: Fri, 01 Jan 1990 00:00:00 GMT -< Date: Sat, 08 Nov 2014 23:47:36 GMT -< Vary: Origin -< Vary: Referer -< Vary: X-Origin -< Content-Type: application/atom+xml; charset=UTF-8 -< X-Content-Type-Options: nosniff -< X-Frame-Options: SAMEORIGIN -< X-XSS-Protection: 1; mode=block -< Server: GSE -< Content-Encoding: gzip -< Alternate-Protocol: 443:quic,p=0.01 -< Transfer-Encoding: chunked -< -< -< -< https://www.google.com/m8/feeds/contacts/libgdata.test%40googlemail.com/full/batch/1415490456389000 -< 2014-11-08T23:47:36.389Z -< Batch operation feed -< -< 3 -< -< -< http://www.google.com/m8/feeds/contacts/libgdata.test%40googlemail.com/base/703f874088829e7d -< 2014-11-08T23:47:36.264Z -< 2014-11-08T23:47:36.264Z -< -< Toby -< -< -< -< -< Toby -< Brian -< -< -< -< 2 -< -< -< foobar -< -< -< -< 1 -< -< -< http://www.google.com/m8/feeds/contacts/libgdata.test%40googlemail.com/full/124aa0c708271161 -< 2014-11-08T23:47:35Z -< 2014-11-08T23:47:35Z -< -< Fooish Bar -< -< Fooish Bar -< Fooish -< Bar -< -< -< - diff --git a/gdata/tests/traces/contacts/batch-async b/gdata/tests/traces/contacts/batch-async deleted file mode 100644 index c3e1463a..00000000 --- a/gdata/tests/traces/contacts/batch-async +++ /dev/null @@ -1,57 +0,0 @@ -> POST /m8/feeds/contacts/default/full/batch HTTP/1.1 -> Soup-Debug-Timestamp: 1415490479 -> Soup-Debug: SoupSession 1 (0x1c05240), SoupMessage 11 (0x1ce9760), SoupSocket 6 (0x1e329d0) -> Host: www.google.com -> Authorization: Bearer ya29.uAB1RRhn3TKLPSfFZeRgrzf68-Gb9tby5F20urDCBwC6B94UqINs1Hvh_iKX3FagPwd0QkLnrSyVRw -> GData-Version: 3 -> Content-Type: application/atom+xml -> Accept-Encoding: gzip, deflate -> User-Agent: libgdata/0.17.0 - gzip -> Connection: Keep-Alive -> -> Batch operation feedbatch12014-11-08T23:47:59ZBatch operation queryhttps://www.google.com/m8/feeds/contacts/libgdata.test%40googlemail.com/full/37dab6bd880c2b8e2014-11-08T23:47:59Z1 - -< HTTP/1.1 200 OK -< Soup-Debug-Timestamp: 1415490479 -< Soup-Debug: SoupMessage 11 (0x1ce9760) -< Cache-Control: no-cache, no-store, max-age=0, must-revalidate -< Pragma: no-cache -< Expires: Fri, 01 Jan 1990 00:00:00 GMT -< Date: Sat, 08 Nov 2014 23:47:59 GMT -< Vary: Origin -< Vary: Referer -< Vary: X-Origin -< Content-Type: application/atom+xml; charset=UTF-8 -< X-Content-Type-Options: nosniff -< X-Frame-Options: SAMEORIGIN -< X-XSS-Protection: 1; mode=block -< Server: GSE -< Content-Encoding: gzip -< Alternate-Protocol: 443:quic,p=0.01 -< Transfer-Encoding: chunked -< -< -< -< https://www.google.com/m8/feeds/contacts/libgdata.test%40googlemail.com/full/batch/1415490479322000 -< 2014-11-08T23:47:59.322Z -< Batch operation feed -< -< 1 -< -< -< http://www.google.com/m8/feeds/contacts/libgdata.test%40googlemail.com/base/37dab6bd880c2b8e -< 2014-11-08T23:47:58.848Z -< 2014-11-08T23:47:58.848Z -< -< Fooish Bar -< -< -< -< -< Fooish Bar -< Fooish -< Bar -< -< -< - diff --git a/gdata/tests/traces/contacts/batch-async-cancellation b/gdata/tests/traces/contacts/batch-async-cancellation deleted file mode 100644 index e69de29b..00000000 diff --git a/gdata/tests/traces/contacts/contact-insert b/gdata/tests/traces/contacts/contact-insert deleted file mode 100644 index eed299ee..00000000 --- a/gdata/tests/traces/contacts/contact-insert +++ /dev/null @@ -1,90 +0,0 @@ -> POST /m8/feeds/contacts/default/full HTTP/1.1 -> Soup-Debug-Timestamp: 1415489531 -> Soup-Debug: SoupSession 1 (0x15cd240), SoupMessage 4 (0x182f550), SoupSocket 4 (0x18d5c10) -> Host: www.google.com -> Authorization: Bearer ya29.uACgkznYPDckPkHNMU2MF2gRNGrNKqsjnalf5jZmQ0jV9jcp297YMiQop53msSbUJi5poX8LolhsSw -> GData-Version: 3 -> Content-Type: application/atom+xml -> Accept-Encoding: gzip, deflate -> User-Agent: libgdata/0.17.0 - gzip -> Connection: Keep-Alive -> -> John SmithNotesJohnSmithJohn Smith(206)555-1212(206)555-12131600 Amphitheatre Pkwy Mountain ViewOrgCorpPresidentThis is a jot.Brian Haddockhttp://example.com/RowingBig JJ, BigBig J Enterprises, Ltd.This is a serverA. B. C.Smith12kmProfessional bumJonCharity work - -< HTTP/1.1 201 Created -< Soup-Debug-Timestamp: 1415489531 -< Soup-Debug: SoupMessage 4 (0x182f550) -< ETag: "QHo8cDVSLit7I2A9XRdWFEUDQgc." -< Vary: Origin -< Vary: Referer -< Vary: X-Origin -< Content-Type: application/atom+xml; charset=UTF-8 -< Date: Sat, 08 Nov 2014 23:32:11 GMT -< Expires: Sat, 08 Nov 2014 23:32:11 GMT -< Cache-Control: private, max-age=0 -< X-Content-Type-Options: nosniff -< X-Frame-Options: SAMEORIGIN -< X-XSS-Protection: 1; mode=block -< Server: GSE -< Content-Encoding: gzip -< Alternate-Protocol: 443:quic,p=0.01 -< Transfer-Encoding: chunked -< -< -< -< http://www.google.com/m8/feeds/contacts/libgdata.test%40googlemail.com/base/3d8219568aedc2a9 -< 2014-11-08T23:32:11.478Z -< 2014-11-08T23:32:11.478Z -< -< John Smith -< Notes -< -< -< -< -< John Smith -< John -< Smith -< -< Big J -< A. B. C. -< Jon -< Smith -< -< -< Professional bum -< Big J Enterprises, Ltd. -< 12km -< This is a server -< Charity work -< J, Big -< -< OrgCorp -< President -< -< -< -< -< (206)555-1212 -< (206)555-1213 -< -< 1600 Amphitheatre Pkwy Mountain View -< 1600 Amphitheatre Pkwy Mountain View -< -< -< -< -< -< Brian Haddock -< -< -< -< -< -< -< -< This is a jot. -< Rowing -< http://example.com/ -< - diff --git a/gdata/tests/traces/contacts/contact-update b/gdata/tests/traces/contacts/contact-update deleted file mode 100644 index 856d0c06..00000000 --- a/gdata/tests/traces/contacts/contact-update +++ /dev/null @@ -1,63 +0,0 @@ -> PUT /m8/feeds/contacts/libgdata.test%40googlemail.com/full/c8390ec0ef7f98a HTTP/1.1 -> Soup-Debug-Timestamp: 1415489543 -> Soup-Debug: SoupSession 1 (0x15cd240), SoupMessage 7 (0x182f370), SoupSocket 5 (0x18d5ce0) -> Host: www.google.com -> Authorization: Bearer ya29.uACgkznYPDckPkHNMU2MF2gRNGrNKqsjnalf5jZmQ0jV9jcp297YMiQop53msSbUJi5poX8LolhsSw -> GData-Version: 3 -> If-Match: "Q3g7cTVSLit7I2A9XRdWFEUDQgc." -> Content-Type: application/atom+xml -> Accept-Encoding: gzip, deflate -> User-Agent: libgdata/0.17.0 - gzip -> Connection: Keep-Alive -> -> John Wilsonhttp://www.google.com/m8/feeds/contacts/libgdata.test%40googlemail.com/full/c8390ec0ef7f98a2014-11-08T23:32:12ZJohn WilsonvalueTest Contact Esq. -> -> -> -> -> -> -> -> -> -> - -< HTTP/1.1 200 OK -< Soup-Debug-Timestamp: 1415489543 -< Soup-Debug: SoupMessage 7 (0x182f370) -< Cache-Control: no-cache, no-store, max-age=0, must-revalidate -< Pragma: no-cache -< Expires: Fri, 01 Jan 1990 00:00:00 GMT -< Date: Sat, 08 Nov 2014 23:32:23 GMT -< ETag: "Qnw7fjVSLyt7I2A9XRdWFEUDQgA." -< Vary: Origin -< Vary: Referer -< Vary: X-Origin -< Content-Type: application/atom+xml; charset=UTF-8 -< X-Content-Type-Options: nosniff -< X-Frame-Options: SAMEORIGIN -< X-XSS-Protection: 1; mode=block -< Server: GSE -< Content-Encoding: gzip -< Alternate-Protocol: 443:quic,p=0.01 -< Transfer-Encoding: chunked -< -< -< -< http://www.google.com/m8/feeds/contacts/libgdata.test%40googlemail.com/base/c8390ec0ef7f98a -< 2014-11-08T23:32:23.206Z -< 2014-11-08T23:32:23.206Z -< -< John Wilson -< -< -< -< -< John Wilson -< John -< Wilson -< -< Test Contact Esq. -< value -< - diff --git a/gdata/tests/traces/contacts/global-authentication b/gdata/tests/traces/contacts/global-authentication deleted file mode 100644 index a558a5cf..00000000 --- a/gdata/tests/traces/contacts/global-authentication +++ /dev/null @@ -1,35 +0,0 @@ -> POST /o/oauth2/token HTTP/1.1 -> Soup-Debug-Timestamp: 1415490454 -> Soup-Debug: SoupSession 1 (0x1c05110), SoupMessage 1 (0x1ce90d0), SoupSocket 1 (0x1e32900) -> Host: accounts.google.com -> Content-Type: application/x-www-form-urlencoded -> Accept-Encoding: gzip, deflate -> User-Agent: libgdata/0.17.0 - gzip -> Connection: Keep-Alive -> -> client_id=352818697630-nqu2cmt5quqd6lr17ouoqmb684u84l1f.apps.googleusercontent.com&client_secret=-fA4pHQJxR3zJ-FyAMPQsikg&code=4%2FnMGN3dwZKY3b-GGcpyYpncY-GvKwp5cmM0lVqaJz1k0.knZS65dvk9gToiIBeO6P2m-IH6AjkwI&redirect_uri=urn%3Aietf%3Awg%3Aoauth%3A2.0%3Aoob&grant_type=authorization_code - -< HTTP/1.1 200 OK -< Soup-Debug-Timestamp: 1415490455 -< Soup-Debug: SoupMessage 1 (0x1ce90d0) -< Content-Type: application/json; charset=utf-8 -< Cache-Control: no-cache, no-store, max-age=0, must-revalidate -< Pragma: no-cache -< Expires: Fri, 01 Jan 1990 00:00:00 GMT -< Date: Sat, 08 Nov 2014 23:47:35 GMT -< Content-Disposition: attachment; filename="json.txt"; filename*=UTF-8''json.txt -< Content-Encoding: gzip -< X-Content-Type-Options: nosniff -< X-Frame-Options: SAMEORIGIN -< X-XSS-Protection: 1; mode=block -< Server: GSE -< Alternate-Protocol: 443:quic,p=0.01 -< Transfer-Encoding: chunked -< -< { -< "access_token" : "ya29.uAB1RRhn3TKLPSfFZeRgrzf68-Gb9tby5F20urDCBwC6B94UqINs1Hvh_iKX3FagPwd0QkLnrSyVRw", -< "token_type" : "Bearer", -< "expires_in" : 3600, -< "refresh_token" : "1/OxplJowxtPHiKob9htjgcEh6VihajS9Zomx7y9ljWOI" -< } - diff --git a/gdata/tests/traces/contacts/group-insert b/gdata/tests/traces/contacts/group-insert deleted file mode 100644 index e99c414c..00000000 --- a/gdata/tests/traces/contacts/group-insert +++ /dev/null @@ -1,45 +0,0 @@ -> POST /m8/feeds/groups/default/full HTTP/1.1 -> Soup-Debug-Timestamp: 1415490492 -> Soup-Debug: SoupSession 1 (0x1c05240), SoupMessage 22 (0x1ce93a0), SoupSocket 11 (0x7f4510044f70) -> Host: www.google.com -> Authorization: Bearer ya29.uAB1RRhn3TKLPSfFZeRgrzf68-Gb9tby5F20urDCBwC6B94UqINs1Hvh_iKX3FagPwd0QkLnrSyVRw -> GData-Version: 3 -> Content-Type: application/atom+xml -> Accept-Encoding: gzip, deflate -> User-Agent: libgdata/0.17.0 - gzip -> Connection: Keep-Alive -> -> New Group!New Group!barfoo - -< HTTP/1.1 201 Created -< Soup-Debug-Timestamp: 1415490493 -< Soup-Debug: SoupMessage 22 (0x1ce93a0) -< ETag: "Q3c-cTVSLSt7I2A9XRdWFEQKQw0." -< Vary: Origin -< Vary: Referer -< Vary: X-Origin -< Content-Type: application/atom+xml; charset=UTF-8 -< Date: Sat, 08 Nov 2014 23:48:13 GMT -< Expires: Sat, 08 Nov 2014 23:48:13 GMT -< Cache-Control: private, max-age=0 -< X-Content-Type-Options: nosniff -< X-Frame-Options: SAMEORIGIN -< X-XSS-Protection: 1; mode=block -< Server: GSE -< Content-Encoding: gzip -< Alternate-Protocol: 443:quic,p=0.01 -< Transfer-Encoding: chunked -< -< -< -< http://www.google.com/m8/feeds/groups/libgdata.test%40googlemail.com/base/6beff9268d4dbc1f -< 2014-11-08T23:48:12.959Z -< 2014-11-08T23:48:12.959Z -< -< New Group! -< New Group! -< -< -< barfoo -< - diff --git a/gdata/tests/traces/contacts/group_insert-async b/gdata/tests/traces/contacts/group_insert-async deleted file mode 100644 index 62fd6311..00000000 --- a/gdata/tests/traces/contacts/group_insert-async +++ /dev/null @@ -1,45 +0,0 @@ -> POST /m8/feeds/groups/default/full HTTP/1.1 -> Soup-Debug-Timestamp: 1415490541 -> Soup-Debug: SoupSession 1 (0x1c05240), SoupMessage 47 (0x7f451000f680), SoupSocket 22 (0x1e32de0) -> Host: www.google.com -> Authorization: Bearer ya29.uAB1RRhn3TKLPSfFZeRgrzf68-Gb9tby5F20urDCBwC6B94UqINs1Hvh_iKX3FagPwd0QkLnrSyVRw -> GData-Version: 3 -> Content-Type: application/atom+xml -> Accept-Encoding: gzip, deflate -> User-Agent: libgdata/0.17.0 - gzip -> Connection: Keep-Alive -> -> New Group!New Group!barfoo - -< HTTP/1.1 201 Created -< Soup-Debug-Timestamp: 1415490542 -< Soup-Debug: SoupMessage 47 (0x7f451000f680) -< ETag: "Q34_eTVSLyt7I2A9XRdWFEQKQgA." -< Vary: Origin -< Vary: Referer -< Vary: X-Origin -< Content-Type: application/atom+xml; charset=UTF-8 -< Date: Sat, 08 Nov 2014 23:49:02 GMT -< Expires: Sat, 08 Nov 2014 23:49:02 GMT -< Cache-Control: private, max-age=0 -< X-Content-Type-Options: nosniff -< X-Frame-Options: SAMEORIGIN -< X-XSS-Protection: 1; mode=block -< Server: GSE -< Content-Encoding: gzip -< Alternate-Protocol: 443:quic,p=0.01 -< Transfer-Encoding: chunked -< -< -< -< http://www.google.com/m8/feeds/groups/libgdata.test%40googlemail.com/base/6beff9268d4dbc1f -< 2014-11-08T23:49:02.041Z -< 2014-11-08T23:49:02.041Z -< -< New Group! -< New Group! -< -< -< barfoo -< - diff --git a/gdata/tests/traces/contacts/group_insert-async-cancellation b/gdata/tests/traces/contacts/group_insert-async-cancellation deleted file mode 100644 index 91d8ec65..00000000 --- a/gdata/tests/traces/contacts/group_insert-async-cancellation +++ /dev/null @@ -1,45 +0,0 @@ -> POST /m8/feeds/groups/default/full HTTP/1.1 -> Soup-Debug-Timestamp: 1415490553 -> Soup-Debug: SoupSession 1 (0x1c05240), SoupMessage 50 (0x7f451000f2c0), SoupSocket 24 (0x7f4510044dd0) -> Host: www.google.com -> Authorization: Bearer ya29.uAB1RRhn3TKLPSfFZeRgrzf68-Gb9tby5F20urDCBwC6B94UqINs1Hvh_iKX3FagPwd0QkLnrSyVRw -> GData-Version: 3 -> Content-Type: application/atom+xml -> Accept-Encoding: gzip, deflate -> User-Agent: libgdata/0.17.0 - gzip -> Connection: Keep-Alive -> -> New Group!New Group!barfoo - -< HTTP/1.1 201 Created -< Soup-Debug-Timestamp: 1415490553 -< Soup-Debug: SoupMessage 50 (0x7f451000f2c0) -< ETag: "Qnw6fzVSLit7I2A9XRdWFEQKQgE." -< Vary: Origin -< Vary: Referer -< Vary: X-Origin -< Content-Type: application/atom+xml; charset=UTF-8 -< Date: Sat, 08 Nov 2014 23:49:13 GMT -< Expires: Sat, 08 Nov 2014 23:49:13 GMT -< Cache-Control: private, max-age=0 -< X-Content-Type-Options: nosniff -< X-Frame-Options: SAMEORIGIN -< X-XSS-Protection: 1; mode=block -< Server: GSE -< Content-Encoding: gzip -< Alternate-Protocol: 443:quic,p=0.01 -< Transfer-Encoding: chunked -< -< -< -< http://www.google.com/m8/feeds/groups/libgdata.test%40googlemail.com/base/6beff9268d4dbc1f -< 2014-11-08T23:49:13.217Z -< 2014-11-08T23:49:13.217Z -< -< New Group! -< New Group! -< -< -< barfoo -< - diff --git a/gdata/tests/traces/contacts/photo-add b/gdata/tests/traces/contacts/photo-add deleted file mode 100644 index cd0ecf44..00000000 --- a/gdata/tests/traces/contacts/photo-add +++ /dev/null @@ -1,33 +0,0 @@ -> PUT /m8/feeds/photos/media/libgdata.test%40googlemail.com/c8390ec0ef7f98a HTTP/1.1 -> Soup-Debug-Timestamp: 1415489586 -> Soup-Debug: SoupSession 1 (0x15cd240), SoupMessage 41 (0x182f190), SoupSocket 19 (0x7ff438057b20) -> Host: www.google.com -> Authorization: Bearer ya29.uACgkznYPDckPkHNMU2MF2gRNGrNKqsjnalf5jZmQ0jV9jcp297YMiQop53msSbUJi5poX8LolhsSw -> GData-Version: 3 -> If-Match: * -> Content-Type: image/jpeg -> Accept-Encoding: gzip, deflate -> User-Agent: libgdata/0.17.0 - gzip -> Connection: Keep-Alive -> -> ÿØÿà - -< HTTP/1.1 200 OK -< Soup-Debug-Timestamp: 1415489588 -< Soup-Debug: SoupMessage 41 (0x182f190) -< Content-Type: application/atom+xml; charset=UTF-8; type=entry -< GData-Version: 3.1 -< ETag: "RmtJPnAWSit7I2A9KxQuEiQCNkcWGnsvRA8." -< Content-Encoding: gzip -< Date: Sat, 08 Nov 2014 23:33:08 GMT -< Expires: Sat, 08 Nov 2014 23:33:08 GMT -< Cache-Control: private, max-age=0 -< X-Content-Type-Options: nosniff -< X-Frame-Options: SAMEORIGIN -< X-XSS-Protection: 1; mode=block -< Server: GSE -< Alternate-Protocol: 443:quic,p=0.01 -< Transfer-Encoding: chunked -< -< http://www.google.com/m8/feeds/photos/media/libgdata.test%40googlemail.com/c8390ec0ef7f98a2014-11-08T23:32:56.426Z2014-11-08T23:32:56.426Z - diff --git a/gdata/tests/traces/contacts/photo-delete b/gdata/tests/traces/contacts/photo-delete deleted file mode 100644 index af198c8c..00000000 --- a/gdata/tests/traces/contacts/photo-delete +++ /dev/null @@ -1,27 +0,0 @@ -> DELETE /m8/feeds/photos/media/libgdata.test%40googlemail.com/c8390ec0ef7f98a HTTP/1.1 -> Soup-Debug-Timestamp: 1415489633 -> Soup-Debug: SoupSession 1 (0x15cd240), SoupMessage 53 (0x182f190), SoupSocket 21 (0x7ff438057b20) -> Host: www.google.com -> Authorization: Bearer ya29.uACgkznYPDckPkHNMU2MF2gRNGrNKqsjnalf5jZmQ0jV9jcp297YMiQop53msSbUJi5poX8LolhsSw -> GData-Version: 3 -> If-Match: "Lmt6BwoIbCt7I2BnCFc6EEx-JkY0N3wCaQ0." -> Accept-Encoding: gzip, deflate -> User-Agent: libgdata/0.17.0 - gzip -> Connection: Keep-Alive - -< HTTP/1.1 200 OK -< Soup-Debug-Timestamp: 1415489634 -< Soup-Debug: SoupMessage 53 (0x182f190) -< GData-Version: 3.1 -< Date: Sat, 08 Nov 2014 23:33:54 GMT -< Expires: Sat, 08 Nov 2014 23:33:54 GMT -< Cache-Control: private, max-age=0 -< X-Content-Type-Options: nosniff -< X-Frame-Options: SAMEORIGIN -< X-XSS-Protection: 1; mode=block -< Content-Length: 0 -< Server: GSE -< Content-Type: text/html; charset=UTF-8 -< Alternate-Protocol: 443:quic,p=0.01 -< - diff --git a/gdata/tests/traces/contacts/photo-get b/gdata/tests/traces/contacts/photo-get deleted file mode 100644 index 430c2e78..00000000 --- a/gdata/tests/traces/contacts/photo-get +++ /dev/null @@ -1,29 +0,0 @@ -> GET /m8/feeds/photos/media/libgdata.test%40googlemail.com/c8390ec0ef7f98a HTTP/1.1 -> Soup-Debug-Timestamp: 1415489610 -> Soup-Debug: SoupSession 1 (0x15cd240), SoupMessage 47 (0x182f460), SoupSocket 20 (0x7ff438057d90) -> Host: www.google.com -> Authorization: Bearer ya29.uACgkznYPDckPkHNMU2MF2gRNGrNKqsjnalf5jZmQ0jV9jcp297YMiQop53msSbUJi5poX8LolhsSw -> GData-Version: 3 -> Accept-Encoding: gzip, deflate -> User-Agent: libgdata/0.17.0 - gzip -> Connection: Keep-Alive - -< HTTP/1.1 200 OK -< Soup-Debug-Timestamp: 1415489611 -< Soup-Debug: SoupMessage 47 (0x182f460) -< Content-Type: image/jpeg -< Expires: Sat, 08 Nov 2014 23:33:31 GMT -< Date: Sat, 08 Nov 2014 23:33:31 GMT -< Cache-Control: private, max-age=0, must-revalidate, no-transform -< Vary: Accept, X-GData-Authorization, GData-Version -< GData-Version: 3.1 -< ETag: "cwwgO1YRWit7I2A_BlwEZzt2IEISCkwmVBc." -< Transfer-Encoding: chunked -< X-Content-Type-Options: nosniff -< X-Frame-Options: SAMEORIGIN -< X-XSS-Protection: 1; mode=block -< Server: GSE -< Alternate-Protocol: 443:quic,p=0.01 -< -< ÿØÿà - diff --git a/gdata/tests/traces/contacts/photo_add-async b/gdata/tests/traces/contacts/photo_add-async deleted file mode 100644 index 99063eb2..00000000 --- a/gdata/tests/traces/contacts/photo_add-async +++ /dev/null @@ -1,33 +0,0 @@ -> PUT /m8/feeds/photos/media/libgdata.test%40googlemail.com/c8390ec0ef7f98a HTTP/1.1 -> Soup-Debug-Timestamp: 1415489645 -> Soup-Debug: SoupSession 1 (0x15cd240), SoupMessage 57 (0x7ff43800ee40), SoupSocket 22 (0x7ff4380578b0) -> Host: www.google.com -> Authorization: Bearer ya29.uACgkznYPDckPkHNMU2MF2gRNGrNKqsjnalf5jZmQ0jV9jcp297YMiQop53msSbUJi5poX8LolhsSw -> GData-Version: 3 -> If-Match: * -> Content-Type: image/jpeg -> Accept-Encoding: gzip, deflate -> User-Agent: libgdata/0.17.0 - gzip -> Connection: Keep-Alive -> -> ÿØÿà - -< HTTP/1.1 200 OK -< Soup-Debug-Timestamp: 1415489647 -< Soup-Debug: SoupMessage 57 (0x7ff43800ee40) -< Content-Type: application/atom+xml; charset=UTF-8; type=entry -< GData-Version: 3.1 -< ETag: "RmtJPnAWSit7I2A9KxQuEiQCNkcWGnsvRA8." -< Content-Encoding: gzip -< Date: Sat, 08 Nov 2014 23:34:07 GMT -< Expires: Sat, 08 Nov 2014 23:34:07 GMT -< Cache-Control: private, max-age=0 -< X-Content-Type-Options: nosniff -< X-Frame-Options: SAMEORIGIN -< X-XSS-Protection: 1; mode=block -< Server: GSE -< Alternate-Protocol: 443:quic,p=0.01 -< Transfer-Encoding: chunked -< -< http://www.google.com/m8/feeds/photos/media/libgdata.test%40googlemail.com/c8390ec0ef7f98a2014-11-08T23:33:54.832Z2014-11-08T23:33:54.832Z - diff --git a/gdata/tests/traces/contacts/photo_add-async-cancellation b/gdata/tests/traces/contacts/photo_add-async-cancellation deleted file mode 100644 index 483639e5..00000000 --- a/gdata/tests/traces/contacts/photo_add-async-cancellation +++ /dev/null @@ -1,31 +0,0 @@ -> PUT /m8/feeds/photos/media/libgdata.test%40googlemail.com/c8390ec0ef7f98a HTTP/1.1 -> Soup-Debug-Timestamp: 1415489669 -> Soup-Debug: SoupSession 1 (0x15cd240), SoupMessage 65 (0x7ff42c0028a0), SoupSocket 27 (0x7ff438057d90) -> Host: www.google.com -> Authorization: Bearer ya29.uACgkznYPDckPkHNMU2MF2gRNGrNKqsjnalf5jZmQ0jV9jcp297YMiQop53msSbUJi5poX8LolhsSw -> GData-Version: 3 -> If-Match: "Ry5LPl0dbCt7I2BfDnAkaEVyJFwcf00mcS0." -> Content-Type: image/jpeg -> Accept-Encoding: gzip, deflate -> User-Agent: libgdata/0.17.0 - gzip -> Connection: Keep-Alive -> -> ÿØÿà - -< HTTP/1.1 412 Precondition Failed -< Soup-Debug-Timestamp: 1415489670 -< Soup-Debug: SoupMessage 65 (0x7ff42c0028a0) -< Content-Type: text/html; charset=UTF-8 -< Content-Encoding: gzip -< Date: Sat, 08 Nov 2014 23:34:30 GMT -< Expires: Sat, 08 Nov 2014 23:34:30 GMT -< Cache-Control: private, max-age=0 -< X-Content-Type-Options: nosniff -< X-Frame-Options: SAMEORIGIN -< X-XSS-Protection: 1; mode=block -< Server: GSE -< Alternate-Protocol: 443:quic,p=0.01 -< Transfer-Encoding: chunked -< -< Mismatch: etags = ["Ry5LPl0dbCt7I2BfDnAkaEVyJFwcf00mcS0."], version = [14VDGutoxXF-8UQT3fVFTQ] - diff --git a/gdata/tests/traces/contacts/photo_delete-async b/gdata/tests/traces/contacts/photo_delete-async deleted file mode 100644 index 52c517df..00000000 --- a/gdata/tests/traces/contacts/photo_delete-async +++ /dev/null @@ -1,27 +0,0 @@ -> DELETE /m8/feeds/photos/media/libgdata.test%40googlemail.com/c8390ec0ef7f98a HTTP/1.1 -> Soup-Debug-Timestamp: 1415490478 -> Soup-Debug: SoupSession 1 (0x1c05240), SoupMessage 7 (0x1ce9670), SoupSocket 4 (0x1e32b70) -> Host: www.google.com -> Authorization: Bearer ya29.uAB1RRhn3TKLPSfFZeRgrzf68-Gb9tby5F20urDCBwC6B94UqINs1Hvh_iKX3FagPwd0QkLnrSyVRw -> GData-Version: 3 -> If-Match: "SQpAMGkCSit7I2BKMH8LVi5COFsJDFglViY." -> Accept-Encoding: gzip, deflate -> User-Agent: libgdata/0.17.0 - gzip -> Connection: Keep-Alive - -< HTTP/1.1 200 OK -< Soup-Debug-Timestamp: 1415490478 -< Soup-Debug: SoupMessage 7 (0x1ce9670) -< GData-Version: 3.1 -< Date: Sat, 08 Nov 2014 23:47:58 GMT -< Expires: Sat, 08 Nov 2014 23:47:58 GMT -< Cache-Control: private, max-age=0 -< X-Content-Type-Options: nosniff -< X-Frame-Options: SAMEORIGIN -< X-XSS-Protection: 1; mode=block -< Content-Length: 0 -< Server: GSE -< Content-Type: text/html; charset=UTF-8 -< Alternate-Protocol: 443:quic,p=0.01 -< - diff --git a/gdata/tests/traces/contacts/photo_delete-async-cancellation b/gdata/tests/traces/contacts/photo_delete-async-cancellation deleted file mode 100644 index a5c40da2..00000000 --- a/gdata/tests/traces/contacts/photo_delete-async-cancellation +++ /dev/null @@ -1,34 +0,0 @@ -> DELETE /m8/feeds/photos/media/libgdata.test%40googlemail.com/465577d88b0afee8 HTTP/1.1 -> Soup-Debug-Timestamp: 1375362290 -> Soup-Debug: SoupSession 1 (0x66f2e0), SoupMessage 52 (0x7d2e50), SoupSocket 15 (0x70d480) -> Host: www.google.com -> Authorization: GoogleLogin auth=DQAAANUAAAABD9I2qzuaphzCwqlPN1nD-UVlDvXxpCfZZs2DpQs8CyuKugZr-827LLW6Se0g49UTlhYYurHxHCMNk3l9iJjeGlq6ZYd51VYAKkGzvyTnwj1fvWfFIkrj53HVYeTy0ER0oRBCi1BISjJtxb_EeYStuDF4mfHC9FSeHXqNUW_Qf3gtQl1WytVURmYC_H89IVrQB8UOZEzZXgjh3jNv1w9cQv8j3_dszdG0F6dLOehzkyPgckEHapxSOoFFvUzbawNaGQcNgFx1RVALkHKkBga-7PnPzzUEMfj7snBhGt53LQ -> GData-Version: 3 -> If-Match: "VDd2MAY7Sit7I2BuKnEXWjN4L2wpH1IffSY." -> Accept-Encoding: gzip, deflate -> Connection: Keep-Alive - -> Soup-Debug-Timestamp: 1375362290 -> Soup-Debug: SoupSession 1 (0x66f2e0), SoupMessage 52 (0x7d2e50), SoupSocket 16 (0x70d480), restarted -> Host: www.google.com -> Authorization: GoogleLogin auth=DQAAANUAAAABD9I2qzuaphzCwqlPN1nD-UVlDvXxpCfZZs2DpQs8CyuKugZr-827LLW6Se0g49UTlhYYurHxHCMNk3l9iJjeGlq6ZYd51VYAKkGzvyTnwj1fvWfFIkrj53HVYeTy0ER0oRBCi1BISjJtxb_EeYStuDF4mfHC9FSeHXqNUW_Qf3gtQl1WytVURmYC_H89IVrQB8UOZEzZXgjh3jNv1w9cQv8j3_dszdG0F6dLOehzkyPgckEHapxSOoFFvUzbawNaGQcNgFx1RVALkHKkBga-7PnPzzUEMfj7snBhGt53LQ -> GData-Version: 3 -> If-Match: "VDd2MAY7Sit7I2BuKnEXWjN4L2wpH1IffSY." -> Accept-Encoding: gzip, deflate -> Connection: Keep-Alive - -< HTTP/1.1 200 OK -< Soup-Debug-Timestamp: 1375362290 -< Soup-Debug: SoupMessage 52 (0x7d2e50) -< GData-Version: 3.1 -< Date: Thu, 01 Aug 2013 13:04:50 GMT -< Expires: Thu, 01 Aug 2013 13:04:50 GMT -< Cache-control: private, max-age=0 -< X-Content-Type-Options: nosniff -< X-Frame-Options: SAMEORIGIN -< X-XSS-Protection: 1; mode=block -< Content-Length: 0 -< Server: GSE -< Content-Type: text/html; charset=UTF-8 -< - diff --git a/gdata/tests/traces/contacts/photo_get-async b/gdata/tests/traces/contacts/photo_get-async deleted file mode 100644 index 6c9ed674..00000000 --- a/gdata/tests/traces/contacts/photo_get-async +++ /dev/null @@ -1,29 +0,0 @@ -> GET /m8/feeds/photos/media/libgdata.test%40googlemail.com/c8390ec0ef7f98a HTTP/1.1 -> Soup-Debug-Timestamp: 1415489693 -> Soup-Debug: SoupSession 1 (0x15cd240), SoupMessage 71 (0x182f640), SoupSocket 28 (0x7ff42c01e9a0) -> Host: www.google.com -> Authorization: Bearer ya29.uACgkznYPDckPkHNMU2MF2gRNGrNKqsjnalf5jZmQ0jV9jcp297YMiQop53msSbUJi5poX8LolhsSw -> GData-Version: 3 -> Accept-Encoding: gzip, deflate -> User-Agent: libgdata/0.17.0 - gzip -> Connection: Keep-Alive - -< HTTP/1.1 200 OK -< Soup-Debug-Timestamp: 1415489693 -< Soup-Debug: SoupMessage 71 (0x182f640) -< Content-Type: image/jpeg -< Expires: Sat, 08 Nov 2014 23:34:53 GMT -< Date: Sat, 08 Nov 2014 23:34:53 GMT -< Cache-Control: private, max-age=0, must-revalidate, no-transform -< Vary: Accept, X-GData-Authorization, GData-Version -< GData-Version: 3.1 -< ETag: "dwpQD1cTfCt7I2B7XXUrWRhsEQAQKWElSDA." -< Transfer-Encoding: chunked -< X-Content-Type-Options: nosniff -< X-Frame-Options: SAMEORIGIN -< X-XSS-Protection: 1; mode=block -< Server: GSE -< Alternate-Protocol: 443:quic,p=0.01 -< -< ÿØÿà - diff --git a/gdata/tests/traces/contacts/photo_get-async-cancellation b/gdata/tests/traces/contacts/photo_get-async-cancellation deleted file mode 100644 index 42d24eab..00000000 --- a/gdata/tests/traces/contacts/photo_get-async-cancellation +++ /dev/null @@ -1,29 +0,0 @@ -> GET /m8/feeds/photos/media/libgdata.test%40googlemail.com/c8390ec0ef7f98a HTTP/1.1 -> Soup-Debug-Timestamp: 1415489717 -> Soup-Debug: SoupSession 1 (0x15cd240), SoupMessage 79 (0x7ff430010990), SoupSocket 31 (0x7ff42c01e9a0) -> Host: www.google.com -> Authorization: Bearer ya29.uACgkznYPDckPkHNMU2MF2gRNGrNKqsjnalf5jZmQ0jV9jcp297YMiQop53msSbUJi5poX8LolhsSw -> GData-Version: 3 -> Accept-Encoding: gzip, deflate -> User-Agent: libgdata/0.17.0 - gzip -> Connection: Keep-Alive - -< HTTP/1.1 200 OK -< Soup-Debug-Timestamp: 1415489717 -< Soup-Debug: SoupMessage 79 (0x7ff430010990) -< Content-Type: image/jpeg -< Expires: Sat, 08 Nov 2014 23:35:17 GMT -< Date: Sat, 08 Nov 2014 23:35:17 GMT -< Cache-Control: private, max-age=0, must-revalidate, no-transform -< Vary: Accept, X-GData-Authorization, GData-Version -< GData-Version: 3.1 -< ETag: "XCl1GngxWit7I2B7GVNaSw1DDwQjC2UENjM." -< Transfer-Encoding: chunked -< X-Content-Type-Options: nosniff -< X-Frame-Options: SAMEORIGIN -< X-XSS-Protection: 1; mode=block -< Server: GSE -< Alternate-Protocol: 443:quic,p=0.01 -< -< ÿØÿà - diff --git a/gdata/tests/traces/contacts/query-all-contacts b/gdata/tests/traces/contacts/query-all-contacts deleted file mode 100644 index a8bc8e1c..00000000 --- a/gdata/tests/traces/contacts/query-all-contacts +++ /dev/null @@ -1,373 +0,0 @@ -> GET /m8/feeds/contacts/default/full HTTP/1.1 -> Soup-Debug-Timestamp: 1415489550 -> Soup-Debug: SoupSession 1 (0x15cd240), SoupMessage 13 (0x182f280), SoupSocket 8 (0x18d59a0) -> Host: www.google.com -> Authorization: Bearer ya29.uACgkznYPDckPkHNMU2MF2gRNGrNKqsjnalf5jZmQ0jV9jcp297YMiQop53msSbUJi5poX8LolhsSw -> GData-Version: 3 -> Accept-Encoding: gzip, deflate -> User-Agent: libgdata/0.17.0 - gzip -> Connection: Keep-Alive - -< HTTP/1.1 200 OK -< Soup-Debug-Timestamp: 1415489550 -< Soup-Debug: SoupMessage 13 (0x182f280) -< Expires: Sat, 08 Nov 2014 23:32:30 GMT -< Date: Sat, 08 Nov 2014 23:32:30 GMT -< Cache-Control: private, max-age=0, must-revalidate, no-transform -< ETag: "QXk_cDVSLyt7I2A9XRdWFEUDQgE." -< Vary: Origin -< Vary: Referer -< Vary: X-Origin -< Content-Type: application/atom+xml; charset=UTF-8 -< X-Content-Type-Options: nosniff -< X-Frame-Options: SAMEORIGIN -< X-XSS-Protection: 1; mode=block -< Server: GSE -< Content-Encoding: gzip -< Alternate-Protocol: 443:quic,p=0.01 -< Transfer-Encoding: chunked -< -< -< -< libgdata.test@googlemail.com -< 2014-11-08T23:32:30.748Z -< -< GData Test's Contacts -< -< -< -< -< -< -< GData Test -< libgdata.test@googlemail.com -< -< Contacts -< 16 -< 1 -< 25 -< -< http://www.google.com/m8/feeds/contacts/libgdata.test%40googlemail.com/base/a86b08c4621c7 -< 2014-03-15T21:25:22.682Z -< 2014-03-15T21:25:22.682Z -< -< AA -< -< -< -< -< AA -< AA -< -< AA -< -< -< FALSE -< -< -< http://www.google.com/m8/feeds/contacts/libgdata.test%40googlemail.com/base/1848d1b50ceff503 -< 2014-04-06T09:15:15.937Z -< 2014-04-06T09:15:15.937Z -< -< Test Mcfoobar -< -< -< -< -< Test Mcfoobar -< Test -< Mcfoobar -< -< Mcfoobar, Test -< -< -< FALSE -< -< -< http://www.google.com/m8/feeds/contacts/libgdata.test%40googlemail.com/base/186ec44a0fc1ca9d -< 2014-11-08T23:27:06.083Z -< 2014-11-08T23:27:06.083Z -< -< John Wilson -< -< -< -< -< John Wilson -< John -< Wilson -< -< Test Contact Esq. -< value -< -< -< http://www.google.com/m8/feeds/contacts/libgdata.test%40googlemail.com/base/1a7e535488e850f7 -< 2014-11-08T23:32:25.323Z -< 2014-11-08T23:32:25.323Z -< -< -< <link rel="http://schemas.google.com/contacts/2008/rel#photo" type="image/*" href="https://www.google.com/m8/feeds/photos/media/libgdata.test%40googlemail.com/1a7e535488e850f7"/> -< <link rel="self" type="application/atom+xml" href="https://www.google.com/m8/feeds/contacts/libgdata.test%40googlemail.com/full/1a7e535488e850f7"/> -< <link rel="edit" type="application/atom+xml" href="https://www.google.com/m8/feeds/contacts/libgdata.test%40googlemail.com/full/1a7e535488e850f7"/> -< <gContact:nickname>Test Contact 3</gContact:nickname> -< </entry> -< <entry gd:etag=""RX0-cDVSLit7I2A9XRdWFEUDRgE.""> -< <id>http://www.google.com/m8/feeds/contacts/libgdata.test%40googlemail.com/base/1ebe29f48b9167e1</id> -< <updated>2014-11-08T23:25:54.358Z</updated> -< <app:edited xmlns:app="http://www.w3.org/2007/app">2014-11-08T23:25:54.358Z</app:edited> -< <category scheme="http://schemas.google.com/g/2005#kind" term="http://schemas.google.com/contact/2008#contact"/> -< <title>John Smith -< Notes -< -< -< -< -< John Smith -< John -< Smith -< -< Big J -< A. B. C. -< Jon -< Smith -< -< -< Professional bum -< Big J Enterprises, Ltd. -< 12km -< This is a server -< Charity work -< J, Big -< -< OrgCorp -< President -< -< -< -< -< (206)555-1212 -< (206)555-1213 -< -< 1600 Amphitheatre Pkwy Mountain View -< 1600 Amphitheatre Pkwy Mountain View -< -< -< -< -< -< Brian Haddock -< -< -< -< -< -< -< -< This is a jot. -< Rowing -< http://example.com/ -< -< -< http://www.google.com/m8/feeds/contacts/libgdata.test%40googlemail.com/base/1fe897fa0c51ed2c -< 2014-11-08T23:32:11.077Z -< 2014-11-08T23:32:11.077Z -< -< Toby -< -< -< -< -< Toby -< Brian -< -< -< -< http://www.google.com/m8/feeds/contacts/libgdata.test%40googlemail.com/base/2f943d4789cb93a9 -< 2014-03-15T21:25:43.388Z -< 2014-03-15T21:25:43.388Z -< -< AAA -< -< -< -< -< AAA -< AAA -< -< AAA -< -< -< FALSE -< -< -< http://www.google.com/m8/feeds/contacts/libgdata.test%40googlemail.com/base/3531fe820d6801f3 -< 2014-03-15T21:23:18.169Z -< 2014-03-15T21:23:18.169Z -< -< AAAA -< -< -< -< -< AAAA -< AAAA -< -< -< -< -< -< http://www.google.com/m8/feeds/contacts/libgdata.test%40googlemail.com/base/37c76f0508bed31f -< 2014-11-08T23:22:14.824Z -< 2014-11-08T23:22:14.824Z -< -< John Smith -< Notes -< -< -< -< -< John Smith -< John -< Smith -< -< Big J -< A. B. C. -< Jon -< Smith -< -< -< Professional bum -< Big J Enterprises, Ltd. -< 12km -< This is a server -< Charity work -< J, Big -< -< OrgCorp -< President -< -< -< -< -< (206)555-1212 -< (206)555-1213 -< -< 1600 Amphitheatre Pkwy Mountain View -< 1600 Amphitheatre Pkwy Mountain View -< -< -< -< -< -< Brian Haddock -< -< -< -< -< -< -< -< This is a jot. -< Rowing -< http://example.com/ -< -< -< http://www.google.com/m8/feeds/contacts/libgdata.test%40googlemail.com/base/3b0b0e8c8d6c81ef -< 2014-03-15T21:26:07.500Z -< 2014-03-15T21:26:07.500Z -< -< AAAAA -< -< -< -< -< AAAAA -< AAAAA -< -< -< -< -< -< http://www.google.com/m8/feeds/contacts/libgdata.test%40googlemail.com/base/415b6675090874ea -< 2014-11-08T23:26:54.532Z -< 2014-11-08T23:26:54.532Z -< -< Toby -< -< -< -< -< Toby -< Brian -< -< -< -< http://www.google.com/m8/feeds/contacts/libgdata.test%40googlemail.com/base/505ad8890cd2744a -< 2014-11-08T23:22:13.936Z -< 2014-11-08T23:22:13.936Z -< -< Toby -< -< -< -< -< Toby -< Brian -< -< -< -< http://www.google.com/m8/feeds/contacts/libgdata.test%40googlemail.com/base/5210ae648a3eda72 -< 2014-11-08T23:32:24.173Z -< 2014-11-08T23:32:24.173Z -< -< -< <link rel="http://schemas.google.com/contacts/2008/rel#photo" type="image/*" href="https://www.google.com/m8/feeds/photos/media/libgdata.test%40googlemail.com/5210ae648a3eda72"/> -< <link rel="self" type="application/atom+xml" href="https://www.google.com/m8/feeds/contacts/libgdata.test%40googlemail.com/full/5210ae648a3eda72"/> -< <link rel="edit" type="application/atom+xml" href="https://www.google.com/m8/feeds/contacts/libgdata.test%40googlemail.com/full/5210ae648a3eda72"/> -< <gContact:nickname>Test Contact 1</gContact:nickname> -< </entry> -< <entry gd:etag=""RXk_ezVSLit7I2A9XRdWFEUDQgA.""> -< <id>http://www.google.com/m8/feeds/contacts/libgdata.test%40googlemail.com/base/55877e440b373bc7</id> -< <updated>2014-11-08T23:32:24.743Z</updated> -< <app:edited xmlns:app="http://www.w3.org/2007/app">2014-11-08T23:32:24.743Z</app:edited> -< <category scheme="http://schemas.google.com/g/2005#kind" term="http://schemas.google.com/contact/2008#contact"/> -< <title/> -< <link rel="http://schemas.google.com/contacts/2008/rel#photo" type="image/*" href="https://www.google.com/m8/feeds/photos/media/libgdata.test%40googlemail.com/55877e440b373bc7"/> -< <link rel="self" type="application/atom+xml" href="https://www.google.com/m8/feeds/contacts/libgdata.test%40googlemail.com/full/55877e440b373bc7"/> -< <link rel="edit" type="application/atom+xml" href="https://www.google.com/m8/feeds/contacts/libgdata.test%40googlemail.com/full/55877e440b373bc7"/> -< <gContact:nickname>Test Contact 2</gContact:nickname> -< </entry> -< <entry gd:etag=""QnY4fDVSLyt7I2A9XRdWFEUDRgE.""> -< <id>http://www.google.com/m8/feeds/contacts/libgdata.test%40googlemail.com/base/65834f618a9f8743</id> -< <updated>2014-11-08T23:25:53.834Z</updated> -< <app:edited xmlns:app="http://www.w3.org/2007/app">2014-11-08T23:25:53.834Z</app:edited> -< <category scheme="http://schemas.google.com/g/2005#kind" term="http://schemas.google.com/contact/2008#contact"/> -< <title>Toby -< -< -< -< -< Toby -< Brian -< -< -< -< http://www.google.com/m8/feeds/contacts/libgdata.test%40googlemail.com/base/6754f9cf8cbc042d -< 2014-03-15T21:23:07.053Z -< 2014-03-15T21:23:07.053Z -< -< A -< -< -< -< -< A -< A -< -< A -< -< -< FALSE -< -< - diff --git a/gdata/tests/traces/contacts/query-all-contacts-async-progress-closure b/gdata/tests/traces/contacts/query-all-contacts-async-progress-closure deleted file mode 100644 index e2b7676d..00000000 --- a/gdata/tests/traces/contacts/query-all-contacts-async-progress-closure +++ /dev/null @@ -1,373 +0,0 @@ -> GET /m8/feeds/contacts/default/full HTTP/1.1 -> Soup-Debug-Timestamp: 1415489574 -> Soup-Debug: SoupSession 1 (0x15cd240), SoupMessage 36 (0x7ff43800ed50), SoupSocket 18 (0x7ff438057cc0) -> Host: www.google.com -> Authorization: Bearer ya29.uACgkznYPDckPkHNMU2MF2gRNGrNKqsjnalf5jZmQ0jV9jcp297YMiQop53msSbUJi5poX8LolhsSw -> GData-Version: 3 -> Accept-Encoding: gzip, deflate -> User-Agent: libgdata/0.17.0 - gzip -> Connection: Keep-Alive - -< HTTP/1.1 200 OK -< Soup-Debug-Timestamp: 1415489575 -< Soup-Debug: SoupMessage 36 (0x7ff43800ed50) -< Expires: Sat, 08 Nov 2014 23:32:55 GMT -< Date: Sat, 08 Nov 2014 23:32:55 GMT -< Cache-Control: private, max-age=0, must-revalidate, no-transform -< ETag: "RH89eTVSLyt7I2A9XRdWFEUDQgM." -< Vary: Origin -< Vary: Referer -< Vary: X-Origin -< Content-Type: application/atom+xml; charset=UTF-8 -< X-Content-Type-Options: nosniff -< X-Frame-Options: SAMEORIGIN -< X-XSS-Protection: 1; mode=block -< Server: GSE -< Content-Encoding: gzip -< Alternate-Protocol: 443:quic,p=0.01 -< Transfer-Encoding: chunked -< -< -< -< libgdata.test@googlemail.com -< 2014-11-08T23:32:55.161Z -< -< GData Test's Contacts -< -< -< -< -< -< -< GData Test -< libgdata.test@googlemail.com -< -< Contacts -< 16 -< 1 -< 25 -< -< http://www.google.com/m8/feeds/contacts/libgdata.test%40googlemail.com/base/a86b08c4621c7 -< 2014-03-15T21:25:22.682Z -< 2014-03-15T21:25:22.682Z -< -< AA -< -< -< -< -< AA -< AA -< -< AA -< -< -< FALSE -< -< -< http://www.google.com/m8/feeds/contacts/libgdata.test%40googlemail.com/base/10ba35c58c59d676 -< 2014-11-08T23:32:48.846Z -< 2014-11-08T23:32:48.846Z -< -< -< <link rel="http://schemas.google.com/contacts/2008/rel#photo" type="image/*" href="https://www.google.com/m8/feeds/photos/media/libgdata.test%40googlemail.com/10ba35c58c59d676"/> -< <link rel="self" type="application/atom+xml" href="https://www.google.com/m8/feeds/contacts/libgdata.test%40googlemail.com/full/10ba35c58c59d676"/> -< <link rel="edit" type="application/atom+xml" href="https://www.google.com/m8/feeds/contacts/libgdata.test%40googlemail.com/full/10ba35c58c59d676"/> -< <gContact:nickname>Test Contact 2</gContact:nickname> -< </entry> -< <entry gd:etag=""RHc4fzVSLit7I2A9Wh9VF0oPQAU.""> -< <id>http://www.google.com/m8/feeds/contacts/libgdata.test%40googlemail.com/base/1848d1b50ceff503</id> -< <updated>2014-04-06T09:15:15.937Z</updated> -< <app:edited xmlns:app="http://www.w3.org/2007/app">2014-04-06T09:15:15.937Z</app:edited> -< <category scheme="http://schemas.google.com/g/2005#kind" term="http://schemas.google.com/contact/2008#contact"/> -< <title>Test Mcfoobar -< -< -< -< -< Test Mcfoobar -< Test -< Mcfoobar -< -< Mcfoobar, Test -< -< -< FALSE -< -< -< http://www.google.com/m8/feeds/contacts/libgdata.test%40googlemail.com/base/186ec44a0fc1ca9d -< 2014-11-08T23:27:06.083Z -< 2014-11-08T23:27:06.083Z -< -< John Wilson -< -< -< -< -< John Wilson -< John -< Wilson -< -< Test Contact Esq. -< value -< -< -< http://www.google.com/m8/feeds/contacts/libgdata.test%40googlemail.com/base/1ebe29f48b9167e1 -< 2014-11-08T23:25:54.358Z -< 2014-11-08T23:25:54.358Z -< -< John Smith -< Notes -< -< -< -< -< John Smith -< John -< Smith -< -< Big J -< A. B. C. -< Jon -< Smith -< -< -< Professional bum -< Big J Enterprises, Ltd. -< 12km -< This is a server -< Charity work -< J, Big -< -< OrgCorp -< President -< -< -< -< -< (206)555-1212 -< (206)555-1213 -< -< 1600 Amphitheatre Pkwy Mountain View -< 1600 Amphitheatre Pkwy Mountain View -< -< -< -< -< -< Brian Haddock -< -< -< -< -< -< -< -< This is a jot. -< Rowing -< http://example.com/ -< -< -< http://www.google.com/m8/feeds/contacts/libgdata.test%40googlemail.com/base/1fb657e58c9a2eb9 -< 2014-11-08T23:32:48.589Z -< 2014-11-08T23:32:48.589Z -< -< -< <link rel="http://schemas.google.com/contacts/2008/rel#photo" type="image/*" href="https://www.google.com/m8/feeds/photos/media/libgdata.test%40googlemail.com/1fb657e58c9a2eb9"/> -< <link rel="self" type="application/atom+xml" href="https://www.google.com/m8/feeds/contacts/libgdata.test%40googlemail.com/full/1fb657e58c9a2eb9"/> -< <link rel="edit" type="application/atom+xml" href="https://www.google.com/m8/feeds/contacts/libgdata.test%40googlemail.com/full/1fb657e58c9a2eb9"/> -< <gContact:nickname>Test Contact 1</gContact:nickname> -< </entry> -< <entry gd:etag=""QH48fzVSLit7I2A9XRdWFEUDQgc.""> -< <id>http://www.google.com/m8/feeds/contacts/libgdata.test%40googlemail.com/base/1fe897fa0c51ed2c</id> -< <updated>2014-11-08T23:32:11.077Z</updated> -< <app:edited xmlns:app="http://www.w3.org/2007/app">2014-11-08T23:32:11.077Z</app:edited> -< <category scheme="http://schemas.google.com/g/2005#kind" term="http://schemas.google.com/contact/2008#contact"/> -< <title>Toby -< -< -< -< -< Toby -< Brian -< -< -< -< http://www.google.com/m8/feeds/contacts/libgdata.test%40googlemail.com/base/2f943d4789cb93a9 -< 2014-03-15T21:25:43.388Z -< 2014-03-15T21:25:43.388Z -< -< AAA -< -< -< -< -< AAA -< AAA -< -< AAA -< -< -< FALSE -< -< -< http://www.google.com/m8/feeds/contacts/libgdata.test%40googlemail.com/base/3531fe820d6801f3 -< 2014-03-15T21:23:18.169Z -< 2014-03-15T21:23:18.169Z -< -< AAAA -< -< -< -< -< AAAA -< AAAA -< -< -< -< -< -< http://www.google.com/m8/feeds/contacts/libgdata.test%40googlemail.com/base/37c76f0508bed31f -< 2014-11-08T23:22:14.824Z -< 2014-11-08T23:22:14.824Z -< -< John Smith -< Notes -< -< -< -< -< John Smith -< John -< Smith -< -< Big J -< A. B. C. -< Jon -< Smith -< -< -< Professional bum -< Big J Enterprises, Ltd. -< 12km -< This is a server -< Charity work -< J, Big -< -< OrgCorp -< President -< -< -< -< -< (206)555-1212 -< (206)555-1213 -< -< 1600 Amphitheatre Pkwy Mountain View -< 1600 Amphitheatre Pkwy Mountain View -< -< -< -< -< -< Brian Haddock -< -< -< -< -< -< -< -< This is a jot. -< Rowing -< http://example.com/ -< -< -< http://www.google.com/m8/feeds/contacts/libgdata.test%40googlemail.com/base/3b0b0e8c8d6c81ef -< 2014-03-15T21:26:07.500Z -< 2014-03-15T21:26:07.500Z -< -< AAAAA -< -< -< -< -< AAAAA -< AAAAA -< -< -< -< -< -< http://www.google.com/m8/feeds/contacts/libgdata.test%40googlemail.com/base/415b6675090874ea -< 2014-11-08T23:26:54.532Z -< 2014-11-08T23:26:54.532Z -< -< Toby -< -< -< -< -< Toby -< Brian -< -< -< -< http://www.google.com/m8/feeds/contacts/libgdata.test%40googlemail.com/base/505ad8890cd2744a -< 2014-11-08T23:22:13.936Z -< 2014-11-08T23:22:13.936Z -< -< Toby -< -< -< -< -< Toby -< Brian -< -< -< -< http://www.google.com/m8/feeds/contacts/libgdata.test%40googlemail.com/base/5997be300d23115b -< 2014-11-08T23:32:49.425Z -< 2014-11-08T23:32:49.425Z -< -< -< <link rel="http://schemas.google.com/contacts/2008/rel#photo" type="image/*" href="https://www.google.com/m8/feeds/photos/media/libgdata.test%40googlemail.com/5997be300d23115b"/> -< <link rel="self" type="application/atom+xml" href="https://www.google.com/m8/feeds/contacts/libgdata.test%40googlemail.com/full/5997be300d23115b"/> -< <link rel="edit" type="application/atom+xml" href="https://www.google.com/m8/feeds/contacts/libgdata.test%40googlemail.com/full/5997be300d23115b"/> -< <gContact:nickname>Test Contact 3</gContact:nickname> -< </entry> -< <entry gd:etag=""QnY4fDVSLyt7I2A9XRdWFEUDRgE.""> -< <id>http://www.google.com/m8/feeds/contacts/libgdata.test%40googlemail.com/base/65834f618a9f8743</id> -< <updated>2014-11-08T23:25:53.834Z</updated> -< <app:edited xmlns:app="http://www.w3.org/2007/app">2014-11-08T23:25:53.834Z</app:edited> -< <category scheme="http://schemas.google.com/g/2005#kind" term="http://schemas.google.com/contact/2008#contact"/> -< <title>Toby -< -< -< -< -< Toby -< Brian -< -< -< -< http://www.google.com/m8/feeds/contacts/libgdata.test%40googlemail.com/base/6754f9cf8cbc042d -< 2014-03-15T21:23:07.053Z -< 2014-03-15T21:23:07.053Z -< -< A -< -< -< -< -< A -< A -< -< A -< -< -< FALSE -< -< - diff --git a/gdata/tests/traces/contacts/query-all-groups b/gdata/tests/traces/contacts/query-all-groups deleted file mode 100644 index a7a5b5c0..00000000 --- a/gdata/tests/traces/contacts/query-all-groups +++ /dev/null @@ -1,166 +0,0 @@ -> GET /m8/feeds/groups/default/full HTTP/1.1 -> Soup-Debug-Timestamp: 1415490491 -> Soup-Debug: SoupSession 1 (0x1c05240), SoupMessage 18 (0x1ce9490), SoupSocket 10 (0x1e32c40) -> Host: www.google.com -> Authorization: Bearer ya29.uAB1RRhn3TKLPSfFZeRgrzf68-Gb9tby5F20urDCBwC6B94UqINs1Hvh_iKX3FagPwd0QkLnrSyVRw -> GData-Version: 3 -> Accept-Encoding: gzip, deflate -> User-Agent: libgdata/0.17.0 - gzip -> Connection: Keep-Alive - -< HTTP/1.1 200 OK -< Soup-Debug-Timestamp: 1415490491 -< Soup-Debug: SoupMessage 18 (0x1ce9490) -< Expires: Sat, 08 Nov 2014 23:48:11 GMT -< Date: Sat, 08 Nov 2014 23:48:11 GMT -< Cache-Control: private, max-age=0, must-revalidate, no-transform -< ETag: "QHo_cDVSLyt7I2A9XRdWFEQKQw0." -< Vary: Origin -< Vary: Referer -< Vary: X-Origin -< Content-Type: application/atom+xml; charset=UTF-8 -< X-Content-Type-Options: nosniff -< X-Frame-Options: SAMEORIGIN -< X-XSS-Protection: 1; mode=block -< Server: GSE -< Content-Encoding: gzip -< Alternate-Protocol: 443:quic,p=0.01 -< Transfer-Encoding: chunked -< -< -< -< libgdata.test@googlemail.com -< 2014-11-08T23:48:11.448Z -< -< GData Test's Contact Groups -< -< -< -< -< -< -< GData Test -< libgdata.test@googlemail.com -< -< Contacts -< 12 -< 1 -< 25 -< -< http://www.google.com/m8/feeds/groups/libgdata.test%40googlemail.com/base/6 -< 1970-01-01T00:00:00.000Z -< -< System Group: My Contacts -< System Group: My Contacts -< -< -< -< -< http://www.google.com/m8/feeds/groups/libgdata.test%40googlemail.com/base/d -< 1970-01-01T00:00:00.000Z -< -< System Group: Friends -< System Group: Friends -< -< -< -< -< http://www.google.com/m8/feeds/groups/libgdata.test%40googlemail.com/base/e -< 1970-01-01T00:00:00.000Z -< -< System Group: Family -< System Group: Family -< -< -< -< -< http://www.google.com/m8/feeds/groups/libgdata.test%40googlemail.com/base/f -< 1970-01-01T00:00:00.000Z -< -< System Group: Coworkers -< System Group: Coworkers -< -< -< -< -< http://www.google.com/m8/feeds/groups/libgdata.test%40googlemail.com/base/1d5fa390c9a7fe3 -< 2014-11-08T23:48:00.386Z -< 2014-11-08T23:48:00.386Z -< -< Test Group 1 -< Test Group 1 -< -< -< -< -< http://www.google.com/m8/feeds/groups/libgdata.test%40googlemail.com/base/218e0110860fcd3 -< 2014-11-08T23:48:01.067Z -< 2014-11-08T23:48:01.067Z -< -< Test Group 3 -< Test Group 3 -< -< -< -< -< http://www.google.com/m8/feeds/groups/libgdata.test%40googlemail.com/base/115d0c4d0cd6f616 -< 2014-03-15T21:02:14.665Z -< 2014-03-15T21:02:14.665Z -< -< D -< D -< -< -< -< -< http://www.google.com/m8/feeds/groups/libgdata.test%40googlemail.com/base/4558a0fc0f98a74a -< 2014-03-15T21:23:06.512Z -< 2014-03-15T21:23:06.512Z -< -< A -< A -< -< -< -< -< http://www.google.com/m8/feeds/groups/libgdata.test%40googlemail.com/base/52ccac800d63785b -< 2014-11-08T23:48:00.727Z -< 2014-11-08T23:48:00.727Z -< -< Test Group 2 -< Test Group 2 -< -< -< -< -< http://www.google.com/m8/feeds/groups/libgdata.test%40googlemail.com/base/5a5615828e8c12dc -< 2014-03-15T21:25:22.081Z -< 2014-03-15T21:25:22.081Z -< -< B -< B -< -< -< -< -< http://www.google.com/m8/feeds/groups/libgdata.test%40googlemail.com/base/5aa4ff9a0de39ade -< 2014-03-15T21:26:06.797Z -< 2014-03-15T21:26:06.797Z -< -< E -< E -< -< -< -< -< http://www.google.com/m8/feeds/groups/libgdata.test%40googlemail.com/base/7b25d4e38c3f32b5 -< 2014-03-15T21:25:42.847Z -< 2014-03-15T21:25:42.847Z -< -< C -< C -< -< -< -< - diff --git a/gdata/tests/traces/contacts/query-all-groups-async-progress-closure b/gdata/tests/traces/contacts/query-all-groups-async-progress-closure deleted file mode 100644 index ce045a4a..00000000 --- a/gdata/tests/traces/contacts/query-all-groups-async-progress-closure +++ /dev/null @@ -1,166 +0,0 @@ -> GET /m8/feeds/groups/default/full HTTP/1.1 -> Soup-Debug-Timestamp: 1415490527 -> Soup-Debug: SoupSession 1 (0x1c05240), SoupMessage 34 (0x7f451000f1d0), SoupSocket 17 (0x7f45100449c0) -> Host: www.google.com -> Authorization: Bearer ya29.uAB1RRhn3TKLPSfFZeRgrzf68-Gb9tby5F20urDCBwC6B94UqINs1Hvh_iKX3FagPwd0QkLnrSyVRw -> GData-Version: 3 -> Accept-Encoding: gzip, deflate -> User-Agent: libgdata/0.17.0 - gzip -> Connection: Keep-Alive - -< HTTP/1.1 200 OK -< Soup-Debug-Timestamp: 1415490527 -< Soup-Debug: SoupMessage 34 (0x7f451000f1d0) -< Expires: Sat, 08 Nov 2014 23:48:47 GMT -< Date: Sat, 08 Nov 2014 23:48:47 GMT -< Cache-Control: private, max-age=0, must-revalidate, no-transform -< ETag: "Rnc4fDVSLyt7I2A9XRdWFEQKQgY." -< Vary: Origin -< Vary: Referer -< Vary: X-Origin -< Content-Type: application/atom+xml; charset=UTF-8 -< X-Content-Type-Options: nosniff -< X-Frame-Options: SAMEORIGIN -< X-XSS-Protection: 1; mode=block -< Server: GSE -< Content-Encoding: gzip -< Alternate-Protocol: 443:quic,p=0.01 -< Transfer-Encoding: chunked -< -< -< -< libgdata.test@googlemail.com -< 2014-11-08T23:48:47.934Z -< -< GData Test's Contact Groups -< -< -< -< -< -< -< GData Test -< libgdata.test@googlemail.com -< -< Contacts -< 12 -< 1 -< 25 -< -< http://www.google.com/m8/feeds/groups/libgdata.test%40googlemail.com/base/6 -< 1970-01-01T00:00:00.000Z -< -< System Group: My Contacts -< System Group: My Contacts -< -< -< -< -< http://www.google.com/m8/feeds/groups/libgdata.test%40googlemail.com/base/d -< 1970-01-01T00:00:00.000Z -< -< System Group: Friends -< System Group: Friends -< -< -< -< -< http://www.google.com/m8/feeds/groups/libgdata.test%40googlemail.com/base/e -< 1970-01-01T00:00:00.000Z -< -< System Group: Family -< System Group: Family -< -< -< -< -< http://www.google.com/m8/feeds/groups/libgdata.test%40googlemail.com/base/f -< 1970-01-01T00:00:00.000Z -< -< System Group: Coworkers -< System Group: Coworkers -< -< -< -< -< http://www.google.com/m8/feeds/groups/libgdata.test%40googlemail.com/base/61d709b0a05798f -< 2014-11-08T23:48:37.192Z -< 2014-11-08T23:48:37.192Z -< -< Test Group 2 -< Test Group 2 -< -< -< -< -< http://www.google.com/m8/feeds/groups/libgdata.test%40googlemail.com/base/115d0c4d0cd6f616 -< 2014-03-15T21:02:14.665Z -< 2014-03-15T21:02:14.665Z -< -< D -< D -< -< -< -< -< http://www.google.com/m8/feeds/groups/libgdata.test%40googlemail.com/base/4558a0fc0f98a74a -< 2014-03-15T21:23:06.512Z -< 2014-03-15T21:23:06.512Z -< -< A -< A -< -< -< -< -< http://www.google.com/m8/feeds/groups/libgdata.test%40googlemail.com/base/5a5615828e8c12dc -< 2014-03-15T21:25:22.081Z -< 2014-03-15T21:25:22.081Z -< -< B -< B -< -< -< -< -< http://www.google.com/m8/feeds/groups/libgdata.test%40googlemail.com/base/5aa4ff9a0de39ade -< 2014-03-15T21:26:06.797Z -< 2014-03-15T21:26:06.797Z -< -< E -< E -< -< -< -< -< http://www.google.com/m8/feeds/groups/libgdata.test%40googlemail.com/base/6e75d86c0cd1b268 -< 2014-11-08T23:48:37.545Z -< 2014-11-08T23:48:37.545Z -< -< Test Group 3 -< Test Group 3 -< -< -< -< -< http://www.google.com/m8/feeds/groups/libgdata.test%40googlemail.com/base/7b25d4e38c3f32b5 -< 2014-03-15T21:25:42.847Z -< 2014-03-15T21:25:42.847Z -< -< C -< C -< -< -< -< -< http://www.google.com/m8/feeds/groups/libgdata.test%40googlemail.com/base/7c4fb3b60a62383b -< 2014-11-08T23:48:36.540Z -< 2014-11-08T23:48:36.540Z -< -< Test Group 1 -< Test Group 1 -< -< -< -< - diff --git a/gdata/tests/traces/contacts/query_all_contacts-async b/gdata/tests/traces/contacts/query_all_contacts-async deleted file mode 100644 index 85aa87c0..00000000 --- a/gdata/tests/traces/contacts/query_all_contacts-async +++ /dev/null @@ -1,373 +0,0 @@ -> GET /m8/feeds/contacts/default/full HTTP/1.1 -> Soup-Debug-Timestamp: 1415489558 -> Soup-Debug: SoupSession 1 (0x15cd240), SoupMessage 20 (0x182f640), SoupSocket 11 (0x18d59a0) -> Host: www.google.com -> Authorization: Bearer ya29.uACgkznYPDckPkHNMU2MF2gRNGrNKqsjnalf5jZmQ0jV9jcp297YMiQop53msSbUJi5poX8LolhsSw -> GData-Version: 3 -> Accept-Encoding: gzip, deflate -> User-Agent: libgdata/0.17.0 - gzip -> Connection: Keep-Alive - -< HTTP/1.1 200 OK -< Soup-Debug-Timestamp: 1415489558 -< Soup-Debug: SoupMessage 20 (0x182f640) -< Expires: Sat, 08 Nov 2014 23:32:38 GMT -< Date: Sat, 08 Nov 2014 23:32:38 GMT -< Cache-Control: private, max-age=0, must-revalidate, no-transform -< ETag: "SXg9fTVSLyt7I2A9XRdWFEUDQgE." -< Vary: Origin -< Vary: Referer -< Vary: X-Origin -< Content-Type: application/atom+xml; charset=UTF-8 -< X-Content-Type-Options: nosniff -< X-Frame-Options: SAMEORIGIN -< X-XSS-Protection: 1; mode=block -< Server: GSE -< Content-Encoding: gzip -< Alternate-Protocol: 443:quic,p=0.01 -< Transfer-Encoding: chunked -< -< -< -< libgdata.test@googlemail.com -< 2014-11-08T23:32:38.665Z -< -< GData Test's Contacts -< -< -< -< -< -< -< GData Test -< libgdata.test@googlemail.com -< -< Contacts -< 16 -< 1 -< 25 -< -< http://www.google.com/m8/feeds/contacts/libgdata.test%40googlemail.com/base/a86b08c4621c7 -< 2014-03-15T21:25:22.682Z -< 2014-03-15T21:25:22.682Z -< -< AA -< -< -< -< -< AA -< AA -< -< AA -< -< -< FALSE -< -< -< http://www.google.com/m8/feeds/contacts/libgdata.test%40googlemail.com/base/1848d1b50ceff503 -< 2014-04-06T09:15:15.937Z -< 2014-04-06T09:15:15.937Z -< -< Test Mcfoobar -< -< -< -< -< Test Mcfoobar -< Test -< Mcfoobar -< -< Mcfoobar, Test -< -< -< FALSE -< -< -< http://www.google.com/m8/feeds/contacts/libgdata.test%40googlemail.com/base/186ec44a0fc1ca9d -< 2014-11-08T23:27:06.083Z -< 2014-11-08T23:27:06.083Z -< -< John Wilson -< -< -< -< -< John Wilson -< John -< Wilson -< -< Test Contact Esq. -< value -< -< -< http://www.google.com/m8/feeds/contacts/libgdata.test%40googlemail.com/base/1ded2e498d3e6d35 -< 2014-11-08T23:32:33.247Z -< 2014-11-08T23:32:33.247Z -< -< -< <link rel="http://schemas.google.com/contacts/2008/rel#photo" type="image/*" href="https://www.google.com/m8/feeds/photos/media/libgdata.test%40googlemail.com/1ded2e498d3e6d35"/> -< <link rel="self" type="application/atom+xml" href="https://www.google.com/m8/feeds/contacts/libgdata.test%40googlemail.com/full/1ded2e498d3e6d35"/> -< <link rel="edit" type="application/atom+xml" href="https://www.google.com/m8/feeds/contacts/libgdata.test%40googlemail.com/full/1ded2e498d3e6d35"/> -< <gContact:nickname>Test Contact 3</gContact:nickname> -< </entry> -< <entry gd:etag=""RX0-cDVSLit7I2A9XRdWFEUDRgE.""> -< <id>http://www.google.com/m8/feeds/contacts/libgdata.test%40googlemail.com/base/1ebe29f48b9167e1</id> -< <updated>2014-11-08T23:25:54.358Z</updated> -< <app:edited xmlns:app="http://www.w3.org/2007/app">2014-11-08T23:25:54.358Z</app:edited> -< <category scheme="http://schemas.google.com/g/2005#kind" term="http://schemas.google.com/contact/2008#contact"/> -< <title>John Smith -< Notes -< -< -< -< -< John Smith -< John -< Smith -< -< Big J -< A. B. C. -< Jon -< Smith -< -< -< Professional bum -< Big J Enterprises, Ltd. -< 12km -< This is a server -< Charity work -< J, Big -< -< OrgCorp -< President -< -< -< -< -< (206)555-1212 -< (206)555-1213 -< -< 1600 Amphitheatre Pkwy Mountain View -< 1600 Amphitheatre Pkwy Mountain View -< -< -< -< -< -< Brian Haddock -< -< -< -< -< -< -< -< This is a jot. -< Rowing -< http://example.com/ -< -< -< http://www.google.com/m8/feeds/contacts/libgdata.test%40googlemail.com/base/1fe897fa0c51ed2c -< 2014-11-08T23:32:11.077Z -< 2014-11-08T23:32:11.077Z -< -< Toby -< -< -< -< -< Toby -< Brian -< -< -< -< http://www.google.com/m8/feeds/contacts/libgdata.test%40googlemail.com/base/29c0dbee0da884ed -< 2014-11-08T23:32:32.055Z -< 2014-11-08T23:32:32.055Z -< -< -< <link rel="http://schemas.google.com/contacts/2008/rel#photo" type="image/*" href="https://www.google.com/m8/feeds/photos/media/libgdata.test%40googlemail.com/29c0dbee0da884ed"/> -< <link rel="self" type="application/atom+xml" href="https://www.google.com/m8/feeds/contacts/libgdata.test%40googlemail.com/full/29c0dbee0da884ed"/> -< <link rel="edit" type="application/atom+xml" href="https://www.google.com/m8/feeds/contacts/libgdata.test%40googlemail.com/full/29c0dbee0da884ed"/> -< <gContact:nickname>Test Contact 1</gContact:nickname> -< </entry> -< <entry gd:etag=""Qn0zcDVSLit7I2A9Wh9XGUwCQAA.""> -< <id>http://www.google.com/m8/feeds/contacts/libgdata.test%40googlemail.com/base/2f943d4789cb93a9</id> -< <updated>2014-03-15T21:25:43.388Z</updated> -< <app:edited xmlns:app="http://www.w3.org/2007/app">2014-03-15T21:25:43.388Z</app:edited> -< <category scheme="http://schemas.google.com/g/2005#kind" term="http://schemas.google.com/contact/2008#contact"/> -< <title>AAA -< -< -< -< -< AAA -< AAA -< -< AAA -< -< -< FALSE -< -< -< http://www.google.com/m8/feeds/contacts/libgdata.test%40googlemail.com/base/3531fe820d6801f3 -< 2014-03-15T21:23:18.169Z -< 2014-03-15T21:23:18.169Z -< -< AAAA -< -< -< -< -< AAAA -< AAAA -< -< -< -< -< -< http://www.google.com/m8/feeds/contacts/libgdata.test%40googlemail.com/base/37c76f0508bed31f -< 2014-11-08T23:22:14.824Z -< 2014-11-08T23:22:14.824Z -< -< John Smith -< Notes -< -< -< -< -< John Smith -< John -< Smith -< -< Big J -< A. B. C. -< Jon -< Smith -< -< -< Professional bum -< Big J Enterprises, Ltd. -< 12km -< This is a server -< Charity work -< J, Big -< -< OrgCorp -< President -< -< -< -< -< (206)555-1212 -< (206)555-1213 -< -< 1600 Amphitheatre Pkwy Mountain View -< 1600 Amphitheatre Pkwy Mountain View -< -< -< -< -< -< Brian Haddock -< -< -< -< -< -< -< -< This is a jot. -< Rowing -< http://example.com/ -< -< -< http://www.google.com/m8/feeds/contacts/libgdata.test%40googlemail.com/base/3b0b0e8c8d6c81ef -< 2014-03-15T21:26:07.500Z -< 2014-03-15T21:26:07.500Z -< -< AAAAA -< -< -< -< -< AAAAA -< AAAAA -< -< -< -< -< -< http://www.google.com/m8/feeds/contacts/libgdata.test%40googlemail.com/base/415b6675090874ea -< 2014-11-08T23:26:54.532Z -< 2014-11-08T23:26:54.532Z -< -< Toby -< -< -< -< -< Toby -< Brian -< -< -< -< http://www.google.com/m8/feeds/contacts/libgdata.test%40googlemail.com/base/505ad8890cd2744a -< 2014-11-08T23:22:13.936Z -< 2014-11-08T23:22:13.936Z -< -< Toby -< -< -< -< -< Toby -< Brian -< -< -< -< http://www.google.com/m8/feeds/contacts/libgdata.test%40googlemail.com/base/514bdf588ee57f55 -< 2014-11-08T23:32:32.611Z -< 2014-11-08T23:32:32.611Z -< -< -< <link rel="http://schemas.google.com/contacts/2008/rel#photo" type="image/*" href="https://www.google.com/m8/feeds/photos/media/libgdata.test%40googlemail.com/514bdf588ee57f55"/> -< <link rel="self" type="application/atom+xml" href="https://www.google.com/m8/feeds/contacts/libgdata.test%40googlemail.com/full/514bdf588ee57f55"/> -< <link rel="edit" type="application/atom+xml" href="https://www.google.com/m8/feeds/contacts/libgdata.test%40googlemail.com/full/514bdf588ee57f55"/> -< <gContact:nickname>Test Contact 2</gContact:nickname> -< </entry> -< <entry gd:etag=""QnY4fDVSLyt7I2A9XRdWFEUDRgE.""> -< <id>http://www.google.com/m8/feeds/contacts/libgdata.test%40googlemail.com/base/65834f618a9f8743</id> -< <updated>2014-11-08T23:25:53.834Z</updated> -< <app:edited xmlns:app="http://www.w3.org/2007/app">2014-11-08T23:25:53.834Z</app:edited> -< <category scheme="http://schemas.google.com/g/2005#kind" term="http://schemas.google.com/contact/2008#contact"/> -< <title>Toby -< -< -< -< -< Toby -< Brian -< -< -< -< http://www.google.com/m8/feeds/contacts/libgdata.test%40googlemail.com/base/6754f9cf8cbc042d -< 2014-03-15T21:23:07.053Z -< 2014-03-15T21:23:07.053Z -< -< A -< -< -< -< -< A -< A -< -< A -< -< -< FALSE -< -< - diff --git a/gdata/tests/traces/contacts/query_all_contacts-async-cancellation b/gdata/tests/traces/contacts/query_all_contacts-async-cancellation deleted file mode 100644 index 658c9743..00000000 --- a/gdata/tests/traces/contacts/query_all_contacts-async-cancellation +++ /dev/null @@ -1,373 +0,0 @@ -> GET /m8/feeds/contacts/default/full HTTP/1.1 -> Soup-Debug-Timestamp: 1415489567 -> Soup-Debug: SoupSession 1 (0x15cd240), SoupMessage 29 (0x7ff43800ec60), SoupSocket 15 (0x7ff4380578b0) -> Host: www.google.com -> Authorization: Bearer ya29.uACgkznYPDckPkHNMU2MF2gRNGrNKqsjnalf5jZmQ0jV9jcp297YMiQop53msSbUJi5poX8LolhsSw -> GData-Version: 3 -> Accept-Encoding: gzip, deflate -> User-Agent: libgdata/0.17.0 - gzip -> Connection: Keep-Alive - -< HTTP/1.1 200 OK -< Soup-Debug-Timestamp: 1415489567 -< Soup-Debug: SoupMessage 29 (0x7ff43800ec60) -< Expires: Sat, 08 Nov 2014 23:32:47 GMT -< Date: Sat, 08 Nov 2014 23:32:47 GMT -< Cache-Control: private, max-age=0, must-revalidate, no-transform -< ETag: "Rn08eDVSLyt7I2A9XRdWFEUDQgI." -< Vary: Origin -< Vary: Referer -< Vary: X-Origin -< Content-Type: application/atom+xml; charset=UTF-8 -< X-Content-Type-Options: nosniff -< X-Frame-Options: SAMEORIGIN -< X-XSS-Protection: 1; mode=block -< Server: GSE -< Content-Encoding: gzip -< Alternate-Protocol: 443:quic,p=0.01 -< Transfer-Encoding: chunked -< -< -< -< libgdata.test@googlemail.com -< 2014-11-08T23:32:47.370Z -< -< GData Test's Contacts -< -< -< -< -< -< -< GData Test -< libgdata.test@googlemail.com -< -< Contacts -< 16 -< 1 -< 25 -< -< http://www.google.com/m8/feeds/contacts/libgdata.test%40googlemail.com/base/a86b08c4621c7 -< 2014-03-15T21:25:22.682Z -< 2014-03-15T21:25:22.682Z -< -< AA -< -< -< -< -< AA -< AA -< -< AA -< -< -< FALSE -< -< -< http://www.google.com/m8/feeds/contacts/libgdata.test%40googlemail.com/base/e122bb38b3b8e3d -< 2014-11-08T23:32:41.003Z -< 2014-11-08T23:32:41.003Z -< -< -< <link rel="http://schemas.google.com/contacts/2008/rel#photo" type="image/*" href="https://www.google.com/m8/feeds/photos/media/libgdata.test%40googlemail.com/e122bb38b3b8e3d"/> -< <link rel="self" type="application/atom+xml" href="https://www.google.com/m8/feeds/contacts/libgdata.test%40googlemail.com/full/e122bb38b3b8e3d"/> -< <link rel="edit" type="application/atom+xml" href="https://www.google.com/m8/feeds/contacts/libgdata.test%40googlemail.com/full/e122bb38b3b8e3d"/> -< <gContact:nickname>Test Contact 3</gContact:nickname> -< </entry> -< <entry gd:etag=""RHc4fzVSLit7I2A9Wh9VF0oPQAU.""> -< <id>http://www.google.com/m8/feeds/contacts/libgdata.test%40googlemail.com/base/1848d1b50ceff503</id> -< <updated>2014-04-06T09:15:15.937Z</updated> -< <app:edited xmlns:app="http://www.w3.org/2007/app">2014-04-06T09:15:15.937Z</app:edited> -< <category scheme="http://schemas.google.com/g/2005#kind" term="http://schemas.google.com/contact/2008#contact"/> -< <title>Test Mcfoobar -< -< -< -< -< Test Mcfoobar -< Test -< Mcfoobar -< -< Mcfoobar, Test -< -< -< FALSE -< -< -< http://www.google.com/m8/feeds/contacts/libgdata.test%40googlemail.com/base/186ec44a0fc1ca9d -< 2014-11-08T23:27:06.083Z -< 2014-11-08T23:27:06.083Z -< -< John Wilson -< -< -< -< -< John Wilson -< John -< Wilson -< -< Test Contact Esq. -< value -< -< -< http://www.google.com/m8/feeds/contacts/libgdata.test%40googlemail.com/base/1b017a9e0aab84a8 -< 2014-11-08T23:32:40.681Z -< 2014-11-08T23:32:40.681Z -< -< -< <link rel="http://schemas.google.com/contacts/2008/rel#photo" type="image/*" href="https://www.google.com/m8/feeds/photos/media/libgdata.test%40googlemail.com/1b017a9e0aab84a8"/> -< <link rel="self" type="application/atom+xml" href="https://www.google.com/m8/feeds/contacts/libgdata.test%40googlemail.com/full/1b017a9e0aab84a8"/> -< <link rel="edit" type="application/atom+xml" href="https://www.google.com/m8/feeds/contacts/libgdata.test%40googlemail.com/full/1b017a9e0aab84a8"/> -< <gContact:nickname>Test Contact 2</gContact:nickname> -< </entry> -< <entry gd:etag=""RX0-cDVSLit7I2A9XRdWFEUDRgE.""> -< <id>http://www.google.com/m8/feeds/contacts/libgdata.test%40googlemail.com/base/1ebe29f48b9167e1</id> -< <updated>2014-11-08T23:25:54.358Z</updated> -< <app:edited xmlns:app="http://www.w3.org/2007/app">2014-11-08T23:25:54.358Z</app:edited> -< <category scheme="http://schemas.google.com/g/2005#kind" term="http://schemas.google.com/contact/2008#contact"/> -< <title>John Smith -< Notes -< -< -< -< -< John Smith -< John -< Smith -< -< Big J -< A. B. C. -< Jon -< Smith -< -< -< Professional bum -< Big J Enterprises, Ltd. -< 12km -< This is a server -< Charity work -< J, Big -< -< OrgCorp -< President -< -< -< -< -< (206)555-1212 -< (206)555-1213 -< -< 1600 Amphitheatre Pkwy Mountain View -< 1600 Amphitheatre Pkwy Mountain View -< -< -< -< -< -< Brian Haddock -< -< -< -< -< -< -< -< This is a jot. -< Rowing -< http://example.com/ -< -< -< http://www.google.com/m8/feeds/contacts/libgdata.test%40googlemail.com/base/1fe897fa0c51ed2c -< 2014-11-08T23:32:11.077Z -< 2014-11-08T23:32:11.077Z -< -< Toby -< -< -< -< -< Toby -< Brian -< -< -< -< http://www.google.com/m8/feeds/contacts/libgdata.test%40googlemail.com/base/2f943d4789cb93a9 -< 2014-03-15T21:25:43.388Z -< 2014-03-15T21:25:43.388Z -< -< AAA -< -< -< -< -< AAA -< AAA -< -< AAA -< -< -< FALSE -< -< -< http://www.google.com/m8/feeds/contacts/libgdata.test%40googlemail.com/base/3531fe820d6801f3 -< 2014-03-15T21:23:18.169Z -< 2014-03-15T21:23:18.169Z -< -< AAAA -< -< -< -< -< AAAA -< AAAA -< -< -< -< -< -< http://www.google.com/m8/feeds/contacts/libgdata.test%40googlemail.com/base/37c76f0508bed31f -< 2014-11-08T23:22:14.824Z -< 2014-11-08T23:22:14.824Z -< -< John Smith -< Notes -< -< -< -< -< John Smith -< John -< Smith -< -< Big J -< A. B. C. -< Jon -< Smith -< -< -< Professional bum -< Big J Enterprises, Ltd. -< 12km -< This is a server -< Charity work -< J, Big -< -< OrgCorp -< President -< -< -< -< -< (206)555-1212 -< (206)555-1213 -< -< 1600 Amphitheatre Pkwy Mountain View -< 1600 Amphitheatre Pkwy Mountain View -< -< -< -< -< -< Brian Haddock -< -< -< -< -< -< -< -< This is a jot. -< Rowing -< http://example.com/ -< -< -< http://www.google.com/m8/feeds/contacts/libgdata.test%40googlemail.com/base/3b0b0e8c8d6c81ef -< 2014-03-15T21:26:07.500Z -< 2014-03-15T21:26:07.500Z -< -< AAAAA -< -< -< -< -< AAAAA -< AAAAA -< -< -< -< -< -< http://www.google.com/m8/feeds/contacts/libgdata.test%40googlemail.com/base/415b6675090874ea -< 2014-11-08T23:26:54.532Z -< 2014-11-08T23:26:54.532Z -< -< Toby -< -< -< -< -< Toby -< Brian -< -< -< -< http://www.google.com/m8/feeds/contacts/libgdata.test%40googlemail.com/base/505ad8890cd2744a -< 2014-11-08T23:22:13.936Z -< 2014-11-08T23:22:13.936Z -< -< Toby -< -< -< -< -< Toby -< Brian -< -< -< -< http://www.google.com/m8/feeds/contacts/libgdata.test%40googlemail.com/base/63644dd68c0e95be -< 2014-11-08T23:32:40.068Z -< 2014-11-08T23:32:40.068Z -< -< -< <link rel="http://schemas.google.com/contacts/2008/rel#photo" type="image/*" href="https://www.google.com/m8/feeds/photos/media/libgdata.test%40googlemail.com/63644dd68c0e95be"/> -< <link rel="self" type="application/atom+xml" href="https://www.google.com/m8/feeds/contacts/libgdata.test%40googlemail.com/full/63644dd68c0e95be"/> -< <link rel="edit" type="application/atom+xml" href="https://www.google.com/m8/feeds/contacts/libgdata.test%40googlemail.com/full/63644dd68c0e95be"/> -< <gContact:nickname>Test Contact 1</gContact:nickname> -< </entry> -< <entry gd:etag=""QnY4fDVSLyt7I2A9XRdWFEUDRgE.""> -< <id>http://www.google.com/m8/feeds/contacts/libgdata.test%40googlemail.com/base/65834f618a9f8743</id> -< <updated>2014-11-08T23:25:53.834Z</updated> -< <app:edited xmlns:app="http://www.w3.org/2007/app">2014-11-08T23:25:53.834Z</app:edited> -< <category scheme="http://schemas.google.com/g/2005#kind" term="http://schemas.google.com/contact/2008#contact"/> -< <title>Toby -< -< -< -< -< Toby -< Brian -< -< -< -< http://www.google.com/m8/feeds/contacts/libgdata.test%40googlemail.com/base/6754f9cf8cbc042d -< 2014-03-15T21:23:07.053Z -< 2014-03-15T21:23:07.053Z -< -< A -< -< -< -< -< A -< A -< -< A -< -< -< FALSE -< -< - diff --git a/gdata/tests/traces/contacts/query_all_groups-async b/gdata/tests/traces/contacts/query_all_groups-async deleted file mode 100644 index bd551c7f..00000000 --- a/gdata/tests/traces/contacts/query_all_groups-async +++ /dev/null @@ -1,166 +0,0 @@ -> GET /m8/feeds/groups/default/full HTTP/1.1 -> Soup-Debug-Timestamp: 1415490515 -> Soup-Debug: SoupSession 1 (0x1c05240), SoupMessage 27 (0x7f451000f0e0), SoupSocket 14 (0x7f4510044d00) -> Host: www.google.com -> Authorization: Bearer ya29.uAB1RRhn3TKLPSfFZeRgrzf68-Gb9tby5F20urDCBwC6B94UqINs1Hvh_iKX3FagPwd0QkLnrSyVRw -> GData-Version: 3 -> Accept-Encoding: gzip, deflate -> User-Agent: libgdata/0.17.0 - gzip -> Connection: Keep-Alive - -< HTTP/1.1 200 OK -< Soup-Debug-Timestamp: 1415490515 -< Soup-Debug: SoupMessage 27 (0x7f451000f0e0) -< Expires: Sat, 08 Nov 2014 23:48:35 GMT -< Date: Sat, 08 Nov 2014 23:48:35 GMT -< Cache-Control: private, max-age=0, must-revalidate, no-transform -< ETag: "RHo5fjVSLyt7I2A9XRdWFEQKQgU." -< Vary: Origin -< Vary: Referer -< Vary: X-Origin -< Content-Type: application/atom+xml; charset=UTF-8 -< X-Content-Type-Options: nosniff -< X-Frame-Options: SAMEORIGIN -< X-XSS-Protection: 1; mode=block -< Server: GSE -< Content-Encoding: gzip -< Alternate-Protocol: 443:quic,p=0.01 -< Transfer-Encoding: chunked -< -< -< -< libgdata.test@googlemail.com -< 2014-11-08T23:48:35.426Z -< -< GData Test's Contact Groups -< -< -< -< -< -< -< GData Test -< libgdata.test@googlemail.com -< -< Contacts -< 12 -< 1 -< 25 -< -< http://www.google.com/m8/feeds/groups/libgdata.test%40googlemail.com/base/6 -< 1970-01-01T00:00:00.000Z -< -< System Group: My Contacts -< System Group: My Contacts -< -< -< -< -< http://www.google.com/m8/feeds/groups/libgdata.test%40googlemail.com/base/d -< 1970-01-01T00:00:00.000Z -< -< System Group: Friends -< System Group: Friends -< -< -< -< -< http://www.google.com/m8/feeds/groups/libgdata.test%40googlemail.com/base/e -< 1970-01-01T00:00:00.000Z -< -< System Group: Family -< System Group: Family -< -< -< -< -< http://www.google.com/m8/feeds/groups/libgdata.test%40googlemail.com/base/f -< 1970-01-01T00:00:00.000Z -< -< System Group: Coworkers -< System Group: Coworkers -< -< -< -< -< http://www.google.com/m8/feeds/groups/libgdata.test%40googlemail.com/base/5dce2cb8ad0779c -< 2014-11-08T23:48:24.551Z -< 2014-11-08T23:48:24.551Z -< -< Test Group 2 -< Test Group 2 -< -< -< -< -< http://www.google.com/m8/feeds/groups/libgdata.test%40googlemail.com/base/cb554230816ff25 -< 2014-11-08T23:48:23.754Z -< 2014-11-08T23:48:23.754Z -< -< Test Group 1 -< Test Group 1 -< -< -< -< -< http://www.google.com/m8/feeds/groups/libgdata.test%40googlemail.com/base/115d0c4d0cd6f616 -< 2014-03-15T21:02:14.665Z -< 2014-03-15T21:02:14.665Z -< -< D -< D -< -< -< -< -< http://www.google.com/m8/feeds/groups/libgdata.test%40googlemail.com/base/3afd35230e8b293a -< 2014-11-08T23:48:24.957Z -< 2014-11-08T23:48:24.957Z -< -< Test Group 3 -< Test Group 3 -< -< -< -< -< http://www.google.com/m8/feeds/groups/libgdata.test%40googlemail.com/base/4558a0fc0f98a74a -< 2014-03-15T21:23:06.512Z -< 2014-03-15T21:23:06.512Z -< -< A -< A -< -< -< -< -< http://www.google.com/m8/feeds/groups/libgdata.test%40googlemail.com/base/5a5615828e8c12dc -< 2014-03-15T21:25:22.081Z -< 2014-03-15T21:25:22.081Z -< -< B -< B -< -< -< -< -< http://www.google.com/m8/feeds/groups/libgdata.test%40googlemail.com/base/5aa4ff9a0de39ade -< 2014-03-15T21:26:06.797Z -< 2014-03-15T21:26:06.797Z -< -< E -< E -< -< -< -< -< http://www.google.com/m8/feeds/groups/libgdata.test%40googlemail.com/base/7b25d4e38c3f32b5 -< 2014-03-15T21:25:42.847Z -< 2014-03-15T21:25:42.847Z -< -< C -< C -< -< -< -< - diff --git a/gdata/tests/traces/contacts/query_all_groups-async-cancellation b/gdata/tests/traces/contacts/query_all_groups-async-cancellation deleted file mode 100644 index 45b1e261..00000000 --- a/gdata/tests/traces/contacts/query_all_groups-async-cancellation +++ /dev/null @@ -1,166 +0,0 @@ -> GET /m8/feeds/groups/default/full HTTP/1.1 -> Soup-Debug-Timestamp: 1415490540 -> Soup-Debug: SoupSession 1 (0x1c05240), SoupMessage 43 (0x7f451000f590), SoupSocket 21 (0x7f4510044ea0) -> Host: www.google.com -> Authorization: Bearer ya29.uAB1RRhn3TKLPSfFZeRgrzf68-Gb9tby5F20urDCBwC6B94UqINs1Hvh_iKX3FagPwd0QkLnrSyVRw -> GData-Version: 3 -> Accept-Encoding: gzip, deflate -> User-Agent: libgdata/0.17.0 - gzip -> Connection: Keep-Alive - -< HTTP/1.1 200 OK -< Soup-Debug-Timestamp: 1415490541 -< Soup-Debug: SoupMessage 43 (0x7f451000f590) -< Expires: Sat, 08 Nov 2014 23:49:01 GMT -< Date: Sat, 08 Nov 2014 23:49:01 GMT -< Cache-Control: private, max-age=0, must-revalidate, no-transform -< ETag: "QH44ejVSLyt7I2A9XRdWFEQKQgA." -< Vary: Origin -< Vary: Referer -< Vary: X-Origin -< Content-Type: application/atom+xml; charset=UTF-8 -< X-Content-Type-Options: nosniff -< X-Frame-Options: SAMEORIGIN -< X-XSS-Protection: 1; mode=block -< Server: GSE -< Content-Encoding: gzip -< Alternate-Protocol: 443:quic,p=0.01 -< Transfer-Encoding: chunked -< -< -< -< libgdata.test@googlemail.com -< 2014-11-08T23:49:01.032Z -< -< GData Test's Contact Groups -< -< -< -< -< -< -< GData Test -< libgdata.test@googlemail.com -< -< Contacts -< 12 -< 1 -< 25 -< -< http://www.google.com/m8/feeds/groups/libgdata.test%40googlemail.com/base/6 -< 1970-01-01T00:00:00.000Z -< -< System Group: My Contacts -< System Group: My Contacts -< -< -< -< -< http://www.google.com/m8/feeds/groups/libgdata.test%40googlemail.com/base/d -< 1970-01-01T00:00:00.000Z -< -< System Group: Friends -< System Group: Friends -< -< -< -< -< http://www.google.com/m8/feeds/groups/libgdata.test%40googlemail.com/base/e -< 1970-01-01T00:00:00.000Z -< -< System Group: Family -< System Group: Family -< -< -< -< -< http://www.google.com/m8/feeds/groups/libgdata.test%40googlemail.com/base/f -< 1970-01-01T00:00:00.000Z -< -< System Group: Coworkers -< System Group: Coworkers -< -< -< -< -< http://www.google.com/m8/feeds/groups/libgdata.test%40googlemail.com/base/115d0c4d0cd6f616 -< 2014-03-15T21:02:14.665Z -< 2014-03-15T21:02:14.665Z -< -< D -< D -< -< -< -< -< http://www.google.com/m8/feeds/groups/libgdata.test%40googlemail.com/base/3bc435e78bb3779c -< 2014-11-08T23:48:49.839Z -< 2014-11-08T23:48:49.839Z -< -< Test Group 3 -< Test Group 3 -< -< -< -< -< http://www.google.com/m8/feeds/groups/libgdata.test%40googlemail.com/base/4558a0fc0f98a74a -< 2014-03-15T21:23:06.512Z -< 2014-03-15T21:23:06.512Z -< -< A -< A -< -< -< -< -< http://www.google.com/m8/feeds/groups/libgdata.test%40googlemail.com/base/53135b0d89099ac5 -< 2014-11-08T23:48:49.032Z -< 2014-11-08T23:48:49.032Z -< -< Test Group 1 -< Test Group 1 -< -< -< -< -< http://www.google.com/m8/feeds/groups/libgdata.test%40googlemail.com/base/5a5615828e8c12dc -< 2014-03-15T21:25:22.081Z -< 2014-03-15T21:25:22.081Z -< -< B -< B -< -< -< -< -< http://www.google.com/m8/feeds/groups/libgdata.test%40googlemail.com/base/5aa4ff9a0de39ade -< 2014-03-15T21:26:06.797Z -< 2014-03-15T21:26:06.797Z -< -< E -< E -< -< -< -< -< http://www.google.com/m8/feeds/groups/libgdata.test%40googlemail.com/base/732309600b1cf616 -< 2014-11-08T23:48:49.403Z -< 2014-11-08T23:48:49.403Z -< -< Test Group 2 -< Test Group 2 -< -< -< -< -< http://www.google.com/m8/feeds/groups/libgdata.test%40googlemail.com/base/7b25d4e38c3f32b5 -< 2014-03-15T21:25:42.847Z -< 2014-03-15T21:25:42.847Z -< -< C -< C -< -< -< -< - diff --git a/gdata/tests/traces/contacts/setup-batch-async b/gdata/tests/traces/contacts/setup-batch-async deleted file mode 100644 index 01419e0e..00000000 --- a/gdata/tests/traces/contacts/setup-batch-async +++ /dev/null @@ -1,49 +0,0 @@ -> POST /m8/feeds/contacts/default/full HTTP/1.1 -> Soup-Debug-Timestamp: 1415490479 -> Soup-Debug: SoupSession 1 (0x1c05240), SoupMessage 13 (0x1ce90d0), SoupSocket 7 (0x1e32c40) -> Host: www.google.com -> Authorization: Bearer ya29.uAB1RRhn3TKLPSfFZeRgrzf68-Gb9tby5F20urDCBwC6B94UqINs1Hvh_iKX3FagPwd0QkLnrSyVRw -> GData-Version: 3 -> Content-Type: application/atom+xml -> Accept-Encoding: gzip, deflate -> User-Agent: libgdata/0.17.0 - gzip -> Connection: Keep-Alive -> -> Fooish BarFooish Bar - -< HTTP/1.1 201 Created -< Soup-Debug-Timestamp: 1415490479 -< Soup-Debug: SoupMessage 13 (0x1ce90d0) -< ETag: "SHk8cTVSLit7I2A9XRdWFEQKQwM." -< Vary: Origin -< Vary: Referer -< Vary: X-Origin -< Content-Type: application/atom+xml; charset=UTF-8 -< Date: Sat, 08 Nov 2014 23:47:59 GMT -< Expires: Sat, 08 Nov 2014 23:47:59 GMT -< Cache-Control: private, max-age=0 -< X-Content-Type-Options: nosniff -< X-Frame-Options: SAMEORIGIN -< X-XSS-Protection: 1; mode=block -< Server: GSE -< Content-Encoding: gzip -< Alternate-Protocol: 443:quic,p=0.01 -< Transfer-Encoding: chunked -< -< -< -< http://www.google.com/m8/feeds/contacts/libgdata.test%40googlemail.com/base/702a2a2988f4835f -< 2014-11-08T23:47:59.779Z -< 2014-11-08T23:47:59.779Z -< -< Fooish Bar -< -< -< -< -< Fooish Bar -< Fooish -< Bar -< -< - diff --git a/gdata/tests/traces/contacts/setup-query-all-contacts b/gdata/tests/traces/contacts/setup-query-all-contacts deleted file mode 100644 index 1073c47a..00000000 --- a/gdata/tests/traces/contacts/setup-query-all-contacts +++ /dev/null @@ -1,135 +0,0 @@ -> POST /m8/feeds/contacts/default/full HTTP/1.1 -> Soup-Debug-Timestamp: 1415489568 -> Soup-Debug: SoupSession 1 (0x15cd240), SoupMessage 33 (0x182f550), SoupSocket 16 (0x18d5a70) -> Host: www.google.com -> Authorization: Bearer ya29.uACgkznYPDckPkHNMU2MF2gRNGrNKqsjnalf5jZmQ0jV9jcp297YMiQop53msSbUJi5poX8LolhsSw -> GData-Version: 3 -> Content-Type: application/atom+xml -> Accept-Encoding: gzip, deflate -> User-Agent: libgdata/0.17.0 - gzip -> Connection: Keep-Alive -> -> Test Contact 1 - -< HTTP/1.1 201 Created -< Soup-Debug-Timestamp: 1415489568 -< Soup-Debug: SoupMessage 33 (0x182f550) -< ETag: "SXszcTVSLit7I2A9XRdWFEUDQgI." -< Vary: Origin -< Vary: Referer -< Vary: X-Origin -< Content-Type: application/atom+xml; charset=UTF-8 -< Date: Sat, 08 Nov 2014 23:32:48 GMT -< Expires: Sat, 08 Nov 2014 23:32:48 GMT -< Cache-Control: private, max-age=0 -< X-Content-Type-Options: nosniff -< X-Frame-Options: SAMEORIGIN -< X-XSS-Protection: 1; mode=block -< Server: GSE -< Content-Encoding: gzip -< Alternate-Protocol: 443:quic,p=0.01 -< Transfer-Encoding: chunked -< -< -< -< http://www.google.com/m8/feeds/contacts/libgdata.test%40googlemail.com/base/1fb657e58c9a2eb9 -< 2014-11-08T23:32:48.589Z -< 2014-11-08T23:32:48.589Z -< -< -< <link rel="http://schemas.google.com/contacts/2008/rel#photo" type="image/*" href="https://www.google.com/m8/feeds/photos/media/libgdata.test%40googlemail.com/1fb657e58c9a2eb9"/> -< <link rel="self" type="application/atom+xml" href="https://www.google.com/m8/feeds/contacts/libgdata.test%40googlemail.com/full/1fb657e58c9a2eb9"/> -< <link rel="edit" type="application/atom+xml" href="https://www.google.com/m8/feeds/contacts/libgdata.test%40googlemail.com/full/1fb657e58c9a2eb9"/> -< <gContact:nickname>Test Contact 1</gContact:nickname> -< </entry> - -> POST /m8/feeds/contacts/default/full HTTP/1.1 -> Soup-Debug-Timestamp: 1415489568 -> Soup-Debug: SoupSession 1 (0x15cd240), SoupMessage 34 (0x182f460), SoupSocket 17 (0x7ff4380578b0) -> Host: www.google.com -> Authorization: Bearer ya29.uACgkznYPDckPkHNMU2MF2gRNGrNKqsjnalf5jZmQ0jV9jcp297YMiQop53msSbUJi5poX8LolhsSw -> GData-Version: 3 -> Content-Type: application/atom+xml -> Accept-Encoding: gzip, deflate -> User-Agent: libgdata/0.17.0 - gzip -> Connection: Keep-Alive -> -> <?xml version='1.0' encoding='UTF-8'?><entry xmlns='http://www.w3.org/2005/Atom' xmlns:gContact='http://schemas.google.com/contact/2008' xmlns:gd='http://schemas.google.com/g/2005' xmlns:app='http://www.w3.org/2007/app'><title type='text'>Test Contact 2 - -< HTTP/1.1 201 Created -< Soup-Debug-Timestamp: 1415489569 -< Soup-Debug: SoupMessage 34 (0x182f460) -< ETag: "SXY_fjVSLit7I2A9XRdWFEUDQgI." -< Vary: Origin -< Vary: Referer -< Vary: X-Origin -< Content-Type: application/atom+xml; charset=UTF-8 -< Date: Sat, 08 Nov 2014 23:32:49 GMT -< Expires: Sat, 08 Nov 2014 23:32:49 GMT -< Cache-Control: private, max-age=0 -< X-Content-Type-Options: nosniff -< X-Frame-Options: SAMEORIGIN -< X-XSS-Protection: 1; mode=block -< Server: GSE -< Content-Encoding: gzip -< Alternate-Protocol: 443:quic,p=0.01 -< Transfer-Encoding: chunked -< -< -< -< http://www.google.com/m8/feeds/contacts/libgdata.test%40googlemail.com/base/10ba35c58c59d676 -< 2014-11-08T23:32:48.846Z -< 2014-11-08T23:32:48.846Z -< -< -< <link rel="http://schemas.google.com/contacts/2008/rel#photo" type="image/*" href="https://www.google.com/m8/feeds/photos/media/libgdata.test%40googlemail.com/10ba35c58c59d676"/> -< <link rel="self" type="application/atom+xml" href="https://www.google.com/m8/feeds/contacts/libgdata.test%40googlemail.com/full/10ba35c58c59d676"/> -< <link rel="edit" type="application/atom+xml" href="https://www.google.com/m8/feeds/contacts/libgdata.test%40googlemail.com/full/10ba35c58c59d676"/> -< <gContact:nickname>Test Contact 2</gContact:nickname> -< </entry> - -> POST /m8/feeds/contacts/default/full HTTP/1.1 -> Soup-Debug-Timestamp: 1415489569 -> Soup-Debug: SoupSession 1 (0x15cd240), SoupMessage 35 (0x182f370), SoupSocket 18 (0x7ff438057cc0) -> Host: www.google.com -> Authorization: Bearer ya29.uACgkznYPDckPkHNMU2MF2gRNGrNKqsjnalf5jZmQ0jV9jcp297YMiQop53msSbUJi5poX8LolhsSw -> GData-Version: 3 -> Content-Type: application/atom+xml -> Accept-Encoding: gzip, deflate -> User-Agent: libgdata/0.17.0 - gzip -> Connection: Keep-Alive -> -> <?xml version='1.0' encoding='UTF-8'?><entry xmlns='http://www.w3.org/2005/Atom' xmlns:gContact='http://schemas.google.com/contact/2008' xmlns:gd='http://schemas.google.com/g/2005' xmlns:app='http://www.w3.org/2007/app'><title type='text'>Test Contact 3 - -< HTTP/1.1 201 Created -< Soup-Debug-Timestamp: 1415489569 -< Soup-Debug: SoupMessage 35 (0x182f370) -< ETag: "SHo5fTVSLSt7I2A9XRdWFEUDQgI." -< Vary: Origin -< Vary: Referer -< Vary: X-Origin -< Content-Type: application/atom+xml; charset=UTF-8 -< Date: Sat, 08 Nov 2014 23:32:49 GMT -< Expires: Sat, 08 Nov 2014 23:32:49 GMT -< Cache-Control: private, max-age=0 -< X-Content-Type-Options: nosniff -< X-Frame-Options: SAMEORIGIN -< X-XSS-Protection: 1; mode=block -< Server: GSE -< Content-Encoding: gzip -< Alternate-Protocol: 443:quic,p=0.01 -< Transfer-Encoding: chunked -< -< -< -< http://www.google.com/m8/feeds/contacts/libgdata.test%40googlemail.com/base/5997be300d23115b -< 2014-11-08T23:32:49.425Z -< 2014-11-08T23:32:49.425Z -< -< -< <link rel="http://schemas.google.com/contacts/2008/rel#photo" type="image/*" href="https://www.google.com/m8/feeds/photos/media/libgdata.test%40googlemail.com/5997be300d23115b"/> -< <link rel="self" type="application/atom+xml" href="https://www.google.com/m8/feeds/contacts/libgdata.test%40googlemail.com/full/5997be300d23115b"/> -< <link rel="edit" type="application/atom+xml" href="https://www.google.com/m8/feeds/contacts/libgdata.test%40googlemail.com/full/5997be300d23115b"/> -< <gContact:nickname>Test Contact 3</gContact:nickname> -< </entry> - diff --git a/gdata/tests/traces/contacts/setup-query-all-groups b/gdata/tests/traces/contacts/setup-query-all-groups deleted file mode 100644 index 108a1bbc..00000000 --- a/gdata/tests/traces/contacts/setup-query-all-groups +++ /dev/null @@ -1,132 +0,0 @@ -> POST /m8/feeds/groups/default/full HTTP/1.1 -> Soup-Debug-Timestamp: 1415490528 -> Soup-Debug: SoupSession 1 (0x1c05240), SoupMessage 38 (0x1ce91c0), SoupSocket 18 (0x1e329d0) -> Host: www.google.com -> Authorization: Bearer ya29.uAB1RRhn3TKLPSfFZeRgrzf68-Gb9tby5F20urDCBwC6B94UqINs1Hvh_iKX3FagPwd0QkLnrSyVRw -> GData-Version: 3 -> Content-Type: application/atom+xml -> Accept-Encoding: gzip, deflate -> User-Agent: libgdata/0.17.0 - gzip -> Connection: Keep-Alive -> -> <?xml version='1.0' encoding='UTF-8'?><entry xmlns='http://www.w3.org/2005/Atom' xmlns:gContact='http://schemas.google.com/contact/2008' xmlns:gd='http://schemas.google.com/g/2005' xmlns:app='http://www.w3.org/2007/app'><title type='text'>Test Group 1Test Group 1 - -< HTTP/1.1 201 Created -< Soup-Debug-Timestamp: 1415490529 -< Soup-Debug: SoupMessage 38 (0x1ce91c0) -< ETag: "SH44ejVSLit7I2A9XRdWFEQKQgY." -< Vary: Origin -< Vary: Referer -< Vary: X-Origin -< Content-Type: application/atom+xml; charset=UTF-8 -< Date: Sat, 08 Nov 2014 23:48:49 GMT -< Expires: Sat, 08 Nov 2014 23:48:49 GMT -< Cache-Control: private, max-age=0 -< X-Content-Type-Options: nosniff -< X-Frame-Options: SAMEORIGIN -< X-XSS-Protection: 1; mode=block -< Server: GSE -< Content-Encoding: gzip -< Alternate-Protocol: 443:quic,p=0.01 -< Transfer-Encoding: chunked -< -< -< -< http://www.google.com/m8/feeds/groups/libgdata.test%40googlemail.com/base/53135b0d89099ac5 -< 2014-11-08T23:48:49.032Z -< 2014-11-08T23:48:49.032Z -< -< Test Group 1 -< Test Group 1 -< -< -< - -> POST /m8/feeds/groups/default/full HTTP/1.1 -> Soup-Debug-Timestamp: 1415490529 -> Soup-Debug: SoupSession 1 (0x1c05240), SoupMessage 39 (0x1ce90d0), SoupSocket 19 (0x1d6ea70) -> Host: www.google.com -> Authorization: Bearer ya29.uAB1RRhn3TKLPSfFZeRgrzf68-Gb9tby5F20urDCBwC6B94UqINs1Hvh_iKX3FagPwd0QkLnrSyVRw -> GData-Version: 3 -> Content-Type: application/atom+xml -> Accept-Encoding: gzip, deflate -> User-Agent: libgdata/0.17.0 - gzip -> Connection: Keep-Alive -> -> Test Group 2Test Group 2 - -< HTTP/1.1 201 Created -< Soup-Debug-Timestamp: 1415490529 -< Soup-Debug: SoupMessage 39 (0x1ce90d0) -< ETag: "SHo7ezVSLit7I2A9XRdWFEQKQgY." -< Vary: Origin -< Vary: Referer -< Vary: X-Origin -< Content-Type: application/atom+xml; charset=UTF-8 -< Date: Sat, 08 Nov 2014 23:48:49 GMT -< Expires: Sat, 08 Nov 2014 23:48:49 GMT -< Cache-Control: private, max-age=0 -< X-Content-Type-Options: nosniff -< X-Frame-Options: SAMEORIGIN -< X-XSS-Protection: 1; mode=block -< Server: GSE -< Content-Encoding: gzip -< Alternate-Protocol: 443:quic,p=0.01 -< Transfer-Encoding: chunked -< -< -< -< http://www.google.com/m8/feeds/groups/libgdata.test%40googlemail.com/base/732309600b1cf616 -< 2014-11-08T23:48:49.403Z -< 2014-11-08T23:48:49.403Z -< -< Test Group 2 -< Test Group 2 -< -< -< - -> POST /m8/feeds/groups/default/full HTTP/1.1 -> Soup-Debug-Timestamp: 1415490529 -> Soup-Debug: SoupSession 1 (0x1c05240), SoupMessage 40 (0x1ce90d0), SoupSocket 20 (0x1d6e9a0) -> Host: www.google.com -> Authorization: Bearer ya29.uAB1RRhn3TKLPSfFZeRgrzf68-Gb9tby5F20urDCBwC6B94UqINs1Hvh_iKX3FagPwd0QkLnrSyVRw -> GData-Version: 3 -> Content-Type: application/atom+xml -> Accept-Encoding: gzip, deflate -> User-Agent: libgdata/0.17.0 - gzip -> Connection: Keep-Alive -> -> Test Group 3Test Group 3 - -< HTTP/1.1 201 Created -< Soup-Debug-Timestamp: 1415490530 -< Soup-Debug: SoupMessage 40 (0x1ce90d0) -< ETag: "SHY4cTVSLit7I2A9XRdWFEQKQgY." -< Vary: Origin -< Vary: Referer -< Vary: X-Origin -< Content-Type: application/atom+xml; charset=UTF-8 -< Date: Sat, 08 Nov 2014 23:48:50 GMT -< Expires: Sat, 08 Nov 2014 23:48:50 GMT -< Cache-Control: private, max-age=0 -< X-Content-Type-Options: nosniff -< X-Frame-Options: SAMEORIGIN -< X-XSS-Protection: 1; mode=block -< Server: GSE -< Content-Encoding: gzip -< Alternate-Protocol: 443:quic,p=0.01 -< Transfer-Encoding: chunked -< -< -< -< http://www.google.com/m8/feeds/groups/libgdata.test%40googlemail.com/base/3bc435e78bb3779c -< 2014-11-08T23:48:49.839Z -< 2014-11-08T23:48:49.839Z -< -< Test Group 3 -< Test Group 3 -< -< -< - diff --git a/gdata/tests/traces/contacts/setup-temp-contact b/gdata/tests/traces/contacts/setup-temp-contact deleted file mode 100644 index 5ce26695..00000000 --- a/gdata/tests/traces/contacts/setup-temp-contact +++ /dev/null @@ -1,45 +0,0 @@ -> POST /m8/feeds/contacts/default/full HTTP/1.1 -> Soup-Debug-Timestamp: 1415490456 -> Soup-Debug: SoupSession 1 (0x1c05240), SoupMessage 4 (0x1ce9490), SoupSocket 4 (0x1e32b70) -> Host: www.google.com -> Authorization: Bearer ya29.uAB1RRhn3TKLPSfFZeRgrzf68-Gb9tby5F20urDCBwC6B94UqINs1Hvh_iKX3FagPwd0QkLnrSyVRw -> GData-Version: 3 -> Content-Type: application/atom+xml -> Accept-Encoding: gzip, deflate -> User-Agent: libgdata/0.17.0 - gzip -> Connection: Keep-Alive -> -> Test Contact Esq. - -< HTTP/1.1 201 Created -< Soup-Debug-Timestamp: 1415490456 -< Soup-Debug: SoupMessage 4 (0x1ce9490) -< ETag: "R3gzezVSLit7I2A9XRdWFEQKQwE." -< Vary: Origin -< Vary: Referer -< Vary: X-Origin -< Content-Type: application/atom+xml; charset=UTF-8 -< Date: Sat, 08 Nov 2014 23:47:36 GMT -< Expires: Sat, 08 Nov 2014 23:47:36 GMT -< Cache-Control: private, max-age=0 -< X-Content-Type-Options: nosniff -< X-Frame-Options: SAMEORIGIN -< X-XSS-Protection: 1; mode=block -< Server: GSE -< Content-Encoding: gzip -< Alternate-Protocol: 443:quic,p=0.01 -< Transfer-Encoding: chunked -< -< -< -< http://www.google.com/m8/feeds/contacts/libgdata.test%40googlemail.com/base/c8390ec0ef7f98a -< 2014-11-08T23:47:36.683Z -< 2014-11-08T23:47:36.683Z -< -< -< <link rel="http://schemas.google.com/contacts/2008/rel#photo" type="image/*" href="https://www.google.com/m8/feeds/photos/media/libgdata.test%40googlemail.com/c8390ec0ef7f98a"/> -< <link rel="self" type="application/atom+xml" href="https://www.google.com/m8/feeds/contacts/libgdata.test%40googlemail.com/full/c8390ec0ef7f98a"/> -< <link rel="edit" type="application/atom+xml" href="https://www.google.com/m8/feeds/contacts/libgdata.test%40googlemail.com/full/c8390ec0ef7f98a"/> -< <gContact:nickname>Test Contact Esq.</gContact:nickname> -< </entry> - diff --git a/gdata/tests/traces/contacts/setup-temp-contact-with-photo b/gdata/tests/traces/contacts/setup-temp-contact-with-photo deleted file mode 100644 index 72efed0c..00000000 --- a/gdata/tests/traces/contacts/setup-temp-contact-with-photo +++ /dev/null @@ -1,75 +0,0 @@ -> PUT /m8/feeds/photos/media/libgdata.test%40googlemail.com/c8390ec0ef7f98a HTTP/1.1 -> Soup-Debug-Timestamp: 1415490466 -> Soup-Debug: SoupSession 1 (0x1c05240), SoupMessage 5 (0x1ce9580), SoupSocket 4 (0x1e32b70) -> Host: www.google.com -> Authorization: Bearer ya29.uAB1RRhn3TKLPSfFZeRgrzf68-Gb9tby5F20urDCBwC6B94UqINs1Hvh_iKX3FagPwd0QkLnrSyVRw -> GData-Version: 3 -> If-Match: * -> Content-Type: image/jpeg -> Accept-Encoding: gzip, deflate -> User-Agent: libgdata/0.17.0 - gzip -> Connection: Keep-Alive -> -> ÿØÿà - -< HTTP/1.1 200 OK -< Soup-Debug-Timestamp: 1415490467 -< Soup-Debug: SoupMessage 5 (0x1ce9580) -< Content-Type: application/atom+xml; charset=UTF-8; type=entry -< GData-Version: 3.1 -< ETag: "SQpAMGkCSit7I2BKMH8LVi5COFsJDFglViY." -< Content-Encoding: gzip -< Date: Sat, 08 Nov 2014 23:47:47 GMT -< Expires: Sat, 08 Nov 2014 23:47:47 GMT -< Cache-Control: private, max-age=0 -< X-Content-Type-Options: nosniff -< X-Frame-Options: SAMEORIGIN -< X-XSS-Protection: 1; mode=block -< Server: GSE -< Alternate-Protocol: 443:quic,p=0.01 -< Transfer-Encoding: chunked -< -< <?xml version='1.0' encoding='UTF-8'?><entry xmlns='http://www.w3.org/2005/Atom' xmlns:gd='http://schemas.google.com/g/2005' gd:etag='"SQpAMGkCSit7I2BKMH8LVi5COFsJDFglViY."'><id>http://www.google.com/m8/feeds/photos/media/libgdata.test%40googlemail.com/c8390ec0ef7f98a</id><updated>2014-11-08T23:47:46.987Z</updated><app:edited xmlns:app='http://www.w3.org/2007/app'>2014-11-08T23:47:46.987Z</app:edited><link rel='self' type='application/atom+xml' href='https://www.google.com/m8/feeds/photos/media/libgdata.test%40googlemail.com/c8390ec0ef7f98a'/><link rel='edit' type='application/atom+xml' href='https://www.google.com/m8/feeds/photos/media/libgdata.test%40googlemail.com/c8390ec0ef7f98a'/></entry> - -> GET /m8/feeds/contacts/libgdata.test%40googlemail.com/full/c8390ec0ef7f98a HTTP/1.1 -> Soup-Debug-Timestamp: 1415490477 -> Soup-Debug: SoupSession 1 (0x1c05240), SoupMessage 6 (0x1ce9580), SoupSocket 4 (0x1e32b70) -> Host: www.google.com -> Authorization: Bearer ya29.uAB1RRhn3TKLPSfFZeRgrzf68-Gb9tby5F20urDCBwC6B94UqINs1Hvh_iKX3FagPwd0QkLnrSyVRw -> GData-Version: 3 -> Accept-Encoding: gzip, deflate -> User-Agent: libgdata/0.17.0 - gzip -> Connection: Keep-Alive - -< HTTP/1.1 200 OK -< Soup-Debug-Timestamp: 1415490477 -< Soup-Debug: SoupMessage 6 (0x1ce9580) -< Expires: Sat, 08 Nov 2014 23:47:57 GMT -< Date: Sat, 08 Nov 2014 23:47:57 GMT -< Cache-Control: private, max-age=0, must-revalidate, no-transform -< ETag: "R3czfzVSLit7I2A9XRdWFEQKQwI." -< Vary: Origin -< Vary: Referer -< Vary: X-Origin -< Content-Type: application/atom+xml; charset=UTF-8 -< X-Content-Type-Options: nosniff -< X-Frame-Options: SAMEORIGIN -< X-XSS-Protection: 1; mode=block -< Server: GSE -< Content-Encoding: gzip -< Alternate-Protocol: 443:quic,p=0.01 -< Transfer-Encoding: chunked -< -< <?xml version="1.0" encoding="UTF-8"?> -< <entry gd:etag=""R3czfzVSLit7I2A9XRdWFEQKQwI."" xmlns="http://www.w3.org/2005/Atom" xmlns:batch="http://schemas.google.com/gdata/batch" xmlns:gContact="http://schemas.google.com/contact/2008" xmlns:gd="http://schemas.google.com/g/2005"> -< <id>http://www.google.com/m8/feeds/contacts/libgdata.test%40googlemail.com/base/c8390ec0ef7f98a</id> -< <updated>2014-11-08T23:47:46.987Z</updated> -< <app:edited xmlns:app="http://www.w3.org/2007/app">2014-11-08T23:47:46.987Z</app:edited> -< <category scheme="http://schemas.google.com/g/2005#kind" term="http://schemas.google.com/contact/2008#contact"/> -< <title/> -< <link rel="http://schemas.google.com/contacts/2008/rel#photo" type="image/*" href="https://www.google.com/m8/feeds/photos/media/libgdata.test%40googlemail.com/c8390ec0ef7f98a" gd:etag=""SQpAMGkCSit7I2BKMH8LVi5COFsJDFglViY.""/> -< <link rel="self" type="application/atom+xml" href="https://www.google.com/m8/feeds/contacts/libgdata.test%40googlemail.com/full/c8390ec0ef7f98a"/> -< <link rel="edit" type="application/atom+xml" href="https://www.google.com/m8/feeds/contacts/libgdata.test%40googlemail.com/full/c8390ec0ef7f98a"/> -< <gContact:nickname>Test Contact Esq.</gContact:nickname> -< </entry> - diff --git a/gdata/tests/traces/contacts/teardown-batch-async b/gdata/tests/traces/contacts/teardown-batch-async deleted file mode 100644 index 5de9497b..00000000 --- a/gdata/tests/traces/contacts/teardown-batch-async +++ /dev/null @@ -1,30 +0,0 @@ -> DELETE /m8/feeds/contacts/libgdata.test%40googlemail.com/full/702a2a2988f4835f HTTP/1.1 -> Soup-Debug-Timestamp: 1415490480 -> Soup-Debug: SoupSession 1 (0x1c05240), SoupMessage 14 (0x1ce90d0), SoupSocket 7 (0x1e32c40) -> Host: www.google.com -> Authorization: Bearer ya29.uAB1RRhn3TKLPSfFZeRgrzf68-Gb9tby5F20urDCBwC6B94UqINs1Hvh_iKX3FagPwd0QkLnrSyVRw -> GData-Version: 3 -> If-Match: "SHk8cTVSLit7I2A9XRdWFEQKQwM." -> Accept-Encoding: gzip, deflate -> User-Agent: libgdata/0.17.0 - gzip -> Connection: Keep-Alive - -< HTTP/1.1 200 OK -< Soup-Debug-Timestamp: 1415490480 -< Soup-Debug: SoupMessage 14 (0x1ce90d0) -< Cache-Control: no-cache, no-store, max-age=0, must-revalidate -< Pragma: no-cache -< Expires: Fri, 01 Jan 1990 00:00:00 GMT -< Date: Sat, 08 Nov 2014 23:48:00 GMT -< Vary: Origin -< Vary: Referer -< Vary: X-Origin -< Content-Type: application/atom+xml -< X-Content-Type-Options: nosniff -< X-Frame-Options: SAMEORIGIN -< X-XSS-Protection: 1; mode=block -< Content-Length: 0 -< Server: GSE -< Alternate-Protocol: 443:quic,p=0.01 -< - diff --git a/gdata/tests/traces/contacts/teardown-insert b/gdata/tests/traces/contacts/teardown-insert deleted file mode 100644 index 0a1cbf8b..00000000 --- a/gdata/tests/traces/contacts/teardown-insert +++ /dev/null @@ -1,30 +0,0 @@ -> DELETE /m8/feeds/contacts/libgdata.test%40googlemail.com/full/3d8219568aedc2a9 HTTP/1.1 -> Soup-Debug-Timestamp: 1415489531 -> Soup-Debug: SoupSession 1 (0x15cd240), SoupMessage 5 (0x182f550), SoupSocket 4 (0x18d5c10) -> Host: www.google.com -> Authorization: Bearer ya29.uACgkznYPDckPkHNMU2MF2gRNGrNKqsjnalf5jZmQ0jV9jcp297YMiQop53msSbUJi5poX8LolhsSw -> GData-Version: 3 -> If-Match: "QHo8cDVSLit7I2A9XRdWFEUDQgc." -> Accept-Encoding: gzip, deflate -> User-Agent: libgdata/0.17.0 - gzip -> Connection: Keep-Alive - -< HTTP/1.1 200 OK -< Soup-Debug-Timestamp: 1415489532 -< Soup-Debug: SoupMessage 5 (0x182f550) -< Cache-Control: no-cache, no-store, max-age=0, must-revalidate -< Pragma: no-cache -< Expires: Fri, 01 Jan 1990 00:00:00 GMT -< Date: Sat, 08 Nov 2014 23:32:12 GMT -< Vary: Origin -< Vary: Referer -< Vary: X-Origin -< Content-Type: application/atom+xml -< X-Content-Type-Options: nosniff -< X-Frame-Options: SAMEORIGIN -< X-XSS-Protection: 1; mode=block -< Content-Length: 0 -< Server: GSE -< Alternate-Protocol: 443:quic,p=0.01 -< - diff --git a/gdata/tests/traces/contacts/teardown-insert-group b/gdata/tests/traces/contacts/teardown-insert-group deleted file mode 100644 index 19e8df0e..00000000 --- a/gdata/tests/traces/contacts/teardown-insert-group +++ /dev/null @@ -1,30 +0,0 @@ -> DELETE /m8/feeds/groups/libgdata.test%40googlemail.com/full/6beff9268d4dbc1f HTTP/1.1 -> Soup-Debug-Timestamp: 1415490563 -> Soup-Debug: SoupSession 1 (0x1c05240), SoupMessage 51 (0x1ce9580), SoupSocket 24 (0x7f4510044dd0) -> Host: www.google.com -> Authorization: Bearer ya29.uAB1RRhn3TKLPSfFZeRgrzf68-Gb9tby5F20urDCBwC6B94UqINs1Hvh_iKX3FagPwd0QkLnrSyVRw -> GData-Version: 3 -> If-Match: "Qnw6fzVSLit7I2A9XRdWFEQKQgE." -> Accept-Encoding: gzip, deflate -> User-Agent: libgdata/0.17.0 - gzip -> Connection: Keep-Alive - -< HTTP/1.1 200 OK -< Soup-Debug-Timestamp: 1415490563 -< Soup-Debug: SoupMessage 51 (0x1ce9580) -< Cache-Control: no-cache, no-store, max-age=0, must-revalidate -< Pragma: no-cache -< Expires: Fri, 01 Jan 1990 00:00:00 GMT -< Date: Sat, 08 Nov 2014 23:49:23 GMT -< Vary: Origin -< Vary: Referer -< Vary: X-Origin -< Content-Type: application/atom+xml -< X-Content-Type-Options: nosniff -< X-Frame-Options: SAMEORIGIN -< X-XSS-Protection: 1; mode=block -< Content-Length: 0 -< Server: GSE -< Alternate-Protocol: 443:quic,p=0.01 -< - diff --git a/gdata/tests/traces/contacts/teardown-query-all-contacts b/gdata/tests/traces/contacts/teardown-query-all-contacts deleted file mode 100644 index 02dd59cd..00000000 --- a/gdata/tests/traces/contacts/teardown-query-all-contacts +++ /dev/null @@ -1,90 +0,0 @@ -> DELETE /m8/feeds/contacts/libgdata.test%40googlemail.com/full/1fb657e58c9a2eb9 HTTP/1.1 -> Soup-Debug-Timestamp: 1415489575 -> Soup-Debug: SoupSession 1 (0x15cd240), SoupMessage 37 (0x182f280), SoupSocket 18 (0x7ff438057cc0) -> Host: www.google.com -> Authorization: Bearer ya29.uACgkznYPDckPkHNMU2MF2gRNGrNKqsjnalf5jZmQ0jV9jcp297YMiQop53msSbUJi5poX8LolhsSw -> GData-Version: 3 -> If-Match: "SXszcTVSLit7I2A9XRdWFEUDQgI." -> Accept-Encoding: gzip, deflate -> User-Agent: libgdata/0.17.0 - gzip -> Connection: Keep-Alive - -< HTTP/1.1 200 OK -< Soup-Debug-Timestamp: 1415489575 -< Soup-Debug: SoupMessage 37 (0x182f280) -< Cache-Control: no-cache, no-store, max-age=0, must-revalidate -< Pragma: no-cache -< Expires: Fri, 01 Jan 1990 00:00:00 GMT -< Date: Sat, 08 Nov 2014 23:32:55 GMT -< Vary: Origin -< Vary: Referer -< Vary: X-Origin -< Content-Type: application/atom+xml -< X-Content-Type-Options: nosniff -< X-Frame-Options: SAMEORIGIN -< X-XSS-Protection: 1; mode=block -< Content-Length: 0 -< Server: GSE -< Alternate-Protocol: 443:quic,p=0.01 -< - -> DELETE /m8/feeds/contacts/libgdata.test%40googlemail.com/full/10ba35c58c59d676 HTTP/1.1 -> Soup-Debug-Timestamp: 1415489575 -> Soup-Debug: SoupSession 1 (0x15cd240), SoupMessage 38 (0x182f190), SoupSocket 18 (0x7ff438057cc0) -> Host: www.google.com -> Authorization: Bearer ya29.uACgkznYPDckPkHNMU2MF2gRNGrNKqsjnalf5jZmQ0jV9jcp297YMiQop53msSbUJi5poX8LolhsSw -> GData-Version: 3 -> If-Match: "SXY_fjVSLit7I2A9XRdWFEUDQgI." -> Accept-Encoding: gzip, deflate -> User-Agent: libgdata/0.17.0 - gzip -> Connection: Keep-Alive - -< HTTP/1.1 200 OK -< Soup-Debug-Timestamp: 1415489575 -< Soup-Debug: SoupMessage 38 (0x182f190) -< Cache-Control: no-cache, no-store, max-age=0, must-revalidate -< Pragma: no-cache -< Expires: Fri, 01 Jan 1990 00:00:00 GMT -< Date: Sat, 08 Nov 2014 23:32:55 GMT -< Vary: Origin -< Vary: Referer -< Vary: X-Origin -< Content-Type: application/atom+xml -< X-Content-Type-Options: nosniff -< X-Frame-Options: SAMEORIGIN -< X-XSS-Protection: 1; mode=block -< Content-Length: 0 -< Server: GSE -< Alternate-Protocol: 443:quic,p=0.01 -< - -> DELETE /m8/feeds/contacts/libgdata.test%40googlemail.com/full/5997be300d23115b HTTP/1.1 -> Soup-Debug-Timestamp: 1415489575 -> Soup-Debug: SoupSession 1 (0x15cd240), SoupMessage 39 (0x182f0a0), SoupSocket 18 (0x7ff438057cc0) -> Host: www.google.com -> Authorization: Bearer ya29.uACgkznYPDckPkHNMU2MF2gRNGrNKqsjnalf5jZmQ0jV9jcp297YMiQop53msSbUJi5poX8LolhsSw -> GData-Version: 3 -> If-Match: "SHo5fTVSLSt7I2A9XRdWFEUDQgI." -> Accept-Encoding: gzip, deflate -> User-Agent: libgdata/0.17.0 - gzip -> Connection: Keep-Alive - -< HTTP/1.1 200 OK -< Soup-Debug-Timestamp: 1415489576 -< Soup-Debug: SoupMessage 39 (0x182f0a0) -< Cache-Control: no-cache, no-store, max-age=0, must-revalidate -< Pragma: no-cache -< Expires: Fri, 01 Jan 1990 00:00:00 GMT -< Date: Sat, 08 Nov 2014 23:32:56 GMT -< Vary: Origin -< Vary: Referer -< Vary: X-Origin -< Content-Type: application/atom+xml -< X-Content-Type-Options: nosniff -< X-Frame-Options: SAMEORIGIN -< X-XSS-Protection: 1; mode=block -< Content-Length: 0 -< Server: GSE -< Alternate-Protocol: 443:quic,p=0.01 -< - diff --git a/gdata/tests/traces/contacts/teardown-query-all-groups b/gdata/tests/traces/contacts/teardown-query-all-groups deleted file mode 100644 index be208e1c..00000000 --- a/gdata/tests/traces/contacts/teardown-query-all-groups +++ /dev/null @@ -1,90 +0,0 @@ -> DELETE /m8/feeds/groups/libgdata.test%40googlemail.com/full/53135b0d89099ac5 HTTP/1.1 -> Soup-Debug-Timestamp: 1415490541 -> Soup-Debug: SoupSession 1 (0x1c05240), SoupMessage 44 (0x1ce91c0), SoupSocket 21 (0x7f4510044ea0) -> Host: www.google.com -> Authorization: Bearer ya29.uAB1RRhn3TKLPSfFZeRgrzf68-Gb9tby5F20urDCBwC6B94UqINs1Hvh_iKX3FagPwd0QkLnrSyVRw -> GData-Version: 3 -> If-Match: "SH44ejVSLit7I2A9XRdWFEQKQgY." -> Accept-Encoding: gzip, deflate -> User-Agent: libgdata/0.17.0 - gzip -> Connection: Keep-Alive - -< HTTP/1.1 200 OK -< Soup-Debug-Timestamp: 1415490541 -< Soup-Debug: SoupMessage 44 (0x1ce91c0) -< Cache-Control: no-cache, no-store, max-age=0, must-revalidate -< Pragma: no-cache -< Expires: Fri, 01 Jan 1990 00:00:00 GMT -< Date: Sat, 08 Nov 2014 23:49:01 GMT -< Vary: Origin -< Vary: Referer -< Vary: X-Origin -< Content-Type: application/atom+xml -< X-Content-Type-Options: nosniff -< X-Frame-Options: SAMEORIGIN -< X-XSS-Protection: 1; mode=block -< Content-Length: 0 -< Server: GSE -< Alternate-Protocol: 443:quic,p=0.01 -< - -> DELETE /m8/feeds/groups/libgdata.test%40googlemail.com/full/732309600b1cf616 HTTP/1.1 -> Soup-Debug-Timestamp: 1415490541 -> Soup-Debug: SoupSession 1 (0x1c05240), SoupMessage 45 (0x1ce92b0), SoupSocket 21 (0x7f4510044ea0) -> Host: www.google.com -> Authorization: Bearer ya29.uAB1RRhn3TKLPSfFZeRgrzf68-Gb9tby5F20urDCBwC6B94UqINs1Hvh_iKX3FagPwd0QkLnrSyVRw -> GData-Version: 3 -> If-Match: "SHo7ezVSLit7I2A9XRdWFEQKQgY." -> Accept-Encoding: gzip, deflate -> User-Agent: libgdata/0.17.0 - gzip -> Connection: Keep-Alive - -< HTTP/1.1 200 OK -< Soup-Debug-Timestamp: 1415490541 -< Soup-Debug: SoupMessage 45 (0x1ce92b0) -< Cache-Control: no-cache, no-store, max-age=0, must-revalidate -< Pragma: no-cache -< Expires: Fri, 01 Jan 1990 00:00:00 GMT -< Date: Sat, 08 Nov 2014 23:49:01 GMT -< Vary: Origin -< Vary: Referer -< Vary: X-Origin -< Content-Type: application/atom+xml -< X-Content-Type-Options: nosniff -< X-Frame-Options: SAMEORIGIN -< X-XSS-Protection: 1; mode=block -< Content-Length: 0 -< Server: GSE -< Alternate-Protocol: 443:quic,p=0.01 -< - -> DELETE /m8/feeds/groups/libgdata.test%40googlemail.com/full/3bc435e78bb3779c HTTP/1.1 -> Soup-Debug-Timestamp: 1415490541 -> Soup-Debug: SoupSession 1 (0x1c05240), SoupMessage 46 (0x1ce93a0), SoupSocket 21 (0x7f4510044ea0) -> Host: www.google.com -> Authorization: Bearer ya29.uAB1RRhn3TKLPSfFZeRgrzf68-Gb9tby5F20urDCBwC6B94UqINs1Hvh_iKX3FagPwd0QkLnrSyVRw -> GData-Version: 3 -> If-Match: "SHY4cTVSLit7I2A9XRdWFEQKQgY." -> Accept-Encoding: gzip, deflate -> User-Agent: libgdata/0.17.0 - gzip -> Connection: Keep-Alive - -< HTTP/1.1 200 OK -< Soup-Debug-Timestamp: 1415490541 -< Soup-Debug: SoupMessage 46 (0x1ce93a0) -< Cache-Control: no-cache, no-store, max-age=0, must-revalidate -< Pragma: no-cache -< Expires: Fri, 01 Jan 1990 00:00:00 GMT -< Date: Sat, 08 Nov 2014 23:49:01 GMT -< Vary: Origin -< Vary: Referer -< Vary: X-Origin -< Content-Type: application/atom+xml -< X-Content-Type-Options: nosniff -< X-Frame-Options: SAMEORIGIN -< X-XSS-Protection: 1; mode=block -< Content-Length: 0 -< Server: GSE -< Alternate-Protocol: 443:quic,p=0.01 -< - diff --git a/gdata/tests/traces/contacts/teardown-temp-contact b/gdata/tests/traces/contacts/teardown-temp-contact deleted file mode 100644 index 91953c21..00000000 --- a/gdata/tests/traces/contacts/teardown-temp-contact +++ /dev/null @@ -1,72 +0,0 @@ -> GET /m8/feeds/contacts/libgdata.test%40googlemail.com/full/c8390ec0ef7f98a HTTP/1.1 -> Soup-Debug-Timestamp: 1415490478 -> Soup-Debug: SoupSession 1 (0x1c05240), SoupMessage 8 (0x1ce9490), SoupSocket 4 (0x1e32b70) -> Host: www.google.com -> Authorization: Bearer ya29.uAB1RRhn3TKLPSfFZeRgrzf68-Gb9tby5F20urDCBwC6B94UqINs1Hvh_iKX3FagPwd0QkLnrSyVRw -> GData-Version: 3 -> Accept-Encoding: gzip, deflate -> User-Agent: libgdata/0.17.0 - gzip -> Connection: Keep-Alive - -< HTTP/1.1 200 OK -< Soup-Debug-Timestamp: 1415490478 -< Soup-Debug: SoupMessage 8 (0x1ce9490) -< Expires: Sat, 08 Nov 2014 23:47:58 GMT -< Date: Sat, 08 Nov 2014 23:47:58 GMT -< Cache-Control: private, max-age=0, must-revalidate, no-transform -< ETag: "SX4yeDVSLit7I2A9XRdWFEQKQwM." -< Vary: Origin -< Vary: Referer -< Vary: X-Origin -< Content-Type: application/atom+xml; charset=UTF-8 -< X-Content-Type-Options: nosniff -< X-Frame-Options: SAMEORIGIN -< X-XSS-Protection: 1; mode=block -< Server: GSE -< Content-Encoding: gzip -< Alternate-Protocol: 443:quic,p=0.01 -< Transfer-Encoding: chunked -< -< <?xml version="1.0" encoding="UTF-8"?> -< <entry gd:etag=""SX4yeDVSLit7I2A9XRdWFEQKQwM."" xmlns="http://www.w3.org/2005/Atom" xmlns:batch="http://schemas.google.com/gdata/batch" xmlns:gContact="http://schemas.google.com/contact/2008" xmlns:gd="http://schemas.google.com/g/2005"> -< <id>http://www.google.com/m8/feeds/contacts/libgdata.test%40googlemail.com/base/c8390ec0ef7f98a</id> -< <updated>2014-11-08T23:47:58.090Z</updated> -< <app:edited xmlns:app="http://www.w3.org/2007/app">2014-11-08T23:47:58.090Z</app:edited> -< <category scheme="http://schemas.google.com/g/2005#kind" term="http://schemas.google.com/contact/2008#contact"/> -< <title/> -< <link rel="http://schemas.google.com/contacts/2008/rel#photo" type="image/*" href="https://www.google.com/m8/feeds/photos/media/libgdata.test%40googlemail.com/c8390ec0ef7f98a"/> -< <link rel="self" type="application/atom+xml" href="https://www.google.com/m8/feeds/contacts/libgdata.test%40googlemail.com/full/c8390ec0ef7f98a"/> -< <link rel="edit" type="application/atom+xml" href="https://www.google.com/m8/feeds/contacts/libgdata.test%40googlemail.com/full/c8390ec0ef7f98a"/> -< <gContact:nickname>Test Contact Esq.</gContact:nickname> -< </entry> - -> DELETE /m8/feeds/contacts/libgdata.test%40googlemail.com/full/c8390ec0ef7f98a HTTP/1.1 -> Soup-Debug-Timestamp: 1415490478 -> Soup-Debug: SoupSession 1 (0x1c05240), SoupMessage 9 (0x1ce93a0), SoupSocket 4 (0x1e32b70) -> Host: www.google.com -> Authorization: Bearer ya29.uAB1RRhn3TKLPSfFZeRgrzf68-Gb9tby5F20urDCBwC6B94UqINs1Hvh_iKX3FagPwd0QkLnrSyVRw -> GData-Version: 3 -> If-Match: "SX4yeDVSLit7I2A9XRdWFEQKQwM." -> Accept-Encoding: gzip, deflate -> User-Agent: libgdata/0.17.0 - gzip -> Connection: Keep-Alive - -< HTTP/1.1 200 OK -< Soup-Debug-Timestamp: 1415490478 -< Soup-Debug: SoupMessage 9 (0x1ce93a0) -< Cache-Control: no-cache, no-store, max-age=0, must-revalidate -< Pragma: no-cache -< Expires: Fri, 01 Jan 1990 00:00:00 GMT -< Date: Sat, 08 Nov 2014 23:47:58 GMT -< Vary: Origin -< Vary: Referer -< Vary: X-Origin -< Content-Type: application/atom+xml -< X-Content-Type-Options: nosniff -< X-Frame-Options: SAMEORIGIN -< X-XSS-Protection: 1; mode=block -< Content-Length: 0 -< Server: GSE -< Alternate-Protocol: 443:quic,p=0.01 -< - diff --git a/po/POTFILES.in b/po/POTFILES.in index 160a57ee..023fa8c0 100644 --- a/po/POTFILES.in +++ b/po/POTFILES.in @@ -15,7 +15,6 @@ gdata/gdata-upload-stream.c gdata/services/calendar/gdata-calendar-calendar.c gdata/services/calendar/gdata-calendar-event.c gdata/services/calendar/gdata-calendar-service.c -gdata/services/contacts/gdata-contacts-service.c gdata/services/documents/gdata-documents-access-rule.c gdata/services/documents/gdata-documents-document.c gdata/services/documents/gdata-documents-entry.c -- cgit v1.2.1