~ubuntu-branches/ubuntu/precise/folks/precise-201306070638

« back to all changes in this revision

Viewing changes to backends/eds/lib/edsf-persona.c

  • Committer: Bazaar Package Importer
  • Author(s): Laurent Bigonville
  • Date: 2011-10-13 21:02:50 UTC
  • mfrom: (4.2.5 experimental)
  • mto: (4.2.6 experimental)
  • mto: This revision was merged to the branch mainline in revision 28.
  • Revision ID: james.westby@ubuntu.com-20111013210250-pgwuxw7z1cunhhhx
Tags: 0.6.3.2-2
* debian/rules: Call dh_strip for folks-tools package
* debian/gbp.conf: Switch to unstable branch
* debian/control:
  - Add libncurses5-dev build-dependency
  - Fix duplicate description
* debian/watch: Switch to .xz tarball

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
/* edsf-persona.c generated by valac 0.14.0.15-f8b5, the Vala compiler
 
2
 * generated from edsf-persona.vala, do not modify */
 
3
 
 
4
/*
 
5
 * Copyright (C) 2011 Collabora Ltd.
 
6
 *
 
7
 * This library is free software: you can redistribute it and/or modify
 
8
 * it under the terms of the GNU Lesser General Public License as published by
 
9
 * the Free Software Foundation, either version 2.1 of the License, or
 
10
 * (at your option) any later version.
 
11
 *
 
12
 * This library is distributed in the hope that it will be useful,
 
13
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 
14
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 
15
 * GNU Lesser General Public License for more details.
 
16
 *
 
17
 * You should have received a copy of the GNU Lesser General Public License
 
18
 * along with this library.  If not, see <http://www.gnu.org/licenses/>.
 
19
 *
 
20
 * Authors:
 
21
 *       Travis Reitter <travis.reitter@collabora.co.uk>
 
22
 *       Marco Barisione <marco.barisione@collabora.co.uk>
 
23
 *       Raul Gutierrez Segales <raul.gutierrez.segales@collabora.co.uk>
 
24
 */
 
25
 
 
26
#include <glib.h>
 
27
#include <glib-object.h>
 
28
#include <folks/folks.h>
 
29
#include <gee.h>
 
30
#include <stdlib.h>
 
31
#include <string.h>
 
32
#include <libebook/e-book-client.h>
 
33
#include <gio/gio.h>
 
34
 
 
35
 
 
36
#define EDSF_TYPE_PERSONA (edsf_persona_get_type ())
 
37
#define EDSF_PERSONA(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), EDSF_TYPE_PERSONA, EdsfPersona))
 
38
#define EDSF_PERSONA_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), EDSF_TYPE_PERSONA, EdsfPersonaClass))
 
39
#define EDSF_IS_PERSONA(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), EDSF_TYPE_PERSONA))
 
40
#define EDSF_IS_PERSONA_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), EDSF_TYPE_PERSONA))
 
41
#define EDSF_PERSONA_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), EDSF_TYPE_PERSONA, EdsfPersonaClass))
 
42
 
 
43
typedef struct _EdsfPersona EdsfPersona;
 
44
typedef struct _EdsfPersonaClass EdsfPersonaClass;
 
45
typedef struct _EdsfPersonaPrivate EdsfPersonaPrivate;
 
46
#define _g_object_unref0(var) ((var == NULL) ? NULL : (var = (g_object_unref (var), NULL)))
 
47
#define _g_free0(var) (var = (g_free (var), NULL))
 
48
#define _g_date_time_unref0(var) ((var == NULL) ? NULL : (var = (g_date_time_unref (var), NULL)))
 
49
 
 
50
#define EDSF_PERSONA_TYPE_URL_TYPE_MAPPING (edsf_persona_url_type_mapping_get_type ())
 
51
typedef struct _EdsfPersonaUrlTypeMapping EdsfPersonaUrlTypeMapping;
 
52
 
 
53
#define EDSF_TYPE_PERSONA_STORE (edsf_persona_store_get_type ())
 
54
#define EDSF_PERSONA_STORE(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), EDSF_TYPE_PERSONA_STORE, EdsfPersonaStore))
 
55
#define EDSF_PERSONA_STORE_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), EDSF_TYPE_PERSONA_STORE, EdsfPersonaStoreClass))
 
56
#define EDSF_IS_PERSONA_STORE(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), EDSF_TYPE_PERSONA_STORE))
 
57
#define EDSF_IS_PERSONA_STORE_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), EDSF_TYPE_PERSONA_STORE))
 
58
#define EDSF_PERSONA_STORE_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), EDSF_TYPE_PERSONA_STORE, EdsfPersonaStoreClass))
 
59
 
 
60
typedef struct _EdsfPersonaStore EdsfPersonaStore;
 
61
typedef struct _EdsfPersonaStoreClass EdsfPersonaStoreClass;
 
62
typedef struct _EdsfPersonaChangeWebServiceAddressesData EdsfPersonaChangeWebServiceAddressesData;
 
63
typedef struct _EdsfPersonaChangeLocalIdsData EdsfPersonaChangeLocalIdsData;
 
64
typedef struct _EdsfPersonaChangePostalAddressesData EdsfPersonaChangePostalAddressesData;
 
65
typedef struct _EdsfPersonaChangePhoneNumbersData EdsfPersonaChangePhoneNumbersData;
 
66
typedef struct _EdsfPersonaChangeEmailAddressesData EdsfPersonaChangeEmailAddressesData;
 
67
typedef struct _EdsfPersonaChangeNotesData EdsfPersonaChangeNotesData;
 
68
typedef struct _EdsfPersonaChangeAvatarData EdsfPersonaChangeAvatarData;
 
69
typedef struct _EdsfPersonaChangeStructuredNameData EdsfPersonaChangeStructuredNameData;
 
70
typedef struct _EdsfPersonaChangeFullNameData EdsfPersonaChangeFullNameData;
 
71
typedef struct _EdsfPersonaChangeNicknameData EdsfPersonaChangeNicknameData;
 
72
typedef struct _EdsfPersonaChangeGenderData EdsfPersonaChangeGenderData;
 
73
typedef struct _EdsfPersonaChangeUrlsData EdsfPersonaChangeUrlsData;
 
74
typedef struct _EdsfPersonaChangeImAddressesData EdsfPersonaChangeImAddressesData;
 
75
typedef struct _EdsfPersonaChangeGroupData EdsfPersonaChangeGroupData;
 
76
typedef struct _EdsfPersonaChangeGroupsData EdsfPersonaChangeGroupsData;
 
77
typedef struct _EdsfPersonaChangeBirthdayData EdsfPersonaChangeBirthdayData;
 
78
typedef struct _EdsfPersonaChangeRolesData EdsfPersonaChangeRolesData;
 
79
#define __vala_EVCardAttribute_free0(var) ((var == NULL) ? NULL : (var = (_vala_EVCardAttribute_free (var), NULL)))
 
80
#define __vala_EContactDate_free0(var) ((var == NULL) ? NULL : (var = (_vala_EContactDate_free (var), NULL)))
 
81
 
 
82
#define EDSF_TYPE_SET_COMPARATOR (edsf_set_comparator_get_type ())
 
83
#define EDSF_SET_COMPARATOR(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), EDSF_TYPE_SET_COMPARATOR, EdsfSetComparator))
 
84
#define EDSF_SET_COMPARATOR_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), EDSF_TYPE_SET_COMPARATOR, EdsfSetComparatorClass))
 
85
#define EDSF_IS_SET_COMPARATOR(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), EDSF_TYPE_SET_COMPARATOR))
 
86
#define EDSF_IS_SET_COMPARATOR_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), EDSF_TYPE_SET_COMPARATOR))
 
87
#define EDSF_SET_COMPARATOR_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), EDSF_TYPE_SET_COMPARATOR, EdsfSetComparatorClass))
 
88
 
 
89
typedef struct _EdsfSetComparator EdsfSetComparator;
 
90
typedef struct _EdsfSetComparatorClass EdsfSetComparatorClass;
 
91
#define __vala_EVCardAttributeParam_free0(var) ((var == NULL) ? NULL : (var = (_vala_EVCardAttributeParam_free (var), NULL)))
 
92
#define __g_list_free___vala_EVCardAttribute_free0_0(var) ((var == NULL) ? NULL : (var = (_g_list_free___vala_EVCardAttribute_free0_ (var), NULL)))
 
93
#define __vala_EContactName_free0(var) ((var == NULL) ? NULL : (var = (_vala_EContactName_free (var), NULL)))
 
94
 
 
95
#define EDSF_TYPE_MEMORY_ICON (edsf_memory_icon_get_type ())
 
96
#define EDSF_MEMORY_ICON(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), EDSF_TYPE_MEMORY_ICON, EdsfMemoryIcon))
 
97
#define EDSF_MEMORY_ICON_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), EDSF_TYPE_MEMORY_ICON, EdsfMemoryIconClass))
 
98
#define EDSF_IS_MEMORY_ICON(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), EDSF_TYPE_MEMORY_ICON))
 
99
#define EDSF_IS_MEMORY_ICON_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), EDSF_TYPE_MEMORY_ICON))
 
100
#define EDSF_MEMORY_ICON_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), EDSF_TYPE_MEMORY_ICON, EdsfMemoryIconClass))
 
101
 
 
102
typedef struct _EdsfMemoryIcon EdsfMemoryIcon;
 
103
typedef struct _EdsfMemoryIconClass EdsfMemoryIconClass;
 
104
typedef struct _Block1Data Block1Data;
 
105
#define _g_error_free0(var) ((var == NULL) ? NULL : (var = (g_error_free (var), NULL)))
 
106
#define __vala_EContactPhoto_free0(var) ((var == NULL) ? NULL : (var = (_vala_EContactPhoto_free (var), NULL)))
 
107
#define _g_list_free0(var) ((var == NULL) ? NULL : (var = (g_list_free (var), NULL)))
 
108
#define _g_hash_table_unref0(var) ((var == NULL) ? NULL : (var = (g_hash_table_unref (var), NULL)))
 
109
 
 
110
struct _EdsfPersona {
 
111
        FolksPersona parent_instance;
 
112
        EdsfPersonaPrivate * priv;
 
113
};
 
114
 
 
115
struct _EdsfPersonaClass {
 
116
        FolksPersonaClass parent_class;
 
117
};
 
118
 
 
119
struct _EdsfPersonaPrivate {
 
120
        GeeHashSet* _phone_numbers;
 
121
        GeeSet* _phone_numbers_ro;
 
122
        GeeHashSet* _email_addresses;
 
123
        GeeSet* _email_addresses_ro;
 
124
        GeeHashSet* _notes;
 
125
        GeeSet* _notes_ro;
 
126
        GeeHashSet* _postal_addresses;
 
127
        GeeSet* _postal_addresses_ro;
 
128
        GeeHashSet* _local_ids;
 
129
        GeeSet* _local_ids_ro;
 
130
        GeeHashMultiMap* _web_service_addresses;
 
131
        EContact* _contact;
 
132
        GLoadableIcon* _avatar;
 
133
        FolksStructuredName* _structured_name;
 
134
        gchar* _contact_id;
 
135
        gchar* _full_name;
 
136
        gchar* _nickname;
 
137
        FolksGender _gender;
 
138
        GeeHashSet* _urls;
 
139
        GeeSet* _urls_ro;
 
140
        GeeHashMultiMap* _im_addresses;
 
141
        GeeHashSet* _groups;
 
142
        GeeSet* _groups_ro;
 
143
        GDateTime* _birthday;
 
144
        GeeHashSet* _roles;
 
145
        GeeSet* _roles_ro;
 
146
};
 
147
 
 
148
struct _EdsfPersonaUrlTypeMapping {
 
149
        gchar* vcard_field_name;
 
150
        gchar* folks_type;
 
151
};
 
152
 
 
153
struct _EdsfPersonaChangeWebServiceAddressesData {
 
154
        int _state_;
 
155
        GObject* _source_object_;
 
156
        GAsyncResult* _res_;
 
157
        GSimpleAsyncResult* _async_result;
 
158
        EdsfPersona* self;
 
159
        GeeMultiMap* web_service_addresses;
 
160
        FolksPersonaStore* _tmp0_;
 
161
        FolksPersonaStore* _tmp1_;
 
162
        GeeMultiMap* _tmp2_;
 
163
        GError * _inner_error_;
 
164
};
 
165
 
 
166
struct _EdsfPersonaChangeLocalIdsData {
 
167
        int _state_;
 
168
        GObject* _source_object_;
 
169
        GAsyncResult* _res_;
 
170
        GSimpleAsyncResult* _async_result;
 
171
        EdsfPersona* self;
 
172
        GeeSet* local_ids;
 
173
        FolksPersonaStore* _tmp0_;
 
174
        FolksPersonaStore* _tmp1_;
 
175
        GeeSet* _tmp2_;
 
176
        GError * _inner_error_;
 
177
};
 
178
 
 
179
struct _EdsfPersonaChangePostalAddressesData {
 
180
        int _state_;
 
181
        GObject* _source_object_;
 
182
        GAsyncResult* _res_;
 
183
        GSimpleAsyncResult* _async_result;
 
184
        EdsfPersona* self;
 
185
        GeeSet* postal_addresses;
 
186
        FolksPersonaStore* _tmp0_;
 
187
        FolksPersonaStore* _tmp1_;
 
188
        GeeSet* _tmp2_;
 
189
        GError * _inner_error_;
 
190
};
 
191
 
 
192
struct _EdsfPersonaChangePhoneNumbersData {
 
193
        int _state_;
 
194
        GObject* _source_object_;
 
195
        GAsyncResult* _res_;
 
196
        GSimpleAsyncResult* _async_result;
 
197
        EdsfPersona* self;
 
198
        GeeSet* phone_numbers;
 
199
        FolksPersonaStore* _tmp0_;
 
200
        FolksPersonaStore* _tmp1_;
 
201
        GeeSet* _tmp2_;
 
202
        GError * _inner_error_;
 
203
};
 
204
 
 
205
struct _EdsfPersonaChangeEmailAddressesData {
 
206
        int _state_;
 
207
        GObject* _source_object_;
 
208
        GAsyncResult* _res_;
 
209
        GSimpleAsyncResult* _async_result;
 
210
        EdsfPersona* self;
 
211
        GeeSet* email_addresses;
 
212
        FolksPersonaStore* _tmp0_;
 
213
        FolksPersonaStore* _tmp1_;
 
214
        GeeSet* _tmp2_;
 
215
        GError * _inner_error_;
 
216
};
 
217
 
 
218
struct _EdsfPersonaChangeNotesData {
 
219
        int _state_;
 
220
        GObject* _source_object_;
 
221
        GAsyncResult* _res_;
 
222
        GSimpleAsyncResult* _async_result;
 
223
        EdsfPersona* self;
 
224
        GeeSet* notes;
 
225
        FolksPersonaStore* _tmp0_;
 
226
        FolksPersonaStore* _tmp1_;
 
227
        GeeSet* _tmp2_;
 
228
        GError * _inner_error_;
 
229
};
 
230
 
 
231
struct _EdsfPersonaChangeAvatarData {
 
232
        int _state_;
 
233
        GObject* _source_object_;
 
234
        GAsyncResult* _res_;
 
235
        GSimpleAsyncResult* _async_result;
 
236
        EdsfPersona* self;
 
237
        GLoadableIcon* avatar;
 
238
        FolksPersonaStore* _tmp0_;
 
239
        FolksPersonaStore* _tmp1_;
 
240
        GLoadableIcon* _tmp2_;
 
241
        GError * _inner_error_;
 
242
};
 
243
 
 
244
struct _EdsfPersonaChangeStructuredNameData {
 
245
        int _state_;
 
246
        GObject* _source_object_;
 
247
        GAsyncResult* _res_;
 
248
        GSimpleAsyncResult* _async_result;
 
249
        EdsfPersona* self;
 
250
        FolksStructuredName* structured_name;
 
251
        FolksPersonaStore* _tmp0_;
 
252
        FolksPersonaStore* _tmp1_;
 
253
        FolksStructuredName* _tmp2_;
 
254
        GError * _inner_error_;
 
255
};
 
256
 
 
257
struct _EdsfPersonaChangeFullNameData {
 
258
        int _state_;
 
259
        GObject* _source_object_;
 
260
        GAsyncResult* _res_;
 
261
        GSimpleAsyncResult* _async_result;
 
262
        EdsfPersona* self;
 
263
        gchar* full_name;
 
264
        FolksPersonaStore* _tmp0_;
 
265
        FolksPersonaStore* _tmp1_;
 
266
        const gchar* _tmp2_;
 
267
        GError * _inner_error_;
 
268
};
 
269
 
 
270
struct _EdsfPersonaChangeNicknameData {
 
271
        int _state_;
 
272
        GObject* _source_object_;
 
273
        GAsyncResult* _res_;
 
274
        GSimpleAsyncResult* _async_result;
 
275
        EdsfPersona* self;
 
276
        gchar* nickname;
 
277
        FolksPersonaStore* _tmp0_;
 
278
        FolksPersonaStore* _tmp1_;
 
279
        const gchar* _tmp2_;
 
280
        GError * _inner_error_;
 
281
};
 
282
 
 
283
struct _EdsfPersonaChangeGenderData {
 
284
        int _state_;
 
285
        GObject* _source_object_;
 
286
        GAsyncResult* _res_;
 
287
        GSimpleAsyncResult* _async_result;
 
288
        EdsfPersona* self;
 
289
        FolksGender gender;
 
290
        FolksPersonaStore* _tmp0_;
 
291
        FolksPersonaStore* _tmp1_;
 
292
        FolksGender _tmp2_;
 
293
        GError * _inner_error_;
 
294
};
 
295
 
 
296
struct _EdsfPersonaChangeUrlsData {
 
297
        int _state_;
 
298
        GObject* _source_object_;
 
299
        GAsyncResult* _res_;
 
300
        GSimpleAsyncResult* _async_result;
 
301
        EdsfPersona* self;
 
302
        GeeSet* urls;
 
303
        FolksPersonaStore* _tmp0_;
 
304
        FolksPersonaStore* _tmp1_;
 
305
        GeeSet* _tmp2_;
 
306
        GError * _inner_error_;
 
307
};
 
308
 
 
309
struct _EdsfPersonaChangeImAddressesData {
 
310
        int _state_;
 
311
        GObject* _source_object_;
 
312
        GAsyncResult* _res_;
 
313
        GSimpleAsyncResult* _async_result;
 
314
        EdsfPersona* self;
 
315
        GeeMultiMap* im_addresses;
 
316
        FolksPersonaStore* _tmp0_;
 
317
        FolksPersonaStore* _tmp1_;
 
318
        GeeMultiMap* _tmp2_;
 
319
        GError * _inner_error_;
 
320
};
 
321
 
 
322
struct _EdsfPersonaChangeGroupData {
 
323
        int _state_;
 
324
        GObject* _source_object_;
 
325
        GAsyncResult* _res_;
 
326
        GSimpleAsyncResult* _async_result;
 
327
        EdsfPersona* self;
 
328
        gchar* group;
 
329
        gboolean is_member;
 
330
        gboolean _tmp0_;
 
331
        gboolean _tmp1_;
 
332
        gboolean _tmp2_;
 
333
        GeeHashSet* _tmp3_;
 
334
        const gchar* _tmp4_;
 
335
        gboolean _tmp5_;
 
336
        gboolean _tmp6_;
 
337
        gboolean _tmp7_;
 
338
        gboolean _tmp8_;
 
339
        GeeHashSet* _tmp9_;
 
340
        const gchar* _tmp10_;
 
341
        gboolean _tmp11_;
 
342
        gboolean _tmp12_;
 
343
        gboolean _tmp13_;
 
344
        GeeHashSet* _tmp14_;
 
345
        GeeHashSet* new_groups;
 
346
        GeeHashSet* _tmp15_;
 
347
        GeeIterator* _tmp16_;
 
348
        GeeIterator* _category_name_it;
 
349
        GeeIterator* _tmp17_;
 
350
        gboolean _tmp18_;
 
351
        GeeIterator* _tmp19_;
 
352
        gpointer _tmp20_;
 
353
        gchar* category_name;
 
354
        GeeHashSet* _tmp21_;
 
355
        const gchar* _tmp22_;
 
356
        gboolean _tmp23_;
 
357
        GeeHashSet* _tmp24_;
 
358
        const gchar* _tmp25_;
 
359
        GeeHashSet* _tmp26_;
 
360
        const gchar* _tmp27_;
 
361
        GeeHashSet* _tmp28_;
 
362
        GError * _inner_error_;
 
363
};
 
364
 
 
365
struct _EdsfPersonaChangeGroupsData {
 
366
        int _state_;
 
367
        GObject* _source_object_;
 
368
        GAsyncResult* _res_;
 
369
        GSimpleAsyncResult* _async_result;
 
370
        EdsfPersona* self;
 
371
        GeeSet* groups;
 
372
        FolksPersonaStore* _tmp0_;
 
373
        FolksPersonaStore* _tmp1_;
 
374
        GeeSet* _tmp2_;
 
375
        GError * _inner_error_;
 
376
};
 
377
 
 
378
struct _EdsfPersonaChangeBirthdayData {
 
379
        int _state_;
 
380
        GObject* _source_object_;
 
381
        GAsyncResult* _res_;
 
382
        GSimpleAsyncResult* _async_result;
 
383
        EdsfPersona* self;
 
384
        GDateTime* bday;
 
385
        FolksPersonaStore* _tmp0_;
 
386
        FolksPersonaStore* _tmp1_;
 
387
        GDateTime* _tmp2_;
 
388
        GError * _inner_error_;
 
389
};
 
390
 
 
391
struct _EdsfPersonaChangeRolesData {
 
392
        int _state_;
 
393
        GObject* _source_object_;
 
394
        GAsyncResult* _res_;
 
395
        GSimpleAsyncResult* _async_result;
 
396
        EdsfPersona* self;
 
397
        GeeSet* roles;
 
398
        FolksPersonaStore* _tmp0_;
 
399
        FolksPersonaStore* _tmp1_;
 
400
        GeeSet* _tmp2_;
 
401
        GError * _inner_error_;
 
402
};
 
403
 
 
404
struct _Block1Data {
 
405
        int _ref_count_;
 
406
        EdsfPersona * self;
 
407
        FolksAvatarCache* cache;
 
408
        GLoadableIcon* new_avatar;
 
409
};
 
410
 
 
411
 
 
412
static gpointer edsf_persona_parent_class = NULL;
 
413
static GHashTable* edsf_persona__im_eds_map;
 
414
static GStaticRecMutex __lock_edsf_persona__im_eds_map = {0};
 
415
static GHashTable* edsf_persona__im_eds_map = NULL;
 
416
static GTimeZone* edsf_persona__local_time_zone;
 
417
static GTimeZone* edsf_persona__local_time_zone = NULL;
 
418
static FolksAvatarDetailsIface* edsf_persona_folks_avatar_details_parent_iface = NULL;
 
419
static FolksBirthdayDetailsIface* edsf_persona_folks_birthday_details_parent_iface = NULL;
 
420
static FolksEmailDetailsIface* edsf_persona_folks_email_details_parent_iface = NULL;
 
421
static FolksGenderDetailsIface* edsf_persona_folks_gender_details_parent_iface = NULL;
 
422
static FolksGroupDetailsIface* edsf_persona_folks_group_details_parent_iface = NULL;
 
423
static FolksImDetailsIface* edsf_persona_folks_im_details_parent_iface = NULL;
 
424
static FolksLocalIdDetailsIface* edsf_persona_folks_local_id_details_parent_iface = NULL;
 
425
static FolksNameDetailsIface* edsf_persona_folks_name_details_parent_iface = NULL;
 
426
static FolksNoteDetailsIface* edsf_persona_folks_note_details_parent_iface = NULL;
 
427
static FolksPhoneDetailsIface* edsf_persona_folks_phone_details_parent_iface = NULL;
 
428
static FolksRoleDetailsIface* edsf_persona_folks_role_details_parent_iface = NULL;
 
429
static FolksUrlDetailsIface* edsf_persona_folks_url_details_parent_iface = NULL;
 
430
static FolksPostalAddressDetailsIface* edsf_persona_folks_postal_address_details_parent_iface = NULL;
 
431
static FolksWebServiceDetailsIface* edsf_persona_folks_web_service_details_parent_iface = NULL;
 
432
 
 
433
GType edsf_persona_get_type (void) G_GNUC_CONST;
 
434
#define EDSF_PERSONA_GET_PRIVATE(o) (G_TYPE_INSTANCE_GET_PRIVATE ((o), EDSF_TYPE_PERSONA, EdsfPersonaPrivate))
 
435
enum  {
 
436
        EDSF_PERSONA_DUMMY_PROPERTY,
 
437
        EDSF_PERSONA_CONTACT,
 
438
        EDSF_PERSONA_WEB_SERVICE_ADDRESSES,
 
439
        EDSF_PERSONA_LOCAL_IDS,
 
440
        EDSF_PERSONA_POSTAL_ADDRESSES,
 
441
        EDSF_PERSONA_PHONE_NUMBERS,
 
442
        EDSF_PERSONA_EMAIL_ADDRESSES,
 
443
        EDSF_PERSONA_NOTES,
 
444
        EDSF_PERSONA_LINKABLE_PROPERTIES,
 
445
        EDSF_PERSONA_WRITEABLE_PROPERTIES,
 
446
        EDSF_PERSONA_AVATAR,
 
447
        EDSF_PERSONA_STRUCTURED_NAME,
 
448
        EDSF_PERSONA_CONTACT_ID,
 
449
        EDSF_PERSONA_FULL_NAME,
 
450
        EDSF_PERSONA_NICKNAME,
 
451
        EDSF_PERSONA_GENDER,
 
452
        EDSF_PERSONA_URLS,
 
453
        EDSF_PERSONA_IM_ADDRESSES,
 
454
        EDSF_PERSONA_GROUPS,
 
455
        EDSF_PERSONA_CALENDAR_EVENT_ID,
 
456
        EDSF_PERSONA_BIRTHDAY,
 
457
        EDSF_PERSONA_ROLES
 
458
};
 
459
static GType edsf_persona_url_type_mapping_get_type (void) G_GNUC_CONST G_GNUC_UNUSED;
 
460
static EdsfPersonaUrlTypeMapping* edsf_persona_url_type_mapping_dup (const EdsfPersonaUrlTypeMapping* self);
 
461
static void edsf_persona_url_type_mapping_free (EdsfPersonaUrlTypeMapping* self);
 
462
static void edsf_persona_url_type_mapping_copy (const EdsfPersonaUrlTypeMapping* self, EdsfPersonaUrlTypeMapping* dest);
 
463
static void edsf_persona_url_type_mapping_destroy (EdsfPersonaUrlTypeMapping* self);
 
464
#define EDSF_PERSONA_gender_attribute_name "X-GENDER"
 
465
#define EDSF_PERSONA_gender_male "M"
 
466
#define EDSF_PERSONA_gender_female "F"
 
467
static void edsf_persona_real_change_web_service_addresses_data_free (gpointer _data);
 
468
static void edsf_persona_real_change_web_service_addresses (FolksWebServiceDetails* base, GeeMultiMap* web_service_addresses, GAsyncReadyCallback _callback_, gpointer _user_data_);
 
469
static gboolean edsf_persona_real_change_web_service_addresses_co (EdsfPersonaChangeWebServiceAddressesData* _data_);
 
470
GType edsf_persona_store_get_type (void) G_GNUC_CONST;
 
471
void _edsf_persona_store_set_web_service_addresses (EdsfPersonaStore* self, EdsfPersona* persona, GeeMultiMap* web_service_addresses, GAsyncReadyCallback _callback_, gpointer _user_data_);
 
472
void _edsf_persona_store_set_web_service_addresses_finish (EdsfPersonaStore* self, GAsyncResult* _res_, GError** error);
 
473
static void edsf_persona_change_web_service_addresses_ready (GObject* source_object, GAsyncResult* _res_, gpointer _user_data_);
 
474
static void edsf_persona_real_change_local_ids_data_free (gpointer _data);
 
475
static void edsf_persona_real_change_local_ids (FolksLocalIdDetails* base, GeeSet* local_ids, GAsyncReadyCallback _callback_, gpointer _user_data_);
 
476
static gboolean edsf_persona_real_change_local_ids_co (EdsfPersonaChangeLocalIdsData* _data_);
 
477
void _edsf_persona_store_set_local_ids (EdsfPersonaStore* self, EdsfPersona* persona, GeeSet* local_ids, GAsyncReadyCallback _callback_, gpointer _user_data_);
 
478
void _edsf_persona_store_set_local_ids_finish (EdsfPersonaStore* self, GAsyncResult* _res_, GError** error);
 
479
static void edsf_persona_change_local_ids_ready (GObject* source_object, GAsyncResult* _res_, gpointer _user_data_);
 
480
static void edsf_persona_real_change_postal_addresses_data_free (gpointer _data);
 
481
static void edsf_persona_real_change_postal_addresses (FolksPostalAddressDetails* base, GeeSet* postal_addresses, GAsyncReadyCallback _callback_, gpointer _user_data_);
 
482
static gboolean edsf_persona_real_change_postal_addresses_co (EdsfPersonaChangePostalAddressesData* _data_);
 
483
void _edsf_persona_store_set_postal_addresses (EdsfPersonaStore* self, EdsfPersona* persona, GeeSet* postal_fds, GAsyncReadyCallback _callback_, gpointer _user_data_);
 
484
void _edsf_persona_store_set_postal_addresses_finish (EdsfPersonaStore* self, GAsyncResult* _res_, GError** error);
 
485
static void edsf_persona_change_postal_addresses_ready (GObject* source_object, GAsyncResult* _res_, gpointer _user_data_);
 
486
static void edsf_persona_real_change_phone_numbers_data_free (gpointer _data);
 
487
static void edsf_persona_real_change_phone_numbers (FolksPhoneDetails* base, GeeSet* phone_numbers, GAsyncReadyCallback _callback_, gpointer _user_data_);
 
488
static gboolean edsf_persona_real_change_phone_numbers_co (EdsfPersonaChangePhoneNumbersData* _data_);
 
489
void _edsf_persona_store_set_phones (EdsfPersonaStore* self, EdsfPersona* persona, GeeSet* phones, GAsyncReadyCallback _callback_, gpointer _user_data_);
 
490
void _edsf_persona_store_set_phones_finish (EdsfPersonaStore* self, GAsyncResult* _res_, GError** error);
 
491
static void edsf_persona_change_phone_numbers_ready (GObject* source_object, GAsyncResult* _res_, gpointer _user_data_);
 
492
static void edsf_persona_real_change_email_addresses_data_free (gpointer _data);
 
493
static void edsf_persona_real_change_email_addresses (FolksEmailDetails* base, GeeSet* email_addresses, GAsyncReadyCallback _callback_, gpointer _user_data_);
 
494
static gboolean edsf_persona_real_change_email_addresses_co (EdsfPersonaChangeEmailAddressesData* _data_);
 
495
void _edsf_persona_store_set_emails (EdsfPersonaStore* self, EdsfPersona* persona, GeeSet* emails, GAsyncReadyCallback _callback_, gpointer _user_data_);
 
496
void _edsf_persona_store_set_emails_finish (EdsfPersonaStore* self, GAsyncResult* _res_, GError** error);
 
497
static void edsf_persona_change_email_addresses_ready (GObject* source_object, GAsyncResult* _res_, gpointer _user_data_);
 
498
static void edsf_persona_real_change_notes_data_free (gpointer _data);
 
499
static void edsf_persona_real_change_notes (FolksNoteDetails* base, GeeSet* notes, GAsyncReadyCallback _callback_, gpointer _user_data_);
 
500
static gboolean edsf_persona_real_change_notes_co (EdsfPersonaChangeNotesData* _data_);
 
501
void _edsf_persona_store_set_notes (EdsfPersonaStore* self, EdsfPersona* persona, GeeSet* notes, GAsyncReadyCallback _callback_, gpointer _user_data_);
 
502
void _edsf_persona_store_set_notes_finish (EdsfPersonaStore* self, GAsyncResult* _res_, GError** error);
 
503
static void edsf_persona_change_notes_ready (GObject* source_object, GAsyncResult* _res_, gpointer _user_data_);
 
504
static void edsf_persona_real_change_avatar_data_free (gpointer _data);
 
505
static void edsf_persona_real_change_avatar (FolksAvatarDetails* base, GLoadableIcon* avatar, GAsyncReadyCallback _callback_, gpointer _user_data_);
 
506
static gboolean edsf_persona_real_change_avatar_co (EdsfPersonaChangeAvatarData* _data_);
 
507
void _edsf_persona_store_set_avatar (EdsfPersonaStore* self, EdsfPersona* persona, GLoadableIcon* avatar, GAsyncReadyCallback _callback_, gpointer _user_data_);
 
508
void _edsf_persona_store_set_avatar_finish (EdsfPersonaStore* self, GAsyncResult* _res_, GError** error);
 
509
static void edsf_persona_change_avatar_ready (GObject* source_object, GAsyncResult* _res_, gpointer _user_data_);
 
510
static void edsf_persona_real_change_structured_name_data_free (gpointer _data);
 
511
static void edsf_persona_real_change_structured_name (FolksNameDetails* base, FolksStructuredName* structured_name, GAsyncReadyCallback _callback_, gpointer _user_data_);
 
512
static gboolean edsf_persona_real_change_structured_name_co (EdsfPersonaChangeStructuredNameData* _data_);
 
513
void _edsf_persona_store_set_structured_name (EdsfPersonaStore* self, EdsfPersona* persona, FolksStructuredName* sname, GAsyncReadyCallback _callback_, gpointer _user_data_);
 
514
void _edsf_persona_store_set_structured_name_finish (EdsfPersonaStore* self, GAsyncResult* _res_, GError** error);
 
515
static void edsf_persona_change_structured_name_ready (GObject* source_object, GAsyncResult* _res_, gpointer _user_data_);
 
516
static void edsf_persona_real_change_full_name_data_free (gpointer _data);
 
517
static void edsf_persona_real_change_full_name (FolksNameDetails* base, const gchar* full_name, GAsyncReadyCallback _callback_, gpointer _user_data_);
 
518
static gboolean edsf_persona_real_change_full_name_co (EdsfPersonaChangeFullNameData* _data_);
 
519
void _edsf_persona_store_set_full_name (EdsfPersonaStore* self, EdsfPersona* persona, const gchar* full_name, GAsyncReadyCallback _callback_, gpointer _user_data_);
 
520
void _edsf_persona_store_set_full_name_finish (EdsfPersonaStore* self, GAsyncResult* _res_, GError** error);
 
521
static void edsf_persona_change_full_name_ready (GObject* source_object, GAsyncResult* _res_, gpointer _user_data_);
 
522
static void edsf_persona_real_change_nickname_data_free (gpointer _data);
 
523
static void edsf_persona_real_change_nickname (FolksNameDetails* base, const gchar* nickname, GAsyncReadyCallback _callback_, gpointer _user_data_);
 
524
static gboolean edsf_persona_real_change_nickname_co (EdsfPersonaChangeNicknameData* _data_);
 
525
void _edsf_persona_store_set_nickname (EdsfPersonaStore* self, EdsfPersona* persona, const gchar* nickname, GAsyncReadyCallback _callback_, gpointer _user_data_);
 
526
void _edsf_persona_store_set_nickname_finish (EdsfPersonaStore* self, GAsyncResult* _res_, GError** error);
 
527
static void edsf_persona_change_nickname_ready (GObject* source_object, GAsyncResult* _res_, gpointer _user_data_);
 
528
static void edsf_persona_real_change_gender_data_free (gpointer _data);
 
529
static void edsf_persona_real_change_gender (FolksGenderDetails* base, FolksGender gender, GAsyncReadyCallback _callback_, gpointer _user_data_);
 
530
static gboolean edsf_persona_real_change_gender_co (EdsfPersonaChangeGenderData* _data_);
 
531
void _edsf_persona_store_set_gender (EdsfPersonaStore* self, EdsfPersona* persona, FolksGender gender, GAsyncReadyCallback _callback_, gpointer _user_data_);
 
532
void _edsf_persona_store_set_gender_finish (EdsfPersonaStore* self, GAsyncResult* _res_, GError** error);
 
533
static void edsf_persona_change_gender_ready (GObject* source_object, GAsyncResult* _res_, gpointer _user_data_);
 
534
static void edsf_persona_real_change_urls_data_free (gpointer _data);
 
535
static void edsf_persona_real_change_urls (FolksUrlDetails* base, GeeSet* urls, GAsyncReadyCallback _callback_, gpointer _user_data_);
 
536
static gboolean edsf_persona_real_change_urls_co (EdsfPersonaChangeUrlsData* _data_);
 
537
void _edsf_persona_store_set_urls (EdsfPersonaStore* self, EdsfPersona* persona, GeeSet* urls, GAsyncReadyCallback _callback_, gpointer _user_data_);
 
538
void _edsf_persona_store_set_urls_finish (EdsfPersonaStore* self, GAsyncResult* _res_, GError** error);
 
539
static void edsf_persona_change_urls_ready (GObject* source_object, GAsyncResult* _res_, gpointer _user_data_);
 
540
static void edsf_persona_real_change_im_addresses_data_free (gpointer _data);
 
541
static void edsf_persona_real_change_im_addresses (FolksImDetails* base, GeeMultiMap* im_addresses, GAsyncReadyCallback _callback_, gpointer _user_data_);
 
542
static gboolean edsf_persona_real_change_im_addresses_co (EdsfPersonaChangeImAddressesData* _data_);
 
543
void _edsf_persona_store_set_im_fds (EdsfPersonaStore* self, EdsfPersona* persona, GeeMultiMap* im_fds, GAsyncReadyCallback _callback_, gpointer _user_data_);
 
544
void _edsf_persona_store_set_im_fds_finish (EdsfPersonaStore* self, GAsyncResult* _res_, GError** error);
 
545
static void edsf_persona_change_im_addresses_ready (GObject* source_object, GAsyncResult* _res_, gpointer _user_data_);
 
546
static void edsf_persona_real_change_group_data_free (gpointer _data);
 
547
static void edsf_persona_real_change_group (FolksGroupDetails* base, const gchar* group, gboolean is_member, GAsyncReadyCallback _callback_, gpointer _user_data_);
 
548
static gboolean edsf_persona_real_change_group_co (EdsfPersonaChangeGroupData* _data_);
 
549
static void edsf_persona_change_group_ready (GObject* source_object, GAsyncResult* _res_, gpointer _user_data_);
 
550
static void edsf_persona_real_change_groups_data_free (gpointer _data);
 
551
static void edsf_persona_real_change_groups (FolksGroupDetails* base, GeeSet* groups, GAsyncReadyCallback _callback_, gpointer _user_data_);
 
552
static gboolean edsf_persona_real_change_groups_co (EdsfPersonaChangeGroupsData* _data_);
 
553
void _edsf_persona_store_set_groups (EdsfPersonaStore* self, EdsfPersona* persona, GeeSet* groups, GAsyncReadyCallback _callback_, gpointer _user_data_);
 
554
void _edsf_persona_store_set_groups_finish (EdsfPersonaStore* self, GAsyncResult* _res_, GError** error);
 
555
static void edsf_persona_change_groups_ready (GObject* source_object, GAsyncResult* _res_, gpointer _user_data_);
 
556
static void edsf_persona_real_change_birthday_data_free (gpointer _data);
 
557
static void edsf_persona_real_change_birthday (FolksBirthdayDetails* base, GDateTime* bday, GAsyncReadyCallback _callback_, gpointer _user_data_);
 
558
static gboolean edsf_persona_real_change_birthday_co (EdsfPersonaChangeBirthdayData* _data_);
 
559
void _edsf_persona_store_set_birthday (EdsfPersonaStore* self, EdsfPersona* persona, GDateTime* bday, GAsyncReadyCallback _callback_, gpointer _user_data_);
 
560
void _edsf_persona_store_set_birthday_finish (EdsfPersonaStore* self, GAsyncResult* _res_, GError** error);
 
561
static void edsf_persona_change_birthday_ready (GObject* source_object, GAsyncResult* _res_, gpointer _user_data_);
 
562
static void edsf_persona_real_change_roles_data_free (gpointer _data);
 
563
static void edsf_persona_real_change_roles (FolksRoleDetails* base, GeeSet* roles, GAsyncReadyCallback _callback_, gpointer _user_data_);
 
564
static gboolean edsf_persona_real_change_roles_co (EdsfPersonaChangeRolesData* _data_);
 
565
void _edsf_persona_store_set_roles (EdsfPersonaStore* self, EdsfPersona* persona, GeeSet* roles, GAsyncReadyCallback _callback_, gpointer _user_data_);
 
566
void _edsf_persona_store_set_roles_finish (EdsfPersonaStore* self, GAsyncResult* _res_, GError** error);
 
567
static void edsf_persona_change_roles_ready (GObject* source_object, GAsyncResult* _res_, gpointer _user_data_);
 
568
gchar* edsf_persona_build_iid_from_contact (const gchar* store_id, EContact* contact);
 
569
void* _edsf_persona_get_property_from_contact (EContact* contact, const gchar* prop_name);
 
570
gchar* edsf_persona_build_iid (const gchar* store_id, const gchar* contact_id);
 
571
EdsfPersona* edsf_persona_new (EdsfPersonaStore* store, EContact* contact);
 
572
EdsfPersona* edsf_persona_construct (GType object_type, EdsfPersonaStore* store, EContact* contact);
 
573
static void edsf_persona_set_contact_id (EdsfPersona* self, const gchar* value);
 
574
void _edsf_persona_update (EdsfPersona* self, EContact* contact);
 
575
static void edsf_persona_real_linkable_property_to_links (FolksPersona* base, const gchar* prop_name, FolksPersonaLinkablePropertyCallback callback, void* callback_target);
 
576
static void edsf_persona_set_contact (EdsfPersona* self, EContact* value);
 
577
static void _edsf_persona_update_names (EdsfPersona* self);
 
578
static void _edsf_persona_update_avatar (EdsfPersona* self);
 
579
static void _edsf_persona_update_urls (EdsfPersona* self);
 
580
static void _edsf_persona_update_phones (EdsfPersona* self);
 
581
static void _edsf_persona_update_addresses (EdsfPersona* self);
 
582
static void _edsf_persona_update_emails (EdsfPersona* self);
 
583
static void _edsf_persona_update_im_addresses (EdsfPersona* self);
 
584
static void _edsf_persona_update_groups (EdsfPersona* self);
 
585
static void _edsf_persona_update_notes (EdsfPersona* self);
 
586
static void _edsf_persona_update_local_ids (EdsfPersona* self);
 
587
static void _edsf_persona_update_web_services_addresses (EdsfPersona* self);
 
588
static void _edsf_persona_update_gender (EdsfPersona* self);
 
589
static void _edsf_persona_update_birthday (EdsfPersona* self);
 
590
static void _edsf_persona_update_roles (EdsfPersona* self);
 
591
static void _edsf_persona_update_params (EdsfPersona* self, FolksAbstractFieldDetails* details, EVCardAttribute* attr);
 
592
EContact* edsf_persona_get_contact (EdsfPersona* self);
 
593
static EVCardAttribute* _vala_EVCardAttribute_copy (EVCardAttribute* self);
 
594
static void _vala_EVCardAttribute_free (EVCardAttribute* self);
 
595
static void* _edsf_persona_get_property (EdsfPersona* self, const gchar* prop_name);
 
596
static EContactDate* _vala_EContactDate_copy (EContactDate* self);
 
597
static void _vala_EContactDate_free (EContactDate* self);
 
598
static FolksRoleFieldDetails* _edsf_persona_get_default_role (EdsfPersona* self);
 
599
EdsfSetComparator* edsf_set_comparator_new (GType g_type, GBoxedCopyFunc g_dup_func, GDestroyNotify g_destroy_func);
 
600
EdsfSetComparator* edsf_set_comparator_construct (GType object_type, GType g_type, GBoxedCopyFunc g_dup_func, GDestroyNotify g_destroy_func);
 
601
GType edsf_set_comparator_get_type (void) G_GNUC_CONST;
 
602
gboolean edsf_set_comparator_equal (EdsfSetComparator* self, GeeSet* a, GeeSet* b);
 
603
static EVCardAttributeParam* _vala_EVCardAttributeParam_copy (EVCardAttributeParam* self);
 
604
static void _vala_EVCardAttributeParam_free (EVCardAttributeParam* self);
 
605
static void __vala_EVCardAttribute_free0_ (gpointer var);
 
606
static void _g_list_free___vala_EVCardAttribute_free0_ (GList* self);
 
607
static EContactName* _vala_EContactName_copy (EContactName* self);
 
608
static void _vala_EContactName_free (EContactName* self);
 
609
static GLoadableIcon* _edsf_persona_contact_photo_to_loadable_icon (EdsfPersona* self, EContactPhoto* p);
 
610
EdsfMemoryIcon* edsf_memory_icon_new (const gchar* image_type, guint8* image_data, int image_data_length1);
 
611
EdsfMemoryIcon* edsf_memory_icon_construct (GType object_type, const gchar* image_type, guint8* image_data, int image_data_length1);
 
612
GType edsf_memory_icon_get_type (void) G_GNUC_CONST;
 
613
static Block1Data* block1_data_ref (Block1Data* _data1_);
 
614
static void block1_data_unref (Block1Data* _data1_);
 
615
static EContactPhoto* _vala_EContactPhoto_copy (EContactPhoto* self);
 
616
static void ___lambda4_ (Block1Data* _data1_, GObject* obj, GAsyncResult* res);
 
617
static void ____lambda4__gasync_ready_callback (GObject* source_object, GAsyncResult* res, gpointer self);
 
618
static void ____lambda7_ (Block1Data* _data1_, GObject* obj, GAsyncResult* res);
 
619
static void _____lambda7__gasync_ready_callback (GObject* source_object, GAsyncResult* res, gpointer self);
 
620
static void _vala_EContactPhoto_free (EContactPhoto* self);
 
621
GHashTable* _edsf_persona_get_im_eds_map (void);
 
622
static gchar* _edsf_persona_im_proto_from_addr (EdsfPersona* self, const gchar* addr);
 
623
static void _g_free0_ (gpointer var);
 
624
static FolksPostalAddress* _edsf_persona_postal_address_from_attribute (EdsfPersona* self, EVCardAttribute* attr);
 
625
const gchar* edsf_persona_get_contact_id (EdsfPersona* self);
 
626
static void edsf_persona_finalize (GObject* obj);
 
627
static void _vala_edsf_persona_get_property (GObject * object, guint property_id, GValue * value, GParamSpec * pspec);
 
628
static void _vala_edsf_persona_set_property (GObject * object, guint property_id, const GValue * value, GParamSpec * pspec);
 
629
static void _vala_array_destroy (gpointer array, gint array_length, GDestroyNotify destroy_func);
 
630
static void _vala_array_free (gpointer array, gint array_length, GDestroyNotify destroy_func);
 
631
static gint _vala_array_length (gpointer array);
 
632
 
 
633
const gchar* EDSF_PERSONA_phone_fields[12] = {"assistant_phone", "business_phone", "business_phone_2", "callback_phone", "car_phone", "company_phone", "home_phone", "home_phone_2", "isdn_phone", "mobile_phone", "other_phone", "primary_phone"};
 
634
const gchar* EDSF_PERSONA_address_fields[3] = {"address_home", "address_other", "address_work"};
 
635
const gchar* EDSF_PERSONA_email_fields[4] = {"email_1", "email_2", "email_3", "email_4"};
 
636
const gchar* EDSF_PERSONA_url_properties[4] = {"blog_url", "fburl", "homepage_url", "video_url"};
 
637
const EdsfPersonaUrlTypeMapping EDSF_PERSONA__url_properties[4] = {{"homepage_url", FOLKS_URL_FIELD_DETAILS_PARAM_TYPE_HOME_PAGE}, {"blog_url", FOLKS_URL_FIELD_DETAILS_PARAM_TYPE_BLOG}, {"fburl", "x-free-busy"}, {"video_url", "x-video"}};
 
638
static const gchar* EDSF_PERSONA__linkable_properties[3] = {"im-addresses", "local-ids", "web-service-addresses"};
 
639
 
 
640
static void edsf_persona_real_change_web_service_addresses_data_free (gpointer _data) {
 
641
        EdsfPersonaChangeWebServiceAddressesData* _data_;
 
642
        _data_ = _data;
 
643
        _g_object_unref0 (_data_->web_service_addresses);
 
644
        _g_object_unref0 (_data_->self);
 
645
        g_slice_free (EdsfPersonaChangeWebServiceAddressesData, _data_);
 
646
}
 
647
 
 
648
 
 
649
static gpointer _g_object_ref0 (gpointer self) {
 
650
        return self ? g_object_ref (self) : NULL;
 
651
}
 
652
 
 
653
 
 
654
static void edsf_persona_real_change_web_service_addresses (FolksWebServiceDetails* base, GeeMultiMap* web_service_addresses, GAsyncReadyCallback _callback_, gpointer _user_data_) {
 
655
        EdsfPersona * self;
 
656
        EdsfPersonaChangeWebServiceAddressesData* _data_;
 
657
        EdsfPersona* _tmp0_;
 
658
        GeeMultiMap* _tmp1_;
 
659
        GeeMultiMap* _tmp2_;
 
660
        self = (EdsfPersona*) base;
 
661
        _data_ = g_slice_new0 (EdsfPersonaChangeWebServiceAddressesData);
 
662
        _data_->_async_result = g_simple_async_result_new (G_OBJECT (self), _callback_, _user_data_, edsf_persona_real_change_web_service_addresses);
 
663
        g_simple_async_result_set_op_res_gpointer (_data_->_async_result, _data_, edsf_persona_real_change_web_service_addresses_data_free);
 
664
        _tmp0_ = _g_object_ref0 (self);
 
665
        _data_->self = _tmp0_;
 
666
        _tmp1_ = web_service_addresses;
 
667
        _tmp2_ = _g_object_ref0 (_tmp1_);
 
668
        _data_->web_service_addresses = _tmp2_;
 
669
        edsf_persona_real_change_web_service_addresses_co (_data_);
 
670
}
 
671
 
 
672
 
 
673
static void edsf_persona_real_change_web_service_addresses_finish (FolksWebServiceDetails* base, GAsyncResult* _res_, GError** error) {
 
674
        EdsfPersonaChangeWebServiceAddressesData* _data_;
 
675
        if (g_simple_async_result_propagate_error (G_SIMPLE_ASYNC_RESULT (_res_), error)) {
 
676
                return;
 
677
        }
 
678
        _data_ = g_simple_async_result_get_op_res_gpointer (G_SIMPLE_ASYNC_RESULT (_res_));
 
679
}
 
680
 
 
681
 
 
682
/**
 
683
   * {@inheritDoc}
 
684
   *
 
685
   * @since 0.6.2
 
686
   */
 
687
static void edsf_persona_change_web_service_addresses_ready (GObject* source_object, GAsyncResult* _res_, gpointer _user_data_) {
 
688
        EdsfPersonaChangeWebServiceAddressesData* _data_;
 
689
        _data_ = _user_data_;
 
690
        _data_->_source_object_ = source_object;
 
691
        _data_->_res_ = _res_;
 
692
        edsf_persona_real_change_web_service_addresses_co (_data_);
 
693
}
 
694
 
 
695
 
 
696
static gboolean edsf_persona_real_change_web_service_addresses_co (EdsfPersonaChangeWebServiceAddressesData* _data_) {
 
697
        switch (_data_->_state_) {
 
698
                case 0:
 
699
                goto _state_0;
 
700
                case 1:
 
701
                goto _state_1;
 
702
                default:
 
703
                g_assert_not_reached ();
 
704
        }
 
705
        _state_0:
 
706
        _data_->_tmp0_ = folks_persona_get_store ((FolksPersona*) _data_->self);
 
707
        _data_->_tmp1_ = _data_->_tmp0_;
 
708
        _data_->_tmp2_ = _data_->web_service_addresses;
 
709
        _data_->_state_ = 1;
 
710
        _edsf_persona_store_set_web_service_addresses (EDSF_PERSONA_STORE (_data_->_tmp1_), _data_->self, _data_->_tmp2_, edsf_persona_change_web_service_addresses_ready, _data_);
 
711
        return FALSE;
 
712
        _state_1:
 
713
        _edsf_persona_store_set_web_service_addresses_finish (EDSF_PERSONA_STORE (_data_->_tmp1_), _data_->_res_, &_data_->_inner_error_);
 
714
        if (_data_->_inner_error_ != NULL) {
 
715
                if (_data_->_inner_error_->domain == FOLKS_PROPERTY_ERROR) {
 
716
                        g_simple_async_result_set_from_error (_data_->_async_result, _data_->_inner_error_);
 
717
                        g_error_free (_data_->_inner_error_);
 
718
                        if (_data_->_state_ == 0) {
 
719
                                g_simple_async_result_complete_in_idle (_data_->_async_result);
 
720
                        } else {
 
721
                                g_simple_async_result_complete (_data_->_async_result);
 
722
                        }
 
723
                        g_object_unref (_data_->_async_result);
 
724
                        return FALSE;
 
725
                } else {
 
726
                        g_critical ("file %s: line %d: uncaught error: %s (%s, %d)", __FILE__, __LINE__, _data_->_inner_error_->message, g_quark_to_string (_data_->_inner_error_->domain), _data_->_inner_error_->code);
 
727
                        g_clear_error (&_data_->_inner_error_);
 
728
                        return FALSE;
 
729
                }
 
730
        }
 
731
        if (_data_->_state_ == 0) {
 
732
                g_simple_async_result_complete_in_idle (_data_->_async_result);
 
733
        } else {
 
734
                g_simple_async_result_complete (_data_->_async_result);
 
735
        }
 
736
        g_object_unref (_data_->_async_result);
 
737
        return FALSE;
 
738
}
 
739
 
 
740
 
 
741
static void edsf_persona_real_change_local_ids_data_free (gpointer _data) {
 
742
        EdsfPersonaChangeLocalIdsData* _data_;
 
743
        _data_ = _data;
 
744
        _g_object_unref0 (_data_->local_ids);
 
745
        _g_object_unref0 (_data_->self);
 
746
        g_slice_free (EdsfPersonaChangeLocalIdsData, _data_);
 
747
}
 
748
 
 
749
 
 
750
static void edsf_persona_real_change_local_ids (FolksLocalIdDetails* base, GeeSet* local_ids, GAsyncReadyCallback _callback_, gpointer _user_data_) {
 
751
        EdsfPersona * self;
 
752
        EdsfPersonaChangeLocalIdsData* _data_;
 
753
        EdsfPersona* _tmp0_;
 
754
        GeeSet* _tmp1_;
 
755
        GeeSet* _tmp2_;
 
756
        self = (EdsfPersona*) base;
 
757
        _data_ = g_slice_new0 (EdsfPersonaChangeLocalIdsData);
 
758
        _data_->_async_result = g_simple_async_result_new (G_OBJECT (self), _callback_, _user_data_, edsf_persona_real_change_local_ids);
 
759
        g_simple_async_result_set_op_res_gpointer (_data_->_async_result, _data_, edsf_persona_real_change_local_ids_data_free);
 
760
        _tmp0_ = _g_object_ref0 (self);
 
761
        _data_->self = _tmp0_;
 
762
        _tmp1_ = local_ids;
 
763
        _tmp2_ = _g_object_ref0 (_tmp1_);
 
764
        _data_->local_ids = _tmp2_;
 
765
        edsf_persona_real_change_local_ids_co (_data_);
 
766
}
 
767
 
 
768
 
 
769
static void edsf_persona_real_change_local_ids_finish (FolksLocalIdDetails* base, GAsyncResult* _res_, GError** error) {
 
770
        EdsfPersonaChangeLocalIdsData* _data_;
 
771
        if (g_simple_async_result_propagate_error (G_SIMPLE_ASYNC_RESULT (_res_), error)) {
 
772
                return;
 
773
        }
 
774
        _data_ = g_simple_async_result_get_op_res_gpointer (G_SIMPLE_ASYNC_RESULT (_res_));
 
775
}
 
776
 
 
777
 
 
778
/**
 
779
   * {@inheritDoc}
 
780
   *
 
781
   * @since 0.6.2
 
782
   */
 
783
static void edsf_persona_change_local_ids_ready (GObject* source_object, GAsyncResult* _res_, gpointer _user_data_) {
 
784
        EdsfPersonaChangeLocalIdsData* _data_;
 
785
        _data_ = _user_data_;
 
786
        _data_->_source_object_ = source_object;
 
787
        _data_->_res_ = _res_;
 
788
        edsf_persona_real_change_local_ids_co (_data_);
 
789
}
 
790
 
 
791
 
 
792
static gboolean edsf_persona_real_change_local_ids_co (EdsfPersonaChangeLocalIdsData* _data_) {
 
793
        switch (_data_->_state_) {
 
794
                case 0:
 
795
                goto _state_0;
 
796
                case 1:
 
797
                goto _state_1;
 
798
                default:
 
799
                g_assert_not_reached ();
 
800
        }
 
801
        _state_0:
 
802
        _data_->_tmp0_ = folks_persona_get_store ((FolksPersona*) _data_->self);
 
803
        _data_->_tmp1_ = _data_->_tmp0_;
 
804
        _data_->_tmp2_ = _data_->local_ids;
 
805
        _data_->_state_ = 1;
 
806
        _edsf_persona_store_set_local_ids (EDSF_PERSONA_STORE (_data_->_tmp1_), _data_->self, _data_->_tmp2_, edsf_persona_change_local_ids_ready, _data_);
 
807
        return FALSE;
 
808
        _state_1:
 
809
        _edsf_persona_store_set_local_ids_finish (EDSF_PERSONA_STORE (_data_->_tmp1_), _data_->_res_, &_data_->_inner_error_);
 
810
        if (_data_->_inner_error_ != NULL) {
 
811
                if (_data_->_inner_error_->domain == FOLKS_PROPERTY_ERROR) {
 
812
                        g_simple_async_result_set_from_error (_data_->_async_result, _data_->_inner_error_);
 
813
                        g_error_free (_data_->_inner_error_);
 
814
                        if (_data_->_state_ == 0) {
 
815
                                g_simple_async_result_complete_in_idle (_data_->_async_result);
 
816
                        } else {
 
817
                                g_simple_async_result_complete (_data_->_async_result);
 
818
                        }
 
819
                        g_object_unref (_data_->_async_result);
 
820
                        return FALSE;
 
821
                } else {
 
822
                        g_critical ("file %s: line %d: uncaught error: %s (%s, %d)", __FILE__, __LINE__, _data_->_inner_error_->message, g_quark_to_string (_data_->_inner_error_->domain), _data_->_inner_error_->code);
 
823
                        g_clear_error (&_data_->_inner_error_);
 
824
                        return FALSE;
 
825
                }
 
826
        }
 
827
        if (_data_->_state_ == 0) {
 
828
                g_simple_async_result_complete_in_idle (_data_->_async_result);
 
829
        } else {
 
830
                g_simple_async_result_complete (_data_->_async_result);
 
831
        }
 
832
        g_object_unref (_data_->_async_result);
 
833
        return FALSE;
 
834
}
 
835
 
 
836
 
 
837
static void edsf_persona_real_change_postal_addresses_data_free (gpointer _data) {
 
838
        EdsfPersonaChangePostalAddressesData* _data_;
 
839
        _data_ = _data;
 
840
        _g_object_unref0 (_data_->postal_addresses);
 
841
        _g_object_unref0 (_data_->self);
 
842
        g_slice_free (EdsfPersonaChangePostalAddressesData, _data_);
 
843
}
 
844
 
 
845
 
 
846
static void edsf_persona_real_change_postal_addresses (FolksPostalAddressDetails* base, GeeSet* postal_addresses, GAsyncReadyCallback _callback_, gpointer _user_data_) {
 
847
        EdsfPersona * self;
 
848
        EdsfPersonaChangePostalAddressesData* _data_;
 
849
        EdsfPersona* _tmp0_;
 
850
        GeeSet* _tmp1_;
 
851
        GeeSet* _tmp2_;
 
852
        self = (EdsfPersona*) base;
 
853
        _data_ = g_slice_new0 (EdsfPersonaChangePostalAddressesData);
 
854
        _data_->_async_result = g_simple_async_result_new (G_OBJECT (self), _callback_, _user_data_, edsf_persona_real_change_postal_addresses);
 
855
        g_simple_async_result_set_op_res_gpointer (_data_->_async_result, _data_, edsf_persona_real_change_postal_addresses_data_free);
 
856
        _tmp0_ = _g_object_ref0 (self);
 
857
        _data_->self = _tmp0_;
 
858
        _tmp1_ = postal_addresses;
 
859
        _tmp2_ = _g_object_ref0 (_tmp1_);
 
860
        _data_->postal_addresses = _tmp2_;
 
861
        edsf_persona_real_change_postal_addresses_co (_data_);
 
862
}
 
863
 
 
864
 
 
865
static void edsf_persona_real_change_postal_addresses_finish (FolksPostalAddressDetails* base, GAsyncResult* _res_, GError** error) {
 
866
        EdsfPersonaChangePostalAddressesData* _data_;
 
867
        if (g_simple_async_result_propagate_error (G_SIMPLE_ASYNC_RESULT (_res_), error)) {
 
868
                return;
 
869
        }
 
870
        _data_ = g_simple_async_result_get_op_res_gpointer (G_SIMPLE_ASYNC_RESULT (_res_));
 
871
}
 
872
 
 
873
 
 
874
/**
 
875
   * {@inheritDoc}
 
876
   *
 
877
   * @since 0.6.2
 
878
   */
 
879
static void edsf_persona_change_postal_addresses_ready (GObject* source_object, GAsyncResult* _res_, gpointer _user_data_) {
 
880
        EdsfPersonaChangePostalAddressesData* _data_;
 
881
        _data_ = _user_data_;
 
882
        _data_->_source_object_ = source_object;
 
883
        _data_->_res_ = _res_;
 
884
        edsf_persona_real_change_postal_addresses_co (_data_);
 
885
}
 
886
 
 
887
 
 
888
static gboolean edsf_persona_real_change_postal_addresses_co (EdsfPersonaChangePostalAddressesData* _data_) {
 
889
        switch (_data_->_state_) {
 
890
                case 0:
 
891
                goto _state_0;
 
892
                case 1:
 
893
                goto _state_1;
 
894
                default:
 
895
                g_assert_not_reached ();
 
896
        }
 
897
        _state_0:
 
898
        _data_->_tmp0_ = folks_persona_get_store ((FolksPersona*) _data_->self);
 
899
        _data_->_tmp1_ = _data_->_tmp0_;
 
900
        _data_->_tmp2_ = _data_->postal_addresses;
 
901
        _data_->_state_ = 1;
 
902
        _edsf_persona_store_set_postal_addresses (EDSF_PERSONA_STORE (_data_->_tmp1_), _data_->self, _data_->_tmp2_, edsf_persona_change_postal_addresses_ready, _data_);
 
903
        return FALSE;
 
904
        _state_1:
 
905
        _edsf_persona_store_set_postal_addresses_finish (EDSF_PERSONA_STORE (_data_->_tmp1_), _data_->_res_, &_data_->_inner_error_);
 
906
        if (_data_->_inner_error_ != NULL) {
 
907
                if (_data_->_inner_error_->domain == FOLKS_PROPERTY_ERROR) {
 
908
                        g_simple_async_result_set_from_error (_data_->_async_result, _data_->_inner_error_);
 
909
                        g_error_free (_data_->_inner_error_);
 
910
                        if (_data_->_state_ == 0) {
 
911
                                g_simple_async_result_complete_in_idle (_data_->_async_result);
 
912
                        } else {
 
913
                                g_simple_async_result_complete (_data_->_async_result);
 
914
                        }
 
915
                        g_object_unref (_data_->_async_result);
 
916
                        return FALSE;
 
917
                } else {
 
918
                        g_critical ("file %s: line %d: uncaught error: %s (%s, %d)", __FILE__, __LINE__, _data_->_inner_error_->message, g_quark_to_string (_data_->_inner_error_->domain), _data_->_inner_error_->code);
 
919
                        g_clear_error (&_data_->_inner_error_);
 
920
                        return FALSE;
 
921
                }
 
922
        }
 
923
        if (_data_->_state_ == 0) {
 
924
                g_simple_async_result_complete_in_idle (_data_->_async_result);
 
925
        } else {
 
926
                g_simple_async_result_complete (_data_->_async_result);
 
927
        }
 
928
        g_object_unref (_data_->_async_result);
 
929
        return FALSE;
 
930
}
 
931
 
 
932
 
 
933
static void edsf_persona_real_change_phone_numbers_data_free (gpointer _data) {
 
934
        EdsfPersonaChangePhoneNumbersData* _data_;
 
935
        _data_ = _data;
 
936
        _g_object_unref0 (_data_->phone_numbers);
 
937
        _g_object_unref0 (_data_->self);
 
938
        g_slice_free (EdsfPersonaChangePhoneNumbersData, _data_);
 
939
}
 
940
 
 
941
 
 
942
static void edsf_persona_real_change_phone_numbers (FolksPhoneDetails* base, GeeSet* phone_numbers, GAsyncReadyCallback _callback_, gpointer _user_data_) {
 
943
        EdsfPersona * self;
 
944
        EdsfPersonaChangePhoneNumbersData* _data_;
 
945
        EdsfPersona* _tmp0_;
 
946
        GeeSet* _tmp1_;
 
947
        GeeSet* _tmp2_;
 
948
        self = (EdsfPersona*) base;
 
949
        _data_ = g_slice_new0 (EdsfPersonaChangePhoneNumbersData);
 
950
        _data_->_async_result = g_simple_async_result_new (G_OBJECT (self), _callback_, _user_data_, edsf_persona_real_change_phone_numbers);
 
951
        g_simple_async_result_set_op_res_gpointer (_data_->_async_result, _data_, edsf_persona_real_change_phone_numbers_data_free);
 
952
        _tmp0_ = _g_object_ref0 (self);
 
953
        _data_->self = _tmp0_;
 
954
        _tmp1_ = phone_numbers;
 
955
        _tmp2_ = _g_object_ref0 (_tmp1_);
 
956
        _data_->phone_numbers = _tmp2_;
 
957
        edsf_persona_real_change_phone_numbers_co (_data_);
 
958
}
 
959
 
 
960
 
 
961
static void edsf_persona_real_change_phone_numbers_finish (FolksPhoneDetails* base, GAsyncResult* _res_, GError** error) {
 
962
        EdsfPersonaChangePhoneNumbersData* _data_;
 
963
        if (g_simple_async_result_propagate_error (G_SIMPLE_ASYNC_RESULT (_res_), error)) {
 
964
                return;
 
965
        }
 
966
        _data_ = g_simple_async_result_get_op_res_gpointer (G_SIMPLE_ASYNC_RESULT (_res_));
 
967
}
 
968
 
 
969
 
 
970
/**
 
971
   * {@inheritDoc}
 
972
   *
 
973
   * @since 0.6.2
 
974
   */
 
975
static void edsf_persona_change_phone_numbers_ready (GObject* source_object, GAsyncResult* _res_, gpointer _user_data_) {
 
976
        EdsfPersonaChangePhoneNumbersData* _data_;
 
977
        _data_ = _user_data_;
 
978
        _data_->_source_object_ = source_object;
 
979
        _data_->_res_ = _res_;
 
980
        edsf_persona_real_change_phone_numbers_co (_data_);
 
981
}
 
982
 
 
983
 
 
984
static gboolean edsf_persona_real_change_phone_numbers_co (EdsfPersonaChangePhoneNumbersData* _data_) {
 
985
        switch (_data_->_state_) {
 
986
                case 0:
 
987
                goto _state_0;
 
988
                case 1:
 
989
                goto _state_1;
 
990
                default:
 
991
                g_assert_not_reached ();
 
992
        }
 
993
        _state_0:
 
994
        _data_->_tmp0_ = folks_persona_get_store ((FolksPersona*) _data_->self);
 
995
        _data_->_tmp1_ = _data_->_tmp0_;
 
996
        _data_->_tmp2_ = _data_->phone_numbers;
 
997
        _data_->_state_ = 1;
 
998
        _edsf_persona_store_set_phones (EDSF_PERSONA_STORE (_data_->_tmp1_), _data_->self, _data_->_tmp2_, edsf_persona_change_phone_numbers_ready, _data_);
 
999
        return FALSE;
 
1000
        _state_1:
 
1001
        _edsf_persona_store_set_phones_finish (EDSF_PERSONA_STORE (_data_->_tmp1_), _data_->_res_, &_data_->_inner_error_);
 
1002
        if (_data_->_inner_error_ != NULL) {
 
1003
                if (_data_->_inner_error_->domain == FOLKS_PROPERTY_ERROR) {
 
1004
                        g_simple_async_result_set_from_error (_data_->_async_result, _data_->_inner_error_);
 
1005
                        g_error_free (_data_->_inner_error_);
 
1006
                        if (_data_->_state_ == 0) {
 
1007
                                g_simple_async_result_complete_in_idle (_data_->_async_result);
 
1008
                        } else {
 
1009
                                g_simple_async_result_complete (_data_->_async_result);
 
1010
                        }
 
1011
                        g_object_unref (_data_->_async_result);
 
1012
                        return FALSE;
 
1013
                } else {
 
1014
                        g_critical ("file %s: line %d: uncaught error: %s (%s, %d)", __FILE__, __LINE__, _data_->_inner_error_->message, g_quark_to_string (_data_->_inner_error_->domain), _data_->_inner_error_->code);
 
1015
                        g_clear_error (&_data_->_inner_error_);
 
1016
                        return FALSE;
 
1017
                }
 
1018
        }
 
1019
        if (_data_->_state_ == 0) {
 
1020
                g_simple_async_result_complete_in_idle (_data_->_async_result);
 
1021
        } else {
 
1022
                g_simple_async_result_complete (_data_->_async_result);
 
1023
        }
 
1024
        g_object_unref (_data_->_async_result);
 
1025
        return FALSE;
 
1026
}
 
1027
 
 
1028
 
 
1029
static void edsf_persona_real_change_email_addresses_data_free (gpointer _data) {
 
1030
        EdsfPersonaChangeEmailAddressesData* _data_;
 
1031
        _data_ = _data;
 
1032
        _g_object_unref0 (_data_->email_addresses);
 
1033
        _g_object_unref0 (_data_->self);
 
1034
        g_slice_free (EdsfPersonaChangeEmailAddressesData, _data_);
 
1035
}
 
1036
 
 
1037
 
 
1038
static void edsf_persona_real_change_email_addresses (FolksEmailDetails* base, GeeSet* email_addresses, GAsyncReadyCallback _callback_, gpointer _user_data_) {
 
1039
        EdsfPersona * self;
 
1040
        EdsfPersonaChangeEmailAddressesData* _data_;
 
1041
        EdsfPersona* _tmp0_;
 
1042
        GeeSet* _tmp1_;
 
1043
        GeeSet* _tmp2_;
 
1044
        self = (EdsfPersona*) base;
 
1045
        _data_ = g_slice_new0 (EdsfPersonaChangeEmailAddressesData);
 
1046
        _data_->_async_result = g_simple_async_result_new (G_OBJECT (self), _callback_, _user_data_, edsf_persona_real_change_email_addresses);
 
1047
        g_simple_async_result_set_op_res_gpointer (_data_->_async_result, _data_, edsf_persona_real_change_email_addresses_data_free);
 
1048
        _tmp0_ = _g_object_ref0 (self);
 
1049
        _data_->self = _tmp0_;
 
1050
        _tmp1_ = email_addresses;
 
1051
        _tmp2_ = _g_object_ref0 (_tmp1_);
 
1052
        _data_->email_addresses = _tmp2_;
 
1053
        edsf_persona_real_change_email_addresses_co (_data_);
 
1054
}
 
1055
 
 
1056
 
 
1057
static void edsf_persona_real_change_email_addresses_finish (FolksEmailDetails* base, GAsyncResult* _res_, GError** error) {
 
1058
        EdsfPersonaChangeEmailAddressesData* _data_;
 
1059
        if (g_simple_async_result_propagate_error (G_SIMPLE_ASYNC_RESULT (_res_), error)) {
 
1060
                return;
 
1061
        }
 
1062
        _data_ = g_simple_async_result_get_op_res_gpointer (G_SIMPLE_ASYNC_RESULT (_res_));
 
1063
}
 
1064
 
 
1065
 
 
1066
/**
 
1067
   * {@inheritDoc}
 
1068
   *
 
1069
   * @since 0.6.2
 
1070
   */
 
1071
static void edsf_persona_change_email_addresses_ready (GObject* source_object, GAsyncResult* _res_, gpointer _user_data_) {
 
1072
        EdsfPersonaChangeEmailAddressesData* _data_;
 
1073
        _data_ = _user_data_;
 
1074
        _data_->_source_object_ = source_object;
 
1075
        _data_->_res_ = _res_;
 
1076
        edsf_persona_real_change_email_addresses_co (_data_);
 
1077
}
 
1078
 
 
1079
 
 
1080
static gboolean edsf_persona_real_change_email_addresses_co (EdsfPersonaChangeEmailAddressesData* _data_) {
 
1081
        switch (_data_->_state_) {
 
1082
                case 0:
 
1083
                goto _state_0;
 
1084
                case 1:
 
1085
                goto _state_1;
 
1086
                default:
 
1087
                g_assert_not_reached ();
 
1088
        }
 
1089
        _state_0:
 
1090
        _data_->_tmp0_ = folks_persona_get_store ((FolksPersona*) _data_->self);
 
1091
        _data_->_tmp1_ = _data_->_tmp0_;
 
1092
        _data_->_tmp2_ = _data_->email_addresses;
 
1093
        _data_->_state_ = 1;
 
1094
        _edsf_persona_store_set_emails (EDSF_PERSONA_STORE (_data_->_tmp1_), _data_->self, _data_->_tmp2_, edsf_persona_change_email_addresses_ready, _data_);
 
1095
        return FALSE;
 
1096
        _state_1:
 
1097
        _edsf_persona_store_set_emails_finish (EDSF_PERSONA_STORE (_data_->_tmp1_), _data_->_res_, &_data_->_inner_error_);
 
1098
        if (_data_->_inner_error_ != NULL) {
 
1099
                if (_data_->_inner_error_->domain == FOLKS_PROPERTY_ERROR) {
 
1100
                        g_simple_async_result_set_from_error (_data_->_async_result, _data_->_inner_error_);
 
1101
                        g_error_free (_data_->_inner_error_);
 
1102
                        if (_data_->_state_ == 0) {
 
1103
                                g_simple_async_result_complete_in_idle (_data_->_async_result);
 
1104
                        } else {
 
1105
                                g_simple_async_result_complete (_data_->_async_result);
 
1106
                        }
 
1107
                        g_object_unref (_data_->_async_result);
 
1108
                        return FALSE;
 
1109
                } else {
 
1110
                        g_critical ("file %s: line %d: uncaught error: %s (%s, %d)", __FILE__, __LINE__, _data_->_inner_error_->message, g_quark_to_string (_data_->_inner_error_->domain), _data_->_inner_error_->code);
 
1111
                        g_clear_error (&_data_->_inner_error_);
 
1112
                        return FALSE;
 
1113
                }
 
1114
        }
 
1115
        if (_data_->_state_ == 0) {
 
1116
                g_simple_async_result_complete_in_idle (_data_->_async_result);
 
1117
        } else {
 
1118
                g_simple_async_result_complete (_data_->_async_result);
 
1119
        }
 
1120
        g_object_unref (_data_->_async_result);
 
1121
        return FALSE;
 
1122
}
 
1123
 
 
1124
 
 
1125
static void edsf_persona_real_change_notes_data_free (gpointer _data) {
 
1126
        EdsfPersonaChangeNotesData* _data_;
 
1127
        _data_ = _data;
 
1128
        _g_object_unref0 (_data_->notes);
 
1129
        _g_object_unref0 (_data_->self);
 
1130
        g_slice_free (EdsfPersonaChangeNotesData, _data_);
 
1131
}
 
1132
 
 
1133
 
 
1134
static void edsf_persona_real_change_notes (FolksNoteDetails* base, GeeSet* notes, GAsyncReadyCallback _callback_, gpointer _user_data_) {
 
1135
        EdsfPersona * self;
 
1136
        EdsfPersonaChangeNotesData* _data_;
 
1137
        EdsfPersona* _tmp0_;
 
1138
        GeeSet* _tmp1_;
 
1139
        GeeSet* _tmp2_;
 
1140
        self = (EdsfPersona*) base;
 
1141
        _data_ = g_slice_new0 (EdsfPersonaChangeNotesData);
 
1142
        _data_->_async_result = g_simple_async_result_new (G_OBJECT (self), _callback_, _user_data_, edsf_persona_real_change_notes);
 
1143
        g_simple_async_result_set_op_res_gpointer (_data_->_async_result, _data_, edsf_persona_real_change_notes_data_free);
 
1144
        _tmp0_ = _g_object_ref0 (self);
 
1145
        _data_->self = _tmp0_;
 
1146
        _tmp1_ = notes;
 
1147
        _tmp2_ = _g_object_ref0 (_tmp1_);
 
1148
        _data_->notes = _tmp2_;
 
1149
        edsf_persona_real_change_notes_co (_data_);
 
1150
}
 
1151
 
 
1152
 
 
1153
static void edsf_persona_real_change_notes_finish (FolksNoteDetails* base, GAsyncResult* _res_, GError** error) {
 
1154
        EdsfPersonaChangeNotesData* _data_;
 
1155
        if (g_simple_async_result_propagate_error (G_SIMPLE_ASYNC_RESULT (_res_), error)) {
 
1156
                return;
 
1157
        }
 
1158
        _data_ = g_simple_async_result_get_op_res_gpointer (G_SIMPLE_ASYNC_RESULT (_res_));
 
1159
}
 
1160
 
 
1161
 
 
1162
/**
 
1163
   * {@inheritDoc}
 
1164
   *
 
1165
   * @since 0.6.2
 
1166
   */
 
1167
static void edsf_persona_change_notes_ready (GObject* source_object, GAsyncResult* _res_, gpointer _user_data_) {
 
1168
        EdsfPersonaChangeNotesData* _data_;
 
1169
        _data_ = _user_data_;
 
1170
        _data_->_source_object_ = source_object;
 
1171
        _data_->_res_ = _res_;
 
1172
        edsf_persona_real_change_notes_co (_data_);
 
1173
}
 
1174
 
 
1175
 
 
1176
static gboolean edsf_persona_real_change_notes_co (EdsfPersonaChangeNotesData* _data_) {
 
1177
        switch (_data_->_state_) {
 
1178
                case 0:
 
1179
                goto _state_0;
 
1180
                case 1:
 
1181
                goto _state_1;
 
1182
                default:
 
1183
                g_assert_not_reached ();
 
1184
        }
 
1185
        _state_0:
 
1186
        _data_->_tmp0_ = folks_persona_get_store ((FolksPersona*) _data_->self);
 
1187
        _data_->_tmp1_ = _data_->_tmp0_;
 
1188
        _data_->_tmp2_ = _data_->notes;
 
1189
        _data_->_state_ = 1;
 
1190
        _edsf_persona_store_set_notes (EDSF_PERSONA_STORE (_data_->_tmp1_), _data_->self, _data_->_tmp2_, edsf_persona_change_notes_ready, _data_);
 
1191
        return FALSE;
 
1192
        _state_1:
 
1193
        _edsf_persona_store_set_notes_finish (EDSF_PERSONA_STORE (_data_->_tmp1_), _data_->_res_, &_data_->_inner_error_);
 
1194
        if (_data_->_inner_error_ != NULL) {
 
1195
                if (_data_->_inner_error_->domain == FOLKS_PROPERTY_ERROR) {
 
1196
                        g_simple_async_result_set_from_error (_data_->_async_result, _data_->_inner_error_);
 
1197
                        g_error_free (_data_->_inner_error_);
 
1198
                        if (_data_->_state_ == 0) {
 
1199
                                g_simple_async_result_complete_in_idle (_data_->_async_result);
 
1200
                        } else {
 
1201
                                g_simple_async_result_complete (_data_->_async_result);
 
1202
                        }
 
1203
                        g_object_unref (_data_->_async_result);
 
1204
                        return FALSE;
 
1205
                } else {
 
1206
                        g_critical ("file %s: line %d: uncaught error: %s (%s, %d)", __FILE__, __LINE__, _data_->_inner_error_->message, g_quark_to_string (_data_->_inner_error_->domain), _data_->_inner_error_->code);
 
1207
                        g_clear_error (&_data_->_inner_error_);
 
1208
                        return FALSE;
 
1209
                }
 
1210
        }
 
1211
        if (_data_->_state_ == 0) {
 
1212
                g_simple_async_result_complete_in_idle (_data_->_async_result);
 
1213
        } else {
 
1214
                g_simple_async_result_complete (_data_->_async_result);
 
1215
        }
 
1216
        g_object_unref (_data_->_async_result);
 
1217
        return FALSE;
 
1218
}
 
1219
 
 
1220
 
 
1221
static void edsf_persona_real_change_avatar_data_free (gpointer _data) {
 
1222
        EdsfPersonaChangeAvatarData* _data_;
 
1223
        _data_ = _data;
 
1224
        _g_object_unref0 (_data_->avatar);
 
1225
        _g_object_unref0 (_data_->self);
 
1226
        g_slice_free (EdsfPersonaChangeAvatarData, _data_);
 
1227
}
 
1228
 
 
1229
 
 
1230
static void edsf_persona_real_change_avatar (FolksAvatarDetails* base, GLoadableIcon* avatar, GAsyncReadyCallback _callback_, gpointer _user_data_) {
 
1231
        EdsfPersona * self;
 
1232
        EdsfPersonaChangeAvatarData* _data_;
 
1233
        EdsfPersona* _tmp0_;
 
1234
        GLoadableIcon* _tmp1_;
 
1235
        GLoadableIcon* _tmp2_;
 
1236
        self = (EdsfPersona*) base;
 
1237
        _data_ = g_slice_new0 (EdsfPersonaChangeAvatarData);
 
1238
        _data_->_async_result = g_simple_async_result_new (G_OBJECT (self), _callback_, _user_data_, edsf_persona_real_change_avatar);
 
1239
        g_simple_async_result_set_op_res_gpointer (_data_->_async_result, _data_, edsf_persona_real_change_avatar_data_free);
 
1240
        _tmp0_ = _g_object_ref0 (self);
 
1241
        _data_->self = _tmp0_;
 
1242
        _tmp1_ = avatar;
 
1243
        _tmp2_ = _g_object_ref0 (_tmp1_);
 
1244
        _data_->avatar = _tmp2_;
 
1245
        edsf_persona_real_change_avatar_co (_data_);
 
1246
}
 
1247
 
 
1248
 
 
1249
static void edsf_persona_real_change_avatar_finish (FolksAvatarDetails* base, GAsyncResult* _res_, GError** error) {
 
1250
        EdsfPersonaChangeAvatarData* _data_;
 
1251
        if (g_simple_async_result_propagate_error (G_SIMPLE_ASYNC_RESULT (_res_), error)) {
 
1252
                return;
 
1253
        }
 
1254
        _data_ = g_simple_async_result_get_op_res_gpointer (G_SIMPLE_ASYNC_RESULT (_res_));
 
1255
}
 
1256
 
 
1257
 
 
1258
/**
 
1259
   * {@inheritDoc}
 
1260
   *
 
1261
   * @since 0.6.2
 
1262
   */
 
1263
static void edsf_persona_change_avatar_ready (GObject* source_object, GAsyncResult* _res_, gpointer _user_data_) {
 
1264
        EdsfPersonaChangeAvatarData* _data_;
 
1265
        _data_ = _user_data_;
 
1266
        _data_->_source_object_ = source_object;
 
1267
        _data_->_res_ = _res_;
 
1268
        edsf_persona_real_change_avatar_co (_data_);
 
1269
}
 
1270
 
 
1271
 
 
1272
static gboolean edsf_persona_real_change_avatar_co (EdsfPersonaChangeAvatarData* _data_) {
 
1273
        switch (_data_->_state_) {
 
1274
                case 0:
 
1275
                goto _state_0;
 
1276
                case 1:
 
1277
                goto _state_1;
 
1278
                default:
 
1279
                g_assert_not_reached ();
 
1280
        }
 
1281
        _state_0:
 
1282
        _data_->_tmp0_ = folks_persona_get_store ((FolksPersona*) _data_->self);
 
1283
        _data_->_tmp1_ = _data_->_tmp0_;
 
1284
        _data_->_tmp2_ = _data_->avatar;
 
1285
        _data_->_state_ = 1;
 
1286
        _edsf_persona_store_set_avatar (EDSF_PERSONA_STORE (_data_->_tmp1_), _data_->self, _data_->_tmp2_, edsf_persona_change_avatar_ready, _data_);
 
1287
        return FALSE;
 
1288
        _state_1:
 
1289
        _edsf_persona_store_set_avatar_finish (EDSF_PERSONA_STORE (_data_->_tmp1_), _data_->_res_, &_data_->_inner_error_);
 
1290
        if (_data_->_inner_error_ != NULL) {
 
1291
                if (_data_->_inner_error_->domain == FOLKS_PROPERTY_ERROR) {
 
1292
                        g_simple_async_result_set_from_error (_data_->_async_result, _data_->_inner_error_);
 
1293
                        g_error_free (_data_->_inner_error_);
 
1294
                        if (_data_->_state_ == 0) {
 
1295
                                g_simple_async_result_complete_in_idle (_data_->_async_result);
 
1296
                        } else {
 
1297
                                g_simple_async_result_complete (_data_->_async_result);
 
1298
                        }
 
1299
                        g_object_unref (_data_->_async_result);
 
1300
                        return FALSE;
 
1301
                } else {
 
1302
                        g_critical ("file %s: line %d: uncaught error: %s (%s, %d)", __FILE__, __LINE__, _data_->_inner_error_->message, g_quark_to_string (_data_->_inner_error_->domain), _data_->_inner_error_->code);
 
1303
                        g_clear_error (&_data_->_inner_error_);
 
1304
                        return FALSE;
 
1305
                }
 
1306
        }
 
1307
        if (_data_->_state_ == 0) {
 
1308
                g_simple_async_result_complete_in_idle (_data_->_async_result);
 
1309
        } else {
 
1310
                g_simple_async_result_complete (_data_->_async_result);
 
1311
        }
 
1312
        g_object_unref (_data_->_async_result);
 
1313
        return FALSE;
 
1314
}
 
1315
 
 
1316
 
 
1317
static void edsf_persona_real_change_structured_name_data_free (gpointer _data) {
 
1318
        EdsfPersonaChangeStructuredNameData* _data_;
 
1319
        _data_ = _data;
 
1320
        _g_object_unref0 (_data_->structured_name);
 
1321
        _g_object_unref0 (_data_->self);
 
1322
        g_slice_free (EdsfPersonaChangeStructuredNameData, _data_);
 
1323
}
 
1324
 
 
1325
 
 
1326
static void edsf_persona_real_change_structured_name (FolksNameDetails* base, FolksStructuredName* structured_name, GAsyncReadyCallback _callback_, gpointer _user_data_) {
 
1327
        EdsfPersona * self;
 
1328
        EdsfPersonaChangeStructuredNameData* _data_;
 
1329
        EdsfPersona* _tmp0_;
 
1330
        FolksStructuredName* _tmp1_;
 
1331
        FolksStructuredName* _tmp2_;
 
1332
        self = (EdsfPersona*) base;
 
1333
        _data_ = g_slice_new0 (EdsfPersonaChangeStructuredNameData);
 
1334
        _data_->_async_result = g_simple_async_result_new (G_OBJECT (self), _callback_, _user_data_, edsf_persona_real_change_structured_name);
 
1335
        g_simple_async_result_set_op_res_gpointer (_data_->_async_result, _data_, edsf_persona_real_change_structured_name_data_free);
 
1336
        _tmp0_ = _g_object_ref0 (self);
 
1337
        _data_->self = _tmp0_;
 
1338
        _tmp1_ = structured_name;
 
1339
        _tmp2_ = _g_object_ref0 (_tmp1_);
 
1340
        _data_->structured_name = _tmp2_;
 
1341
        edsf_persona_real_change_structured_name_co (_data_);
 
1342
}
 
1343
 
 
1344
 
 
1345
static void edsf_persona_real_change_structured_name_finish (FolksNameDetails* base, GAsyncResult* _res_, GError** error) {
 
1346
        EdsfPersonaChangeStructuredNameData* _data_;
 
1347
        if (g_simple_async_result_propagate_error (G_SIMPLE_ASYNC_RESULT (_res_), error)) {
 
1348
                return;
 
1349
        }
 
1350
        _data_ = g_simple_async_result_get_op_res_gpointer (G_SIMPLE_ASYNC_RESULT (_res_));
 
1351
}
 
1352
 
 
1353
 
 
1354
/**
 
1355
   * {@inheritDoc}
 
1356
   *
 
1357
   * @since 0.6.2
 
1358
   */
 
1359
static void edsf_persona_change_structured_name_ready (GObject* source_object, GAsyncResult* _res_, gpointer _user_data_) {
 
1360
        EdsfPersonaChangeStructuredNameData* _data_;
 
1361
        _data_ = _user_data_;
 
1362
        _data_->_source_object_ = source_object;
 
1363
        _data_->_res_ = _res_;
 
1364
        edsf_persona_real_change_structured_name_co (_data_);
 
1365
}
 
1366
 
 
1367
 
 
1368
static gboolean edsf_persona_real_change_structured_name_co (EdsfPersonaChangeStructuredNameData* _data_) {
 
1369
        switch (_data_->_state_) {
 
1370
                case 0:
 
1371
                goto _state_0;
 
1372
                case 1:
 
1373
                goto _state_1;
 
1374
                default:
 
1375
                g_assert_not_reached ();
 
1376
        }
 
1377
        _state_0:
 
1378
        _data_->_tmp0_ = folks_persona_get_store ((FolksPersona*) _data_->self);
 
1379
        _data_->_tmp1_ = _data_->_tmp0_;
 
1380
        _data_->_tmp2_ = _data_->structured_name;
 
1381
        _data_->_state_ = 1;
 
1382
        _edsf_persona_store_set_structured_name (EDSF_PERSONA_STORE (_data_->_tmp1_), _data_->self, _data_->_tmp2_, edsf_persona_change_structured_name_ready, _data_);
 
1383
        return FALSE;
 
1384
        _state_1:
 
1385
        _edsf_persona_store_set_structured_name_finish (EDSF_PERSONA_STORE (_data_->_tmp1_), _data_->_res_, &_data_->_inner_error_);
 
1386
        if (_data_->_inner_error_ != NULL) {
 
1387
                if (_data_->_inner_error_->domain == FOLKS_PROPERTY_ERROR) {
 
1388
                        g_simple_async_result_set_from_error (_data_->_async_result, _data_->_inner_error_);
 
1389
                        g_error_free (_data_->_inner_error_);
 
1390
                        if (_data_->_state_ == 0) {
 
1391
                                g_simple_async_result_complete_in_idle (_data_->_async_result);
 
1392
                        } else {
 
1393
                                g_simple_async_result_complete (_data_->_async_result);
 
1394
                        }
 
1395
                        g_object_unref (_data_->_async_result);
 
1396
                        return FALSE;
 
1397
                } else {
 
1398
                        g_critical ("file %s: line %d: uncaught error: %s (%s, %d)", __FILE__, __LINE__, _data_->_inner_error_->message, g_quark_to_string (_data_->_inner_error_->domain), _data_->_inner_error_->code);
 
1399
                        g_clear_error (&_data_->_inner_error_);
 
1400
                        return FALSE;
 
1401
                }
 
1402
        }
 
1403
        if (_data_->_state_ == 0) {
 
1404
                g_simple_async_result_complete_in_idle (_data_->_async_result);
 
1405
        } else {
 
1406
                g_simple_async_result_complete (_data_->_async_result);
 
1407
        }
 
1408
        g_object_unref (_data_->_async_result);
 
1409
        return FALSE;
 
1410
}
 
1411
 
 
1412
 
 
1413
static void edsf_persona_real_change_full_name_data_free (gpointer _data) {
 
1414
        EdsfPersonaChangeFullNameData* _data_;
 
1415
        _data_ = _data;
 
1416
        _g_free0 (_data_->full_name);
 
1417
        _g_object_unref0 (_data_->self);
 
1418
        g_slice_free (EdsfPersonaChangeFullNameData, _data_);
 
1419
}
 
1420
 
 
1421
 
 
1422
static void edsf_persona_real_change_full_name (FolksNameDetails* base, const gchar* full_name, GAsyncReadyCallback _callback_, gpointer _user_data_) {
 
1423
        EdsfPersona * self;
 
1424
        EdsfPersonaChangeFullNameData* _data_;
 
1425
        EdsfPersona* _tmp0_;
 
1426
        const gchar* _tmp1_;
 
1427
        const gchar* _tmp2_;
 
1428
        self = (EdsfPersona*) base;
 
1429
        _data_ = g_slice_new0 (EdsfPersonaChangeFullNameData);
 
1430
        _data_->_async_result = g_simple_async_result_new (G_OBJECT (self), _callback_, _user_data_, edsf_persona_real_change_full_name);
 
1431
        g_simple_async_result_set_op_res_gpointer (_data_->_async_result, _data_, edsf_persona_real_change_full_name_data_free);
 
1432
        _tmp0_ = _g_object_ref0 (self);
 
1433
        _data_->self = _tmp0_;
 
1434
        _tmp1_ = full_name;
 
1435
        _tmp2_ = g_strdup (_tmp1_);
 
1436
        _data_->full_name = _tmp2_;
 
1437
        edsf_persona_real_change_full_name_co (_data_);
 
1438
}
 
1439
 
 
1440
 
 
1441
static void edsf_persona_real_change_full_name_finish (FolksNameDetails* base, GAsyncResult* _res_, GError** error) {
 
1442
        EdsfPersonaChangeFullNameData* _data_;
 
1443
        if (g_simple_async_result_propagate_error (G_SIMPLE_ASYNC_RESULT (_res_), error)) {
 
1444
                return;
 
1445
        }
 
1446
        _data_ = g_simple_async_result_get_op_res_gpointer (G_SIMPLE_ASYNC_RESULT (_res_));
 
1447
}
 
1448
 
 
1449
 
 
1450
/**
 
1451
   * {@inheritDoc}
 
1452
   *
 
1453
   * @since 0.6.2
 
1454
   */
 
1455
static void edsf_persona_change_full_name_ready (GObject* source_object, GAsyncResult* _res_, gpointer _user_data_) {
 
1456
        EdsfPersonaChangeFullNameData* _data_;
 
1457
        _data_ = _user_data_;
 
1458
        _data_->_source_object_ = source_object;
 
1459
        _data_->_res_ = _res_;
 
1460
        edsf_persona_real_change_full_name_co (_data_);
 
1461
}
 
1462
 
 
1463
 
 
1464
static gboolean edsf_persona_real_change_full_name_co (EdsfPersonaChangeFullNameData* _data_) {
 
1465
        switch (_data_->_state_) {
 
1466
                case 0:
 
1467
                goto _state_0;
 
1468
                case 1:
 
1469
                goto _state_1;
 
1470
                default:
 
1471
                g_assert_not_reached ();
 
1472
        }
 
1473
        _state_0:
 
1474
        _data_->_tmp0_ = folks_persona_get_store ((FolksPersona*) _data_->self);
 
1475
        _data_->_tmp1_ = _data_->_tmp0_;
 
1476
        _data_->_tmp2_ = _data_->full_name;
 
1477
        _data_->_state_ = 1;
 
1478
        _edsf_persona_store_set_full_name (EDSF_PERSONA_STORE (_data_->_tmp1_), _data_->self, _data_->_tmp2_, edsf_persona_change_full_name_ready, _data_);
 
1479
        return FALSE;
 
1480
        _state_1:
 
1481
        _edsf_persona_store_set_full_name_finish (EDSF_PERSONA_STORE (_data_->_tmp1_), _data_->_res_, &_data_->_inner_error_);
 
1482
        if (_data_->_inner_error_ != NULL) {
 
1483
                if (_data_->_inner_error_->domain == FOLKS_PROPERTY_ERROR) {
 
1484
                        g_simple_async_result_set_from_error (_data_->_async_result, _data_->_inner_error_);
 
1485
                        g_error_free (_data_->_inner_error_);
 
1486
                        if (_data_->_state_ == 0) {
 
1487
                                g_simple_async_result_complete_in_idle (_data_->_async_result);
 
1488
                        } else {
 
1489
                                g_simple_async_result_complete (_data_->_async_result);
 
1490
                        }
 
1491
                        g_object_unref (_data_->_async_result);
 
1492
                        return FALSE;
 
1493
                } else {
 
1494
                        g_critical ("file %s: line %d: uncaught error: %s (%s, %d)", __FILE__, __LINE__, _data_->_inner_error_->message, g_quark_to_string (_data_->_inner_error_->domain), _data_->_inner_error_->code);
 
1495
                        g_clear_error (&_data_->_inner_error_);
 
1496
                        return FALSE;
 
1497
                }
 
1498
        }
 
1499
        if (_data_->_state_ == 0) {
 
1500
                g_simple_async_result_complete_in_idle (_data_->_async_result);
 
1501
        } else {
 
1502
                g_simple_async_result_complete (_data_->_async_result);
 
1503
        }
 
1504
        g_object_unref (_data_->_async_result);
 
1505
        return FALSE;
 
1506
}
 
1507
 
 
1508
 
 
1509
static void edsf_persona_real_change_nickname_data_free (gpointer _data) {
 
1510
        EdsfPersonaChangeNicknameData* _data_;
 
1511
        _data_ = _data;
 
1512
        _g_free0 (_data_->nickname);
 
1513
        _g_object_unref0 (_data_->self);
 
1514
        g_slice_free (EdsfPersonaChangeNicknameData, _data_);
 
1515
}
 
1516
 
 
1517
 
 
1518
static void edsf_persona_real_change_nickname (FolksNameDetails* base, const gchar* nickname, GAsyncReadyCallback _callback_, gpointer _user_data_) {
 
1519
        EdsfPersona * self;
 
1520
        EdsfPersonaChangeNicknameData* _data_;
 
1521
        EdsfPersona* _tmp0_;
 
1522
        const gchar* _tmp1_;
 
1523
        const gchar* _tmp2_;
 
1524
        self = (EdsfPersona*) base;
 
1525
        _data_ = g_slice_new0 (EdsfPersonaChangeNicknameData);
 
1526
        _data_->_async_result = g_simple_async_result_new (G_OBJECT (self), _callback_, _user_data_, edsf_persona_real_change_nickname);
 
1527
        g_simple_async_result_set_op_res_gpointer (_data_->_async_result, _data_, edsf_persona_real_change_nickname_data_free);
 
1528
        _tmp0_ = _g_object_ref0 (self);
 
1529
        _data_->self = _tmp0_;
 
1530
        _tmp1_ = nickname;
 
1531
        _tmp2_ = g_strdup (_tmp1_);
 
1532
        _data_->nickname = _tmp2_;
 
1533
        edsf_persona_real_change_nickname_co (_data_);
 
1534
}
 
1535
 
 
1536
 
 
1537
static void edsf_persona_real_change_nickname_finish (FolksNameDetails* base, GAsyncResult* _res_, GError** error) {
 
1538
        EdsfPersonaChangeNicknameData* _data_;
 
1539
        if (g_simple_async_result_propagate_error (G_SIMPLE_ASYNC_RESULT (_res_), error)) {
 
1540
                return;
 
1541
        }
 
1542
        _data_ = g_simple_async_result_get_op_res_gpointer (G_SIMPLE_ASYNC_RESULT (_res_));
 
1543
}
 
1544
 
 
1545
 
 
1546
/**
 
1547
   * {@inheritDoc}
 
1548
   *
 
1549
   * @since 0.6.2
 
1550
   */
 
1551
static void edsf_persona_change_nickname_ready (GObject* source_object, GAsyncResult* _res_, gpointer _user_data_) {
 
1552
        EdsfPersonaChangeNicknameData* _data_;
 
1553
        _data_ = _user_data_;
 
1554
        _data_->_source_object_ = source_object;
 
1555
        _data_->_res_ = _res_;
 
1556
        edsf_persona_real_change_nickname_co (_data_);
 
1557
}
 
1558
 
 
1559
 
 
1560
static gboolean edsf_persona_real_change_nickname_co (EdsfPersonaChangeNicknameData* _data_) {
 
1561
        switch (_data_->_state_) {
 
1562
                case 0:
 
1563
                goto _state_0;
 
1564
                case 1:
 
1565
                goto _state_1;
 
1566
                default:
 
1567
                g_assert_not_reached ();
 
1568
        }
 
1569
        _state_0:
 
1570
        _data_->_tmp0_ = folks_persona_get_store ((FolksPersona*) _data_->self);
 
1571
        _data_->_tmp1_ = _data_->_tmp0_;
 
1572
        _data_->_tmp2_ = _data_->nickname;
 
1573
        _data_->_state_ = 1;
 
1574
        _edsf_persona_store_set_nickname (EDSF_PERSONA_STORE (_data_->_tmp1_), _data_->self, _data_->_tmp2_, edsf_persona_change_nickname_ready, _data_);
 
1575
        return FALSE;
 
1576
        _state_1:
 
1577
        _edsf_persona_store_set_nickname_finish (EDSF_PERSONA_STORE (_data_->_tmp1_), _data_->_res_, &_data_->_inner_error_);
 
1578
        if (_data_->_inner_error_ != NULL) {
 
1579
                if (_data_->_inner_error_->domain == FOLKS_PROPERTY_ERROR) {
 
1580
                        g_simple_async_result_set_from_error (_data_->_async_result, _data_->_inner_error_);
 
1581
                        g_error_free (_data_->_inner_error_);
 
1582
                        if (_data_->_state_ == 0) {
 
1583
                                g_simple_async_result_complete_in_idle (_data_->_async_result);
 
1584
                        } else {
 
1585
                                g_simple_async_result_complete (_data_->_async_result);
 
1586
                        }
 
1587
                        g_object_unref (_data_->_async_result);
 
1588
                        return FALSE;
 
1589
                } else {
 
1590
                        g_critical ("file %s: line %d: uncaught error: %s (%s, %d)", __FILE__, __LINE__, _data_->_inner_error_->message, g_quark_to_string (_data_->_inner_error_->domain), _data_->_inner_error_->code);
 
1591
                        g_clear_error (&_data_->_inner_error_);
 
1592
                        return FALSE;
 
1593
                }
 
1594
        }
 
1595
        if (_data_->_state_ == 0) {
 
1596
                g_simple_async_result_complete_in_idle (_data_->_async_result);
 
1597
        } else {
 
1598
                g_simple_async_result_complete (_data_->_async_result);
 
1599
        }
 
1600
        g_object_unref (_data_->_async_result);
 
1601
        return FALSE;
 
1602
}
 
1603
 
 
1604
 
 
1605
static void edsf_persona_real_change_gender_data_free (gpointer _data) {
 
1606
        EdsfPersonaChangeGenderData* _data_;
 
1607
        _data_ = _data;
 
1608
        _g_object_unref0 (_data_->self);
 
1609
        g_slice_free (EdsfPersonaChangeGenderData, _data_);
 
1610
}
 
1611
 
 
1612
 
 
1613
static void edsf_persona_real_change_gender (FolksGenderDetails* base, FolksGender gender, GAsyncReadyCallback _callback_, gpointer _user_data_) {
 
1614
        EdsfPersona * self;
 
1615
        EdsfPersonaChangeGenderData* _data_;
 
1616
        EdsfPersona* _tmp0_;
 
1617
        FolksGender _tmp1_;
 
1618
        self = (EdsfPersona*) base;
 
1619
        _data_ = g_slice_new0 (EdsfPersonaChangeGenderData);
 
1620
        _data_->_async_result = g_simple_async_result_new (G_OBJECT (self), _callback_, _user_data_, edsf_persona_real_change_gender);
 
1621
        g_simple_async_result_set_op_res_gpointer (_data_->_async_result, _data_, edsf_persona_real_change_gender_data_free);
 
1622
        _tmp0_ = _g_object_ref0 (self);
 
1623
        _data_->self = _tmp0_;
 
1624
        _tmp1_ = gender;
 
1625
        _data_->gender = _tmp1_;
 
1626
        edsf_persona_real_change_gender_co (_data_);
 
1627
}
 
1628
 
 
1629
 
 
1630
static void edsf_persona_real_change_gender_finish (FolksGenderDetails* base, GAsyncResult* _res_, GError** error) {
 
1631
        EdsfPersonaChangeGenderData* _data_;
 
1632
        if (g_simple_async_result_propagate_error (G_SIMPLE_ASYNC_RESULT (_res_), error)) {
 
1633
                return;
 
1634
        }
 
1635
        _data_ = g_simple_async_result_get_op_res_gpointer (G_SIMPLE_ASYNC_RESULT (_res_));
 
1636
}
 
1637
 
 
1638
 
 
1639
/**
 
1640
   * {@inheritDoc}
 
1641
   *
 
1642
   * @since 0.6.2
 
1643
   */
 
1644
static void edsf_persona_change_gender_ready (GObject* source_object, GAsyncResult* _res_, gpointer _user_data_) {
 
1645
        EdsfPersonaChangeGenderData* _data_;
 
1646
        _data_ = _user_data_;
 
1647
        _data_->_source_object_ = source_object;
 
1648
        _data_->_res_ = _res_;
 
1649
        edsf_persona_real_change_gender_co (_data_);
 
1650
}
 
1651
 
 
1652
 
 
1653
static gboolean edsf_persona_real_change_gender_co (EdsfPersonaChangeGenderData* _data_) {
 
1654
        switch (_data_->_state_) {
 
1655
                case 0:
 
1656
                goto _state_0;
 
1657
                case 1:
 
1658
                goto _state_1;
 
1659
                default:
 
1660
                g_assert_not_reached ();
 
1661
        }
 
1662
        _state_0:
 
1663
        _data_->_tmp0_ = folks_persona_get_store ((FolksPersona*) _data_->self);
 
1664
        _data_->_tmp1_ = _data_->_tmp0_;
 
1665
        _data_->_tmp2_ = _data_->gender;
 
1666
        _data_->_state_ = 1;
 
1667
        _edsf_persona_store_set_gender (EDSF_PERSONA_STORE (_data_->_tmp1_), _data_->self, _data_->_tmp2_, edsf_persona_change_gender_ready, _data_);
 
1668
        return FALSE;
 
1669
        _state_1:
 
1670
        _edsf_persona_store_set_gender_finish (EDSF_PERSONA_STORE (_data_->_tmp1_), _data_->_res_, &_data_->_inner_error_);
 
1671
        if (_data_->_inner_error_ != NULL) {
 
1672
                if (_data_->_inner_error_->domain == FOLKS_PROPERTY_ERROR) {
 
1673
                        g_simple_async_result_set_from_error (_data_->_async_result, _data_->_inner_error_);
 
1674
                        g_error_free (_data_->_inner_error_);
 
1675
                        if (_data_->_state_ == 0) {
 
1676
                                g_simple_async_result_complete_in_idle (_data_->_async_result);
 
1677
                        } else {
 
1678
                                g_simple_async_result_complete (_data_->_async_result);
 
1679
                        }
 
1680
                        g_object_unref (_data_->_async_result);
 
1681
                        return FALSE;
 
1682
                } else {
 
1683
                        g_critical ("file %s: line %d: uncaught error: %s (%s, %d)", __FILE__, __LINE__, _data_->_inner_error_->message, g_quark_to_string (_data_->_inner_error_->domain), _data_->_inner_error_->code);
 
1684
                        g_clear_error (&_data_->_inner_error_);
 
1685
                        return FALSE;
 
1686
                }
 
1687
        }
 
1688
        if (_data_->_state_ == 0) {
 
1689
                g_simple_async_result_complete_in_idle (_data_->_async_result);
 
1690
        } else {
 
1691
                g_simple_async_result_complete (_data_->_async_result);
 
1692
        }
 
1693
        g_object_unref (_data_->_async_result);
 
1694
        return FALSE;
 
1695
}
 
1696
 
 
1697
 
 
1698
static void edsf_persona_real_change_urls_data_free (gpointer _data) {
 
1699
        EdsfPersonaChangeUrlsData* _data_;
 
1700
        _data_ = _data;
 
1701
        _g_object_unref0 (_data_->urls);
 
1702
        _g_object_unref0 (_data_->self);
 
1703
        g_slice_free (EdsfPersonaChangeUrlsData, _data_);
 
1704
}
 
1705
 
 
1706
 
 
1707
static void edsf_persona_real_change_urls (FolksUrlDetails* base, GeeSet* urls, GAsyncReadyCallback _callback_, gpointer _user_data_) {
 
1708
        EdsfPersona * self;
 
1709
        EdsfPersonaChangeUrlsData* _data_;
 
1710
        EdsfPersona* _tmp0_;
 
1711
        GeeSet* _tmp1_;
 
1712
        GeeSet* _tmp2_;
 
1713
        self = (EdsfPersona*) base;
 
1714
        _data_ = g_slice_new0 (EdsfPersonaChangeUrlsData);
 
1715
        _data_->_async_result = g_simple_async_result_new (G_OBJECT (self), _callback_, _user_data_, edsf_persona_real_change_urls);
 
1716
        g_simple_async_result_set_op_res_gpointer (_data_->_async_result, _data_, edsf_persona_real_change_urls_data_free);
 
1717
        _tmp0_ = _g_object_ref0 (self);
 
1718
        _data_->self = _tmp0_;
 
1719
        _tmp1_ = urls;
 
1720
        _tmp2_ = _g_object_ref0 (_tmp1_);
 
1721
        _data_->urls = _tmp2_;
 
1722
        edsf_persona_real_change_urls_co (_data_);
 
1723
}
 
1724
 
 
1725
 
 
1726
static void edsf_persona_real_change_urls_finish (FolksUrlDetails* base, GAsyncResult* _res_, GError** error) {
 
1727
        EdsfPersonaChangeUrlsData* _data_;
 
1728
        if (g_simple_async_result_propagate_error (G_SIMPLE_ASYNC_RESULT (_res_), error)) {
 
1729
                return;
 
1730
        }
 
1731
        _data_ = g_simple_async_result_get_op_res_gpointer (G_SIMPLE_ASYNC_RESULT (_res_));
 
1732
}
 
1733
 
 
1734
 
 
1735
/**
 
1736
   * {@inheritDoc}
 
1737
   *
 
1738
   * @since 0.6.2
 
1739
   */
 
1740
static void edsf_persona_change_urls_ready (GObject* source_object, GAsyncResult* _res_, gpointer _user_data_) {
 
1741
        EdsfPersonaChangeUrlsData* _data_;
 
1742
        _data_ = _user_data_;
 
1743
        _data_->_source_object_ = source_object;
 
1744
        _data_->_res_ = _res_;
 
1745
        edsf_persona_real_change_urls_co (_data_);
 
1746
}
 
1747
 
 
1748
 
 
1749
static gboolean edsf_persona_real_change_urls_co (EdsfPersonaChangeUrlsData* _data_) {
 
1750
        switch (_data_->_state_) {
 
1751
                case 0:
 
1752
                goto _state_0;
 
1753
                case 1:
 
1754
                goto _state_1;
 
1755
                default:
 
1756
                g_assert_not_reached ();
 
1757
        }
 
1758
        _state_0:
 
1759
        _data_->_tmp0_ = folks_persona_get_store ((FolksPersona*) _data_->self);
 
1760
        _data_->_tmp1_ = _data_->_tmp0_;
 
1761
        _data_->_tmp2_ = _data_->urls;
 
1762
        _data_->_state_ = 1;
 
1763
        _edsf_persona_store_set_urls (EDSF_PERSONA_STORE (_data_->_tmp1_), _data_->self, _data_->_tmp2_, edsf_persona_change_urls_ready, _data_);
 
1764
        return FALSE;
 
1765
        _state_1:
 
1766
        _edsf_persona_store_set_urls_finish (EDSF_PERSONA_STORE (_data_->_tmp1_), _data_->_res_, &_data_->_inner_error_);
 
1767
        if (_data_->_inner_error_ != NULL) {
 
1768
                if (_data_->_inner_error_->domain == FOLKS_PROPERTY_ERROR) {
 
1769
                        g_simple_async_result_set_from_error (_data_->_async_result, _data_->_inner_error_);
 
1770
                        g_error_free (_data_->_inner_error_);
 
1771
                        if (_data_->_state_ == 0) {
 
1772
                                g_simple_async_result_complete_in_idle (_data_->_async_result);
 
1773
                        } else {
 
1774
                                g_simple_async_result_complete (_data_->_async_result);
 
1775
                        }
 
1776
                        g_object_unref (_data_->_async_result);
 
1777
                        return FALSE;
 
1778
                } else {
 
1779
                        g_critical ("file %s: line %d: uncaught error: %s (%s, %d)", __FILE__, __LINE__, _data_->_inner_error_->message, g_quark_to_string (_data_->_inner_error_->domain), _data_->_inner_error_->code);
 
1780
                        g_clear_error (&_data_->_inner_error_);
 
1781
                        return FALSE;
 
1782
                }
 
1783
        }
 
1784
        if (_data_->_state_ == 0) {
 
1785
                g_simple_async_result_complete_in_idle (_data_->_async_result);
 
1786
        } else {
 
1787
                g_simple_async_result_complete (_data_->_async_result);
 
1788
        }
 
1789
        g_object_unref (_data_->_async_result);
 
1790
        return FALSE;
 
1791
}
 
1792
 
 
1793
 
 
1794
static void edsf_persona_real_change_im_addresses_data_free (gpointer _data) {
 
1795
        EdsfPersonaChangeImAddressesData* _data_;
 
1796
        _data_ = _data;
 
1797
        _g_object_unref0 (_data_->im_addresses);
 
1798
        _g_object_unref0 (_data_->self);
 
1799
        g_slice_free (EdsfPersonaChangeImAddressesData, _data_);
 
1800
}
 
1801
 
 
1802
 
 
1803
static void edsf_persona_real_change_im_addresses (FolksImDetails* base, GeeMultiMap* im_addresses, GAsyncReadyCallback _callback_, gpointer _user_data_) {
 
1804
        EdsfPersona * self;
 
1805
        EdsfPersonaChangeImAddressesData* _data_;
 
1806
        EdsfPersona* _tmp0_;
 
1807
        GeeMultiMap* _tmp1_;
 
1808
        GeeMultiMap* _tmp2_;
 
1809
        self = (EdsfPersona*) base;
 
1810
        _data_ = g_slice_new0 (EdsfPersonaChangeImAddressesData);
 
1811
        _data_->_async_result = g_simple_async_result_new (G_OBJECT (self), _callback_, _user_data_, edsf_persona_real_change_im_addresses);
 
1812
        g_simple_async_result_set_op_res_gpointer (_data_->_async_result, _data_, edsf_persona_real_change_im_addresses_data_free);
 
1813
        _tmp0_ = _g_object_ref0 (self);
 
1814
        _data_->self = _tmp0_;
 
1815
        _tmp1_ = im_addresses;
 
1816
        _tmp2_ = _g_object_ref0 (_tmp1_);
 
1817
        _data_->im_addresses = _tmp2_;
 
1818
        edsf_persona_real_change_im_addresses_co (_data_);
 
1819
}
 
1820
 
 
1821
 
 
1822
static void edsf_persona_real_change_im_addresses_finish (FolksImDetails* base, GAsyncResult* _res_, GError** error) {
 
1823
        EdsfPersonaChangeImAddressesData* _data_;
 
1824
        if (g_simple_async_result_propagate_error (G_SIMPLE_ASYNC_RESULT (_res_), error)) {
 
1825
                return;
 
1826
        }
 
1827
        _data_ = g_simple_async_result_get_op_res_gpointer (G_SIMPLE_ASYNC_RESULT (_res_));
 
1828
}
 
1829
 
 
1830
 
 
1831
/**
 
1832
   * {@inheritDoc}
 
1833
   *
 
1834
   * @since 0.6.2
 
1835
   */
 
1836
static void edsf_persona_change_im_addresses_ready (GObject* source_object, GAsyncResult* _res_, gpointer _user_data_) {
 
1837
        EdsfPersonaChangeImAddressesData* _data_;
 
1838
        _data_ = _user_data_;
 
1839
        _data_->_source_object_ = source_object;
 
1840
        _data_->_res_ = _res_;
 
1841
        edsf_persona_real_change_im_addresses_co (_data_);
 
1842
}
 
1843
 
 
1844
 
 
1845
static gboolean edsf_persona_real_change_im_addresses_co (EdsfPersonaChangeImAddressesData* _data_) {
 
1846
        switch (_data_->_state_) {
 
1847
                case 0:
 
1848
                goto _state_0;
 
1849
                case 1:
 
1850
                goto _state_1;
 
1851
                default:
 
1852
                g_assert_not_reached ();
 
1853
        }
 
1854
        _state_0:
 
1855
        _data_->_tmp0_ = folks_persona_get_store ((FolksPersona*) _data_->self);
 
1856
        _data_->_tmp1_ = _data_->_tmp0_;
 
1857
        _data_->_tmp2_ = _data_->im_addresses;
 
1858
        _data_->_state_ = 1;
 
1859
        _edsf_persona_store_set_im_fds (EDSF_PERSONA_STORE (_data_->_tmp1_), _data_->self, _data_->_tmp2_, edsf_persona_change_im_addresses_ready, _data_);
 
1860
        return FALSE;
 
1861
        _state_1:
 
1862
        _edsf_persona_store_set_im_fds_finish (EDSF_PERSONA_STORE (_data_->_tmp1_), _data_->_res_, &_data_->_inner_error_);
 
1863
        if (_data_->_inner_error_ != NULL) {
 
1864
                if (_data_->_inner_error_->domain == FOLKS_PROPERTY_ERROR) {
 
1865
                        g_simple_async_result_set_from_error (_data_->_async_result, _data_->_inner_error_);
 
1866
                        g_error_free (_data_->_inner_error_);
 
1867
                        if (_data_->_state_ == 0) {
 
1868
                                g_simple_async_result_complete_in_idle (_data_->_async_result);
 
1869
                        } else {
 
1870
                                g_simple_async_result_complete (_data_->_async_result);
 
1871
                        }
 
1872
                        g_object_unref (_data_->_async_result);
 
1873
                        return FALSE;
 
1874
                } else {
 
1875
                        g_critical ("file %s: line %d: uncaught error: %s (%s, %d)", __FILE__, __LINE__, _data_->_inner_error_->message, g_quark_to_string (_data_->_inner_error_->domain), _data_->_inner_error_->code);
 
1876
                        g_clear_error (&_data_->_inner_error_);
 
1877
                        return FALSE;
 
1878
                }
 
1879
        }
 
1880
        if (_data_->_state_ == 0) {
 
1881
                g_simple_async_result_complete_in_idle (_data_->_async_result);
 
1882
        } else {
 
1883
                g_simple_async_result_complete (_data_->_async_result);
 
1884
        }
 
1885
        g_object_unref (_data_->_async_result);
 
1886
        return FALSE;
 
1887
}
 
1888
 
 
1889
 
 
1890
static void edsf_persona_real_change_group_data_free (gpointer _data) {
 
1891
        EdsfPersonaChangeGroupData* _data_;
 
1892
        _data_ = _data;
 
1893
        _g_free0 (_data_->group);
 
1894
        _g_object_unref0 (_data_->self);
 
1895
        g_slice_free (EdsfPersonaChangeGroupData, _data_);
 
1896
}
 
1897
 
 
1898
 
 
1899
static void edsf_persona_real_change_group (FolksGroupDetails* base, const gchar* group, gboolean is_member, GAsyncReadyCallback _callback_, gpointer _user_data_) {
 
1900
        EdsfPersona * self;
 
1901
        EdsfPersonaChangeGroupData* _data_;
 
1902
        EdsfPersona* _tmp0_;
 
1903
        const gchar* _tmp1_;
 
1904
        const gchar* _tmp2_;
 
1905
        gboolean _tmp3_;
 
1906
        self = (EdsfPersona*) base;
 
1907
        _data_ = g_slice_new0 (EdsfPersonaChangeGroupData);
 
1908
        _data_->_async_result = g_simple_async_result_new (G_OBJECT (self), _callback_, _user_data_, edsf_persona_real_change_group);
 
1909
        g_simple_async_result_set_op_res_gpointer (_data_->_async_result, _data_, edsf_persona_real_change_group_data_free);
 
1910
        _tmp0_ = _g_object_ref0 (self);
 
1911
        _data_->self = _tmp0_;
 
1912
        _tmp1_ = group;
 
1913
        _tmp2_ = g_strdup (_tmp1_);
 
1914
        _data_->group = _tmp2_;
 
1915
        _tmp3_ = is_member;
 
1916
        _data_->is_member = _tmp3_;
 
1917
        edsf_persona_real_change_group_co (_data_);
 
1918
}
 
1919
 
 
1920
 
 
1921
static void edsf_persona_real_change_group_finish (FolksGroupDetails* base, GAsyncResult* _res_, GError** error) {
 
1922
        EdsfPersonaChangeGroupData* _data_;
 
1923
        if (g_simple_async_result_propagate_error (G_SIMPLE_ASYNC_RESULT (_res_), error)) {
 
1924
                return;
 
1925
        }
 
1926
        _data_ = g_simple_async_result_get_op_res_gpointer (G_SIMPLE_ASYNC_RESULT (_res_));
 
1927
}
 
1928
 
 
1929
 
 
1930
/**
 
1931
   * {@inheritDoc}
 
1932
   *
 
1933
   * @since 0.6.0
 
1934
   */
 
1935
static void edsf_persona_change_group_ready (GObject* source_object, GAsyncResult* _res_, gpointer _user_data_) {
 
1936
        EdsfPersonaChangeGroupData* _data_;
 
1937
        _data_ = _user_data_;
 
1938
        _data_->_source_object_ = source_object;
 
1939
        _data_->_res_ = _res_;
 
1940
        edsf_persona_real_change_group_co (_data_);
 
1941
}
 
1942
 
 
1943
 
 
1944
static gboolean edsf_persona_real_change_group_co (EdsfPersonaChangeGroupData* _data_) {
 
1945
        switch (_data_->_state_) {
 
1946
                case 0:
 
1947
                goto _state_0;
 
1948
                case 1:
 
1949
                goto _state_1;
 
1950
                default:
 
1951
                g_assert_not_reached ();
 
1952
        }
 
1953
        _state_0:
 
1954
        _data_->_tmp2_ = _data_->is_member;
 
1955
        if (_data_->_tmp2_ == TRUE) {
 
1956
                _data_->_tmp3_ = _data_->self->priv->_groups;
 
1957
                _data_->_tmp4_ = _data_->group;
 
1958
                _data_->_tmp5_ = FALSE;
 
1959
                _data_->_tmp5_ = gee_abstract_collection_contains ((GeeAbstractCollection*) _data_->_tmp3_, _data_->_tmp4_);
 
1960
                _data_->_tmp1_ = _data_->_tmp5_ == TRUE;
 
1961
        } else {
 
1962
                _data_->_tmp1_ = FALSE;
 
1963
        }
 
1964
        _data_->_tmp6_ = _data_->_tmp1_;
 
1965
        if (_data_->_tmp6_) {
 
1966
                _data_->_tmp0_ = TRUE;
 
1967
        } else {
 
1968
                _data_->_tmp8_ = _data_->is_member;
 
1969
                if (_data_->_tmp8_ == FALSE) {
 
1970
                        _data_->_tmp9_ = _data_->self->priv->_groups;
 
1971
                        _data_->_tmp10_ = _data_->group;
 
1972
                        _data_->_tmp11_ = FALSE;
 
1973
                        _data_->_tmp11_ = gee_abstract_collection_contains ((GeeAbstractCollection*) _data_->_tmp9_, _data_->_tmp10_);
 
1974
                        _data_->_tmp7_ = _data_->_tmp11_ == FALSE;
 
1975
                } else {
 
1976
                        _data_->_tmp7_ = FALSE;
 
1977
                }
 
1978
                _data_->_tmp12_ = _data_->_tmp7_;
 
1979
                _data_->_tmp0_ = _data_->_tmp12_;
 
1980
        }
 
1981
        _data_->_tmp13_ = _data_->_tmp0_;
 
1982
        if (_data_->_tmp13_) {
 
1983
                if (_data_->_state_ == 0) {
 
1984
                        g_simple_async_result_complete_in_idle (_data_->_async_result);
 
1985
                } else {
 
1986
                        g_simple_async_result_complete (_data_->_async_result);
 
1987
                }
 
1988
                g_object_unref (_data_->_async_result);
 
1989
                return FALSE;
 
1990
        }
 
1991
        _data_->_tmp14_ = gee_hash_set_new (G_TYPE_STRING, (GBoxedCopyFunc) g_strdup, g_free, NULL, NULL);
 
1992
        _data_->new_groups = _data_->_tmp14_;
 
1993
        {
 
1994
                _data_->_tmp15_ = _data_->self->priv->_groups;
 
1995
                _data_->_tmp16_ = NULL;
 
1996
                _data_->_tmp16_ = gee_abstract_collection_iterator ((GeeAbstractCollection*) _data_->_tmp15_);
 
1997
                _data_->_category_name_it = _data_->_tmp16_;
 
1998
                while (TRUE) {
 
1999
                        _data_->_tmp17_ = _data_->_category_name_it;
 
2000
                        _data_->_tmp18_ = FALSE;
 
2001
                        _data_->_tmp18_ = gee_iterator_next (_data_->_tmp17_);
 
2002
                        if (!_data_->_tmp18_) {
 
2003
                                break;
 
2004
                        }
 
2005
                        _data_->_tmp19_ = _data_->_category_name_it;
 
2006
                        _data_->_tmp20_ = NULL;
 
2007
                        _data_->_tmp20_ = gee_iterator_get (_data_->_tmp19_);
 
2008
                        _data_->category_name = (gchar*) _data_->_tmp20_;
 
2009
                        _data_->_tmp21_ = _data_->new_groups;
 
2010
                        _data_->_tmp22_ = _data_->category_name;
 
2011
                        gee_abstract_collection_add ((GeeAbstractCollection*) _data_->_tmp21_, _data_->_tmp22_);
 
2012
                        _g_free0 (_data_->category_name);
 
2013
                }
 
2014
                _g_object_unref0 (_data_->_category_name_it);
 
2015
        }
 
2016
        _data_->_tmp23_ = _data_->is_member;
 
2017
        if (_data_->_tmp23_ == FALSE) {
 
2018
                _data_->_tmp24_ = _data_->new_groups;
 
2019
                _data_->_tmp25_ = _data_->group;
 
2020
                gee_abstract_collection_remove ((GeeAbstractCollection*) _data_->_tmp24_, _data_->_tmp25_);
 
2021
        } else {
 
2022
                _data_->_tmp26_ = _data_->new_groups;
 
2023
                _data_->_tmp27_ = _data_->group;
 
2024
                gee_abstract_collection_add ((GeeAbstractCollection*) _data_->_tmp26_, _data_->_tmp27_);
 
2025
        }
 
2026
        _data_->_tmp28_ = _data_->new_groups;
 
2027
        _data_->_state_ = 1;
 
2028
        folks_group_details_change_groups ((FolksGroupDetails*) _data_->self, (GeeSet*) _data_->_tmp28_, edsf_persona_change_group_ready, _data_);
 
2029
        return FALSE;
 
2030
        _state_1:
 
2031
        folks_group_details_change_groups_finish ((FolksGroupDetails*) _data_->self, _data_->_res_, &_data_->_inner_error_);
 
2032
        if (_data_->_inner_error_ != NULL) {
 
2033
                g_simple_async_result_set_from_error (_data_->_async_result, _data_->_inner_error_);
 
2034
                g_error_free (_data_->_inner_error_);
 
2035
                _g_object_unref0 (_data_->new_groups);
 
2036
                if (_data_->_state_ == 0) {
 
2037
                        g_simple_async_result_complete_in_idle (_data_->_async_result);
 
2038
                } else {
 
2039
                        g_simple_async_result_complete (_data_->_async_result);
 
2040
                }
 
2041
                g_object_unref (_data_->_async_result);
 
2042
                return FALSE;
 
2043
        }
 
2044
        _g_object_unref0 (_data_->new_groups);
 
2045
        if (_data_->_state_ == 0) {
 
2046
                g_simple_async_result_complete_in_idle (_data_->_async_result);
 
2047
        } else {
 
2048
                g_simple_async_result_complete (_data_->_async_result);
 
2049
        }
 
2050
        g_object_unref (_data_->_async_result);
 
2051
        return FALSE;
 
2052
}
 
2053
 
 
2054
 
 
2055
static void edsf_persona_real_change_groups_data_free (gpointer _data) {
 
2056
        EdsfPersonaChangeGroupsData* _data_;
 
2057
        _data_ = _data;
 
2058
        _g_object_unref0 (_data_->groups);
 
2059
        _g_object_unref0 (_data_->self);
 
2060
        g_slice_free (EdsfPersonaChangeGroupsData, _data_);
 
2061
}
 
2062
 
 
2063
 
 
2064
static void edsf_persona_real_change_groups (FolksGroupDetails* base, GeeSet* groups, GAsyncReadyCallback _callback_, gpointer _user_data_) {
 
2065
        EdsfPersona * self;
 
2066
        EdsfPersonaChangeGroupsData* _data_;
 
2067
        EdsfPersona* _tmp0_;
 
2068
        GeeSet* _tmp1_;
 
2069
        GeeSet* _tmp2_;
 
2070
        self = (EdsfPersona*) base;
 
2071
        _data_ = g_slice_new0 (EdsfPersonaChangeGroupsData);
 
2072
        _data_->_async_result = g_simple_async_result_new (G_OBJECT (self), _callback_, _user_data_, edsf_persona_real_change_groups);
 
2073
        g_simple_async_result_set_op_res_gpointer (_data_->_async_result, _data_, edsf_persona_real_change_groups_data_free);
 
2074
        _tmp0_ = _g_object_ref0 (self);
 
2075
        _data_->self = _tmp0_;
 
2076
        _tmp1_ = groups;
 
2077
        _tmp2_ = _g_object_ref0 (_tmp1_);
 
2078
        _data_->groups = _tmp2_;
 
2079
        edsf_persona_real_change_groups_co (_data_);
 
2080
}
 
2081
 
 
2082
 
 
2083
static void edsf_persona_real_change_groups_finish (FolksGroupDetails* base, GAsyncResult* _res_, GError** error) {
 
2084
        EdsfPersonaChangeGroupsData* _data_;
 
2085
        if (g_simple_async_result_propagate_error (G_SIMPLE_ASYNC_RESULT (_res_), error)) {
 
2086
                return;
 
2087
        }
 
2088
        _data_ = g_simple_async_result_get_op_res_gpointer (G_SIMPLE_ASYNC_RESULT (_res_));
 
2089
}
 
2090
 
 
2091
 
 
2092
/**
 
2093
   * {@inheritDoc}
 
2094
   *
 
2095
   * @since 0.6.2
 
2096
   */
 
2097
static void edsf_persona_change_groups_ready (GObject* source_object, GAsyncResult* _res_, gpointer _user_data_) {
 
2098
        EdsfPersonaChangeGroupsData* _data_;
 
2099
        _data_ = _user_data_;
 
2100
        _data_->_source_object_ = source_object;
 
2101
        _data_->_res_ = _res_;
 
2102
        edsf_persona_real_change_groups_co (_data_);
 
2103
}
 
2104
 
 
2105
 
 
2106
static gboolean edsf_persona_real_change_groups_co (EdsfPersonaChangeGroupsData* _data_) {
 
2107
        switch (_data_->_state_) {
 
2108
                case 0:
 
2109
                goto _state_0;
 
2110
                case 1:
 
2111
                goto _state_1;
 
2112
                default:
 
2113
                g_assert_not_reached ();
 
2114
        }
 
2115
        _state_0:
 
2116
        _data_->_tmp0_ = folks_persona_get_store ((FolksPersona*) _data_->self);
 
2117
        _data_->_tmp1_ = _data_->_tmp0_;
 
2118
        _data_->_tmp2_ = _data_->groups;
 
2119
        _data_->_state_ = 1;
 
2120
        _edsf_persona_store_set_groups (EDSF_PERSONA_STORE (_data_->_tmp1_), _data_->self, _data_->_tmp2_, edsf_persona_change_groups_ready, _data_);
 
2121
        return FALSE;
 
2122
        _state_1:
 
2123
        _edsf_persona_store_set_groups_finish (EDSF_PERSONA_STORE (_data_->_tmp1_), _data_->_res_, &_data_->_inner_error_);
 
2124
        if (_data_->_inner_error_ != NULL) {
 
2125
                if (_data_->_inner_error_->domain == FOLKS_PROPERTY_ERROR) {
 
2126
                        g_simple_async_result_set_from_error (_data_->_async_result, _data_->_inner_error_);
 
2127
                        g_error_free (_data_->_inner_error_);
 
2128
                        if (_data_->_state_ == 0) {
 
2129
                                g_simple_async_result_complete_in_idle (_data_->_async_result);
 
2130
                        } else {
 
2131
                                g_simple_async_result_complete (_data_->_async_result);
 
2132
                        }
 
2133
                        g_object_unref (_data_->_async_result);
 
2134
                        return FALSE;
 
2135
                } else {
 
2136
                        g_critical ("file %s: line %d: uncaught error: %s (%s, %d)", __FILE__, __LINE__, _data_->_inner_error_->message, g_quark_to_string (_data_->_inner_error_->domain), _data_->_inner_error_->code);
 
2137
                        g_clear_error (&_data_->_inner_error_);
 
2138
                        return FALSE;
 
2139
                }
 
2140
        }
 
2141
        if (_data_->_state_ == 0) {
 
2142
                g_simple_async_result_complete_in_idle (_data_->_async_result);
 
2143
        } else {
 
2144
                g_simple_async_result_complete (_data_->_async_result);
 
2145
        }
 
2146
        g_object_unref (_data_->_async_result);
 
2147
        return FALSE;
 
2148
}
 
2149
 
 
2150
 
 
2151
static void edsf_persona_real_change_birthday_data_free (gpointer _data) {
 
2152
        EdsfPersonaChangeBirthdayData* _data_;
 
2153
        _data_ = _data;
 
2154
        _g_date_time_unref0 (_data_->bday);
 
2155
        _g_object_unref0 (_data_->self);
 
2156
        g_slice_free (EdsfPersonaChangeBirthdayData, _data_);
 
2157
}
 
2158
 
 
2159
 
 
2160
static gpointer _g_date_time_ref0 (gpointer self) {
 
2161
        return self ? g_date_time_ref (self) : NULL;
 
2162
}
 
2163
 
 
2164
 
 
2165
static void edsf_persona_real_change_birthday (FolksBirthdayDetails* base, GDateTime* bday, GAsyncReadyCallback _callback_, gpointer _user_data_) {
 
2166
        EdsfPersona * self;
 
2167
        EdsfPersonaChangeBirthdayData* _data_;
 
2168
        EdsfPersona* _tmp0_;
 
2169
        GDateTime* _tmp1_;
 
2170
        GDateTime* _tmp2_;
 
2171
        self = (EdsfPersona*) base;
 
2172
        _data_ = g_slice_new0 (EdsfPersonaChangeBirthdayData);
 
2173
        _data_->_async_result = g_simple_async_result_new (G_OBJECT (self), _callback_, _user_data_, edsf_persona_real_change_birthday);
 
2174
        g_simple_async_result_set_op_res_gpointer (_data_->_async_result, _data_, edsf_persona_real_change_birthday_data_free);
 
2175
        _tmp0_ = _g_object_ref0 (self);
 
2176
        _data_->self = _tmp0_;
 
2177
        _tmp1_ = bday;
 
2178
        _tmp2_ = _g_date_time_ref0 (_tmp1_);
 
2179
        _data_->bday = _tmp2_;
 
2180
        edsf_persona_real_change_birthday_co (_data_);
 
2181
}
 
2182
 
 
2183
 
 
2184
static void edsf_persona_real_change_birthday_finish (FolksBirthdayDetails* base, GAsyncResult* _res_, GError** error) {
 
2185
        EdsfPersonaChangeBirthdayData* _data_;
 
2186
        if (g_simple_async_result_propagate_error (G_SIMPLE_ASYNC_RESULT (_res_), error)) {
 
2187
                return;
 
2188
        }
 
2189
        _data_ = g_simple_async_result_get_op_res_gpointer (G_SIMPLE_ASYNC_RESULT (_res_));
 
2190
}
 
2191
 
 
2192
 
 
2193
/**
 
2194
   * {@inheritDoc}
 
2195
   *
 
2196
   * @since 0.6.2
 
2197
   */
 
2198
static void edsf_persona_change_birthday_ready (GObject* source_object, GAsyncResult* _res_, gpointer _user_data_) {
 
2199
        EdsfPersonaChangeBirthdayData* _data_;
 
2200
        _data_ = _user_data_;
 
2201
        _data_->_source_object_ = source_object;
 
2202
        _data_->_res_ = _res_;
 
2203
        edsf_persona_real_change_birthday_co (_data_);
 
2204
}
 
2205
 
 
2206
 
 
2207
static gboolean edsf_persona_real_change_birthday_co (EdsfPersonaChangeBirthdayData* _data_) {
 
2208
        switch (_data_->_state_) {
 
2209
                case 0:
 
2210
                goto _state_0;
 
2211
                case 1:
 
2212
                goto _state_1;
 
2213
                default:
 
2214
                g_assert_not_reached ();
 
2215
        }
 
2216
        _state_0:
 
2217
        _data_->_tmp0_ = folks_persona_get_store ((FolksPersona*) _data_->self);
 
2218
        _data_->_tmp1_ = _data_->_tmp0_;
 
2219
        _data_->_tmp2_ = _data_->bday;
 
2220
        _data_->_state_ = 1;
 
2221
        _edsf_persona_store_set_birthday (EDSF_PERSONA_STORE (_data_->_tmp1_), _data_->self, _data_->_tmp2_, edsf_persona_change_birthday_ready, _data_);
 
2222
        return FALSE;
 
2223
        _state_1:
 
2224
        _edsf_persona_store_set_birthday_finish (EDSF_PERSONA_STORE (_data_->_tmp1_), _data_->_res_, &_data_->_inner_error_);
 
2225
        if (_data_->_inner_error_ != NULL) {
 
2226
                if (_data_->_inner_error_->domain == FOLKS_PROPERTY_ERROR) {
 
2227
                        g_simple_async_result_set_from_error (_data_->_async_result, _data_->_inner_error_);
 
2228
                        g_error_free (_data_->_inner_error_);
 
2229
                        if (_data_->_state_ == 0) {
 
2230
                                g_simple_async_result_complete_in_idle (_data_->_async_result);
 
2231
                        } else {
 
2232
                                g_simple_async_result_complete (_data_->_async_result);
 
2233
                        }
 
2234
                        g_object_unref (_data_->_async_result);
 
2235
                        return FALSE;
 
2236
                } else {
 
2237
                        g_critical ("file %s: line %d: uncaught error: %s (%s, %d)", __FILE__, __LINE__, _data_->_inner_error_->message, g_quark_to_string (_data_->_inner_error_->domain), _data_->_inner_error_->code);
 
2238
                        g_clear_error (&_data_->_inner_error_);
 
2239
                        return FALSE;
 
2240
                }
 
2241
        }
 
2242
        if (_data_->_state_ == 0) {
 
2243
                g_simple_async_result_complete_in_idle (_data_->_async_result);
 
2244
        } else {
 
2245
                g_simple_async_result_complete (_data_->_async_result);
 
2246
        }
 
2247
        g_object_unref (_data_->_async_result);
 
2248
        return FALSE;
 
2249
}
 
2250
 
 
2251
 
 
2252
static void edsf_persona_real_change_roles_data_free (gpointer _data) {
 
2253
        EdsfPersonaChangeRolesData* _data_;
 
2254
        _data_ = _data;
 
2255
        _g_object_unref0 (_data_->roles);
 
2256
        _g_object_unref0 (_data_->self);
 
2257
        g_slice_free (EdsfPersonaChangeRolesData, _data_);
 
2258
}
 
2259
 
 
2260
 
 
2261
static void edsf_persona_real_change_roles (FolksRoleDetails* base, GeeSet* roles, GAsyncReadyCallback _callback_, gpointer _user_data_) {
 
2262
        EdsfPersona * self;
 
2263
        EdsfPersonaChangeRolesData* _data_;
 
2264
        EdsfPersona* _tmp0_;
 
2265
        GeeSet* _tmp1_;
 
2266
        GeeSet* _tmp2_;
 
2267
        self = (EdsfPersona*) base;
 
2268
        _data_ = g_slice_new0 (EdsfPersonaChangeRolesData);
 
2269
        _data_->_async_result = g_simple_async_result_new (G_OBJECT (self), _callback_, _user_data_, edsf_persona_real_change_roles);
 
2270
        g_simple_async_result_set_op_res_gpointer (_data_->_async_result, _data_, edsf_persona_real_change_roles_data_free);
 
2271
        _tmp0_ = _g_object_ref0 (self);
 
2272
        _data_->self = _tmp0_;
 
2273
        _tmp1_ = roles;
 
2274
        _tmp2_ = _g_object_ref0 (_tmp1_);
 
2275
        _data_->roles = _tmp2_;
 
2276
        edsf_persona_real_change_roles_co (_data_);
 
2277
}
 
2278
 
 
2279
 
 
2280
static void edsf_persona_real_change_roles_finish (FolksRoleDetails* base, GAsyncResult* _res_, GError** error) {
 
2281
        EdsfPersonaChangeRolesData* _data_;
 
2282
        if (g_simple_async_result_propagate_error (G_SIMPLE_ASYNC_RESULT (_res_), error)) {
 
2283
                return;
 
2284
        }
 
2285
        _data_ = g_simple_async_result_get_op_res_gpointer (G_SIMPLE_ASYNC_RESULT (_res_));
 
2286
}
 
2287
 
 
2288
 
 
2289
/**
 
2290
   * {@inheritDoc}
 
2291
   *
 
2292
   * @since 0.6.2
 
2293
   */
 
2294
static void edsf_persona_change_roles_ready (GObject* source_object, GAsyncResult* _res_, gpointer _user_data_) {
 
2295
        EdsfPersonaChangeRolesData* _data_;
 
2296
        _data_ = _user_data_;
 
2297
        _data_->_source_object_ = source_object;
 
2298
        _data_->_res_ = _res_;
 
2299
        edsf_persona_real_change_roles_co (_data_);
 
2300
}
 
2301
 
 
2302
 
 
2303
static gboolean edsf_persona_real_change_roles_co (EdsfPersonaChangeRolesData* _data_) {
 
2304
        switch (_data_->_state_) {
 
2305
                case 0:
 
2306
                goto _state_0;
 
2307
                case 1:
 
2308
                goto _state_1;
 
2309
                default:
 
2310
                g_assert_not_reached ();
 
2311
        }
 
2312
        _state_0:
 
2313
        _data_->_tmp0_ = folks_persona_get_store ((FolksPersona*) _data_->self);
 
2314
        _data_->_tmp1_ = _data_->_tmp0_;
 
2315
        _data_->_tmp2_ = _data_->roles;
 
2316
        _data_->_state_ = 1;
 
2317
        _edsf_persona_store_set_roles (EDSF_PERSONA_STORE (_data_->_tmp1_), _data_->self, _data_->_tmp2_, edsf_persona_change_roles_ready, _data_);
 
2318
        return FALSE;
 
2319
        _state_1:
 
2320
        _edsf_persona_store_set_roles_finish (EDSF_PERSONA_STORE (_data_->_tmp1_), _data_->_res_, &_data_->_inner_error_);
 
2321
        if (_data_->_inner_error_ != NULL) {
 
2322
                if (_data_->_inner_error_->domain == FOLKS_PROPERTY_ERROR) {
 
2323
                        g_simple_async_result_set_from_error (_data_->_async_result, _data_->_inner_error_);
 
2324
                        g_error_free (_data_->_inner_error_);
 
2325
                        if (_data_->_state_ == 0) {
 
2326
                                g_simple_async_result_complete_in_idle (_data_->_async_result);
 
2327
                        } else {
 
2328
                                g_simple_async_result_complete (_data_->_async_result);
 
2329
                        }
 
2330
                        g_object_unref (_data_->_async_result);
 
2331
                        return FALSE;
 
2332
                } else {
 
2333
                        g_critical ("file %s: line %d: uncaught error: %s (%s, %d)", __FILE__, __LINE__, _data_->_inner_error_->message, g_quark_to_string (_data_->_inner_error_->domain), _data_->_inner_error_->code);
 
2334
                        g_clear_error (&_data_->_inner_error_);
 
2335
                        return FALSE;
 
2336
                }
 
2337
        }
 
2338
        if (_data_->_state_ == 0) {
 
2339
                g_simple_async_result_complete_in_idle (_data_->_async_result);
 
2340
        } else {
 
2341
                g_simple_async_result_complete (_data_->_async_result);
 
2342
        }
 
2343
        g_object_unref (_data_->_async_result);
 
2344
        return FALSE;
 
2345
}
 
2346
 
 
2347
 
 
2348
/**
 
2349
   * Build a IID.
 
2350
   *
 
2351
   * @param store_id the {@link PersonaStore.id}
 
2352
   * @param contact the Contact
 
2353
   * @return a valid IID
 
2354
   *
 
2355
   * @since 0.6.0
 
2356
   */
 
2357
gchar* edsf_persona_build_iid_from_contact (const gchar* store_id, EContact* contact) {
 
2358
        gchar* result = NULL;
 
2359
        EContact* _tmp0_;
 
2360
        void* _tmp1_ = NULL;
 
2361
        gchar* _tmp2_;
 
2362
        gchar* contact_id;
 
2363
        const gchar* _tmp3_;
 
2364
        gchar* _tmp4_ = NULL;
 
2365
        g_return_val_if_fail (store_id != NULL, NULL);
 
2366
        g_return_val_if_fail (contact != NULL, NULL);
 
2367
        _tmp0_ = contact;
 
2368
        _tmp1_ = _edsf_persona_get_property_from_contact (_tmp0_, "id");
 
2369
        _tmp2_ = g_strdup ((const gchar*) _tmp1_);
 
2370
        contact_id = _tmp2_;
 
2371
        _tmp3_ = store_id;
 
2372
        _tmp4_ = edsf_persona_build_iid (_tmp3_, contact_id);
 
2373
        result = _tmp4_;
 
2374
        _g_free0 (contact_id);
 
2375
        return result;
 
2376
}
 
2377
 
 
2378
 
 
2379
/**
 
2380
   * Build a IID.
 
2381
   *
 
2382
   * @param store_id the {@link PersonaStore.id}
 
2383
   * @param contact_id the id belonging to the Contact
 
2384
   * @return a valid IID
 
2385
   *
 
2386
   * @since 0.6.0
 
2387
   */
 
2388
gchar* edsf_persona_build_iid (const gchar* store_id, const gchar* contact_id) {
 
2389
        gchar* result = NULL;
 
2390
        const gchar* _tmp0_;
 
2391
        const gchar* _tmp1_;
 
2392
        gchar* _tmp2_ = NULL;
 
2393
        g_return_val_if_fail (store_id != NULL, NULL);
 
2394
        g_return_val_if_fail (contact_id != NULL, NULL);
 
2395
        _tmp0_ = store_id;
 
2396
        _tmp1_ = contact_id;
 
2397
        _tmp2_ = g_strdup_printf ("%s:%s", _tmp0_, _tmp1_);
 
2398
        result = _tmp2_;
 
2399
        return result;
 
2400
}
 
2401
 
 
2402
 
 
2403
/**
 
2404
   * Create a new persona.
 
2405
   *
 
2406
   * Create a new persona for the {@link PersonaStore} `store`, representing
 
2407
   * the EDS contact given by `contact`.
 
2408
   *
 
2409
   * @since 0.6.0
 
2410
   */
 
2411
EdsfPersona* edsf_persona_construct (GType object_type, EdsfPersonaStore* store, EContact* contact) {
 
2412
        EdsfPersona * self = NULL;
 
2413
        EContact* _tmp0_;
 
2414
        void* _tmp1_ = NULL;
 
2415
        gchar* _tmp2_;
 
2416
        gchar* contact_id;
 
2417
        EdsfPersonaStore* _tmp3_;
 
2418
        const gchar* _tmp4_;
 
2419
        const gchar* _tmp5_;
 
2420
        gchar* _tmp6_ = NULL;
 
2421
        gchar* uid;
 
2422
        EdsfPersonaStore* _tmp7_;
 
2423
        const gchar* _tmp8_;
 
2424
        const gchar* _tmp9_;
 
2425
        gchar* _tmp10_ = NULL;
 
2426
        gchar* iid;
 
2427
        EContact* _tmp11_;
 
2428
        gboolean _tmp12_ = FALSE;
 
2429
        gboolean is_user;
 
2430
        EContact* _tmp13_;
 
2431
        void* _tmp14_ = NULL;
 
2432
        gchar* _tmp15_;
 
2433
        gchar* full_name;
 
2434
        EdsfPersonaStore* _tmp16_;
 
2435
        GeeHashSet* _tmp17_;
 
2436
        GeeHashSet* _tmp18_;
 
2437
        GeeSet* _tmp19_;
 
2438
        GeeSet* _tmp20_;
 
2439
        GeeHashSet* _tmp21_;
 
2440
        GeeHashSet* _tmp22_;
 
2441
        GeeSet* _tmp23_;
 
2442
        GeeSet* _tmp24_;
 
2443
        GeeHashSet* _tmp25_;
 
2444
        GeeHashSet* _tmp26_;
 
2445
        GeeSet* _tmp27_;
 
2446
        GeeSet* _tmp28_;
 
2447
        GeeHashSet* _tmp29_;
 
2448
        GeeHashSet* _tmp30_;
 
2449
        GeeSet* _tmp31_;
 
2450
        GeeSet* _tmp32_;
 
2451
        GeeHashSet* _tmp33_;
 
2452
        GeeHashSet* _tmp34_;
 
2453
        GeeSet* _tmp35_;
 
2454
        GeeSet* _tmp36_;
 
2455
        GeeHashSet* _tmp37_;
 
2456
        GeeHashSet* _tmp38_;
 
2457
        GeeSet* _tmp39_;
 
2458
        GeeSet* _tmp40_;
 
2459
        GeeHashMultiMap* _tmp41_;
 
2460
        GeeHashSet* _tmp42_;
 
2461
        GeeHashSet* _tmp43_;
 
2462
        GeeSet* _tmp44_;
 
2463
        GeeSet* _tmp45_;
 
2464
        GeeHashSet* _tmp46_;
 
2465
        GeeHashSet* _tmp47_;
 
2466
        GeeSet* _tmp48_;
 
2467
        GeeSet* _tmp49_;
 
2468
        EContact* _tmp50_;
 
2469
        g_return_val_if_fail (store != NULL, NULL);
 
2470
        g_return_val_if_fail (contact != NULL, NULL);
 
2471
        _tmp0_ = contact;
 
2472
        _tmp1_ = _edsf_persona_get_property_from_contact (_tmp0_, "id");
 
2473
        _tmp2_ = g_strdup ((const gchar*) _tmp1_);
 
2474
        contact_id = _tmp2_;
 
2475
        _tmp3_ = store;
 
2476
        _tmp4_ = folks_persona_store_get_id ((FolksPersonaStore*) _tmp3_);
 
2477
        _tmp5_ = _tmp4_;
 
2478
        _tmp6_ = folks_persona_build_uid (BACKEND_NAME, _tmp5_, contact_id);
 
2479
        uid = _tmp6_;
 
2480
        _tmp7_ = store;
 
2481
        _tmp8_ = folks_persona_store_get_id ((FolksPersonaStore*) _tmp7_);
 
2482
        _tmp9_ = _tmp8_;
 
2483
        _tmp10_ = edsf_persona_build_iid (_tmp9_, contact_id);
 
2484
        iid = _tmp10_;
 
2485
        _tmp11_ = contact;
 
2486
        _tmp12_ = e_book_client_is_self (_tmp11_);
 
2487
        is_user = _tmp12_;
 
2488
        _tmp13_ = contact;
 
2489
        _tmp14_ = _edsf_persona_get_property_from_contact (_tmp13_, "full_name");
 
2490
        _tmp15_ = g_strdup ((const gchar*) _tmp14_);
 
2491
        full_name = _tmp15_;
 
2492
        g_debug ("edsf-persona.vala:673: Creating new Edsf.Persona with IID '%s'", iid);
 
2493
        _tmp16_ = store;
 
2494
        self = (EdsfPersona*) g_object_new (object_type, "display-id", full_name, "uid", uid, "iid", iid, "store", _tmp16_, "is-user", is_user, NULL);
 
2495
        self->priv->_gender = FOLKS_GENDER_UNSPECIFIED;
 
2496
        edsf_persona_set_contact_id (self, contact_id);
 
2497
        _tmp17_ = gee_hash_set_new (FOLKS_TYPE_PHONE_FIELD_DETAILS, (GBoxedCopyFunc) g_object_ref, g_object_unref, (GHashFunc) folks_abstract_field_details_hash, (GEqualFunc) folks_abstract_field_details_equal);
 
2498
        _g_object_unref0 (self->priv->_phone_numbers);
 
2499
        self->priv->_phone_numbers = _tmp17_;
 
2500
        _tmp18_ = self->priv->_phone_numbers;
 
2501
        _tmp19_ = gee_abstract_set_get_read_only_view ((GeeAbstractSet*) _tmp18_);
 
2502
        _tmp20_ = _tmp19_;
 
2503
        _g_object_unref0 (self->priv->_phone_numbers_ro);
 
2504
        self->priv->_phone_numbers_ro = _tmp20_;
 
2505
        _tmp21_ = gee_hash_set_new (FOLKS_TYPE_EMAIL_FIELD_DETAILS, (GBoxedCopyFunc) g_object_ref, g_object_unref, (GHashFunc) folks_abstract_field_details_hash, (GEqualFunc) folks_abstract_field_details_equal);
 
2506
        _g_object_unref0 (self->priv->_email_addresses);
 
2507
        self->priv->_email_addresses = _tmp21_;
 
2508
        _tmp22_ = self->priv->_email_addresses;
 
2509
        _tmp23_ = gee_abstract_set_get_read_only_view ((GeeAbstractSet*) _tmp22_);
 
2510
        _tmp24_ = _tmp23_;
 
2511
        _g_object_unref0 (self->priv->_email_addresses_ro);
 
2512
        self->priv->_email_addresses_ro = _tmp24_;
 
2513
        _tmp25_ = gee_hash_set_new (FOLKS_TYPE_NOTE_FIELD_DETAILS, (GBoxedCopyFunc) g_object_ref, g_object_unref, (GHashFunc) folks_abstract_field_details_hash, (GEqualFunc) folks_abstract_field_details_equal);
 
2514
        _g_object_unref0 (self->priv->_notes);
 
2515
        self->priv->_notes = _tmp25_;
 
2516
        _tmp26_ = self->priv->_notes;
 
2517
        _tmp27_ = gee_abstract_set_get_read_only_view ((GeeAbstractSet*) _tmp26_);
 
2518
        _tmp28_ = _tmp27_;
 
2519
        _g_object_unref0 (self->priv->_notes_ro);
 
2520
        self->priv->_notes_ro = _tmp28_;
 
2521
        _tmp29_ = gee_hash_set_new (FOLKS_TYPE_URL_FIELD_DETAILS, (GBoxedCopyFunc) g_object_ref, g_object_unref, (GHashFunc) folks_abstract_field_details_hash, (GEqualFunc) folks_abstract_field_details_equal);
 
2522
        _g_object_unref0 (self->priv->_urls);
 
2523
        self->priv->_urls = _tmp29_;
 
2524
        _tmp30_ = self->priv->_urls;
 
2525
        _tmp31_ = gee_abstract_set_get_read_only_view ((GeeAbstractSet*) _tmp30_);
 
2526
        _tmp32_ = _tmp31_;
 
2527
        _g_object_unref0 (self->priv->_urls_ro);
 
2528
        self->priv->_urls_ro = _tmp32_;
 
2529
        _tmp33_ = gee_hash_set_new (FOLKS_TYPE_POSTAL_ADDRESS_FIELD_DETAILS, (GBoxedCopyFunc) g_object_ref, g_object_unref, (GHashFunc) folks_abstract_field_details_hash, (GEqualFunc) folks_abstract_field_details_equal);
 
2530
        _g_object_unref0 (self->priv->_postal_addresses);
 
2531
        self->priv->_postal_addresses = _tmp33_;
 
2532
        _tmp34_ = self->priv->_postal_addresses;
 
2533
        _tmp35_ = gee_abstract_set_get_read_only_view ((GeeAbstractSet*) _tmp34_);
 
2534
        _tmp36_ = _tmp35_;
 
2535
        _g_object_unref0 (self->priv->_postal_addresses_ro);
 
2536
        self->priv->_postal_addresses_ro = _tmp36_;
 
2537
        _tmp37_ = gee_hash_set_new (G_TYPE_STRING, (GBoxedCopyFunc) g_strdup, g_free, NULL, NULL);
 
2538
        _g_object_unref0 (self->priv->_local_ids);
 
2539
        self->priv->_local_ids = _tmp37_;
 
2540
        _tmp38_ = self->priv->_local_ids;
 
2541
        _tmp39_ = gee_abstract_set_get_read_only_view ((GeeAbstractSet*) _tmp38_);
 
2542
        _tmp40_ = _tmp39_;
 
2543
        _g_object_unref0 (self->priv->_local_ids_ro);
 
2544
        self->priv->_local_ids_ro = _tmp40_;
 
2545
        _tmp41_ = gee_hash_multi_map_new (G_TYPE_STRING, (GBoxedCopyFunc) g_strdup, g_free, FOLKS_TYPE_WEB_SERVICE_FIELD_DETAILS, (GBoxedCopyFunc) g_object_ref, g_object_unref, NULL, NULL, (GHashFunc) folks_abstract_field_details_hash, (GEqualFunc) folks_abstract_field_details_equal);
 
2546
        _g_object_unref0 (self->priv->_web_service_addresses);
 
2547
        self->priv->_web_service_addresses = _tmp41_;
 
2548
        _tmp42_ = gee_hash_set_new (G_TYPE_STRING, (GBoxedCopyFunc) g_strdup, g_free, NULL, NULL);
 
2549
        _g_object_unref0 (self->priv->_groups);
 
2550
        self->priv->_groups = _tmp42_;
 
2551
        _tmp43_ = self->priv->_groups;
 
2552
        _tmp44_ = gee_abstract_set_get_read_only_view ((GeeAbstractSet*) _tmp43_);
 
2553
        _tmp45_ = _tmp44_;
 
2554
        _g_object_unref0 (self->priv->_groups_ro);
 
2555
        self->priv->_groups_ro = _tmp45_;
 
2556
        _tmp46_ = gee_hash_set_new (FOLKS_TYPE_ROLE_FIELD_DETAILS, (GBoxedCopyFunc) g_object_ref, g_object_unref, (GHashFunc) folks_abstract_field_details_hash, (GEqualFunc) folks_abstract_field_details_equal);
 
2557
        _g_object_unref0 (self->priv->_roles);
 
2558
        self->priv->_roles = _tmp46_;
 
2559
        _tmp47_ = self->priv->_roles;
 
2560
        _tmp48_ = gee_abstract_set_get_read_only_view ((GeeAbstractSet*) _tmp47_);
 
2561
        _tmp49_ = _tmp48_;
 
2562
        _g_object_unref0 (self->priv->_roles_ro);
 
2563
        self->priv->_roles_ro = _tmp49_;
 
2564
        _tmp50_ = contact;
 
2565
        _edsf_persona_update (self, _tmp50_);
 
2566
        _g_free0 (full_name);
 
2567
        _g_free0 (iid);
 
2568
        _g_free0 (uid);
 
2569
        _g_free0 (contact_id);
 
2570
        return self;
 
2571
}
 
2572
 
 
2573
 
 
2574
EdsfPersona* edsf_persona_new (EdsfPersonaStore* store, EContact* contact) {
 
2575
        return edsf_persona_construct (EDSF_TYPE_PERSONA, store, contact);
 
2576
}
 
2577
 
 
2578
 
 
2579
/**
 
2580
   * {@inheritDoc}
 
2581
   *
 
2582
   * @since 0.6.0
 
2583
   */
 
2584
static void edsf_persona_real_linkable_property_to_links (FolksPersona* base, const gchar* prop_name, FolksPersonaLinkablePropertyCallback callback, void* callback_target) {
 
2585
        EdsfPersona * self;
 
2586
        const gchar* _tmp0_;
 
2587
        self = (EdsfPersona*) base;
 
2588
        g_return_if_fail (prop_name != NULL);
 
2589
        _tmp0_ = prop_name;
 
2590
        if (g_strcmp0 (_tmp0_, "im-addresses") == 0) {
 
2591
                {
 
2592
                        GeeHashMultiMap* _tmp1_;
 
2593
                        GeeSet* _tmp2_ = NULL;
 
2594
                        GeeSet* _tmp3_;
 
2595
                        GeeIterator* _tmp4_ = NULL;
 
2596
                        GeeIterator* _tmp5_;
 
2597
                        GeeIterator* _protocol_it;
 
2598
                        _tmp1_ = self->priv->_im_addresses;
 
2599
                        _tmp2_ = gee_multi_map_get_keys ((GeeMultiMap*) _tmp1_);
 
2600
                        _tmp3_ = _tmp2_;
 
2601
                        _tmp4_ = gee_iterable_iterator ((GeeIterable*) _tmp3_);
 
2602
                        _tmp5_ = _tmp4_;
 
2603
                        _g_object_unref0 (_tmp3_);
 
2604
                        _protocol_it = _tmp5_;
 
2605
                        while (TRUE) {
 
2606
                                GeeIterator* _tmp6_;
 
2607
                                gboolean _tmp7_ = FALSE;
 
2608
                                GeeIterator* _tmp8_;
 
2609
                                gpointer _tmp9_ = NULL;
 
2610
                                gchar* protocol;
 
2611
                                GeeHashMultiMap* _tmp10_;
 
2612
                                const gchar* _tmp11_;
 
2613
                                GeeCollection* _tmp12_ = NULL;
 
2614
                                GeeCollection* im_fds;
 
2615
                                _tmp6_ = _protocol_it;
 
2616
                                _tmp7_ = gee_iterator_next (_tmp6_);
 
2617
                                if (!_tmp7_) {
 
2618
                                        break;
 
2619
                                }
 
2620
                                _tmp8_ = _protocol_it;
 
2621
                                _tmp9_ = gee_iterator_get (_tmp8_);
 
2622
                                protocol = (gchar*) _tmp9_;
 
2623
                                _tmp10_ = self->priv->_im_addresses;
 
2624
                                _tmp11_ = protocol;
 
2625
                                _tmp12_ = gee_multi_map_get ((GeeMultiMap*) _tmp10_, _tmp11_);
 
2626
                                im_fds = _tmp12_;
 
2627
                                {
 
2628
                                        GeeCollection* _tmp13_;
 
2629
                                        GeeIterator* _tmp14_ = NULL;
 
2630
                                        GeeIterator* _im_fd_it;
 
2631
                                        _tmp13_ = im_fds;
 
2632
                                        _tmp14_ = gee_iterable_iterator ((GeeIterable*) _tmp13_);
 
2633
                                        _im_fd_it = _tmp14_;
 
2634
                                        while (TRUE) {
 
2635
                                                GeeIterator* _tmp15_;
 
2636
                                                gboolean _tmp16_ = FALSE;
 
2637
                                                GeeIterator* _tmp17_;
 
2638
                                                gpointer _tmp18_ = NULL;
 
2639
                                                FolksImFieldDetails* im_fd;
 
2640
                                                FolksPersonaLinkablePropertyCallback _tmp19_;
 
2641
                                                void* _tmp19__target;
 
2642
                                                const gchar* _tmp20_;
 
2643
                                                gchar* _tmp21_;
 
2644
                                                gchar* _tmp22_;
 
2645
                                                FolksImFieldDetails* _tmp23_;
 
2646
                                                gconstpointer _tmp24_;
 
2647
                                                const gchar* _tmp25_;
 
2648
                                                gchar* _tmp26_;
 
2649
                                                gchar* _tmp27_;
 
2650
                                                _tmp15_ = _im_fd_it;
 
2651
                                                _tmp16_ = gee_iterator_next (_tmp15_);
 
2652
                                                if (!_tmp16_) {
 
2653
                                                        break;
 
2654
                                                }
 
2655
                                                _tmp17_ = _im_fd_it;
 
2656
                                                _tmp18_ = gee_iterator_get (_tmp17_);
 
2657
                                                im_fd = (FolksImFieldDetails*) _tmp18_;
 
2658
                                                _tmp19_ = callback;
 
2659
                                                _tmp19__target = callback_target;
 
2660
                                                _tmp20_ = protocol;
 
2661
                                                _tmp21_ = g_strconcat (_tmp20_, ":", NULL);
 
2662
                                                _tmp22_ = _tmp21_;
 
2663
                                                _tmp23_ = im_fd;
 
2664
                                                _tmp24_ = folks_abstract_field_details_get_value ((FolksAbstractFieldDetails*) _tmp23_);
 
2665
                                                _tmp25_ = _tmp24_;
 
2666
                                                _tmp26_ = g_strconcat (_tmp22_, (const gchar*) _tmp25_, NULL);
 
2667
                                                _tmp27_ = _tmp26_;
 
2668
                                                _tmp19_ (_tmp27_, _tmp19__target);
 
2669
                                                _g_free0 (_tmp27_);
 
2670
                                                _g_free0 (_tmp22_);
 
2671
                                                _g_object_unref0 (im_fd);
 
2672
                                        }
 
2673
                                        _g_object_unref0 (_im_fd_it);
 
2674
                                }
 
2675
                                _g_object_unref0 (im_fds);
 
2676
                                _g_free0 (protocol);
 
2677
                        }
 
2678
                        _g_object_unref0 (_protocol_it);
 
2679
                }
 
2680
        } else {
 
2681
                const gchar* _tmp28_;
 
2682
                _tmp28_ = prop_name;
 
2683
                if (g_strcmp0 (_tmp28_, "local-ids") == 0) {
 
2684
                        {
 
2685
                                GeeSet* _tmp29_;
 
2686
                                GeeSet* _tmp30_;
 
2687
                                GeeIterator* _tmp31_ = NULL;
 
2688
                                GeeIterator* _id_it;
 
2689
                                _tmp29_ = folks_local_id_details_get_local_ids ((FolksLocalIdDetails*) self);
 
2690
                                _tmp30_ = _tmp29_;
 
2691
                                _tmp31_ = gee_iterable_iterator ((GeeIterable*) _tmp30_);
 
2692
                                _id_it = _tmp31_;
 
2693
                                while (TRUE) {
 
2694
                                        GeeIterator* _tmp32_;
 
2695
                                        gboolean _tmp33_ = FALSE;
 
2696
                                        GeeIterator* _tmp34_;
 
2697
                                        gpointer _tmp35_ = NULL;
 
2698
                                        gchar* id;
 
2699
                                        FolksPersonaLinkablePropertyCallback _tmp36_;
 
2700
                                        void* _tmp36__target;
 
2701
                                        const gchar* _tmp37_;
 
2702
                                        _tmp32_ = _id_it;
 
2703
                                        _tmp33_ = gee_iterator_next (_tmp32_);
 
2704
                                        if (!_tmp33_) {
 
2705
                                                break;
 
2706
                                        }
 
2707
                                        _tmp34_ = _id_it;
 
2708
                                        _tmp35_ = gee_iterator_get (_tmp34_);
 
2709
                                        id = (gchar*) _tmp35_;
 
2710
                                        _tmp36_ = callback;
 
2711
                                        _tmp36__target = callback_target;
 
2712
                                        _tmp37_ = id;
 
2713
                                        _tmp36_ (_tmp37_, _tmp36__target);
 
2714
                                        _g_free0 (id);
 
2715
                                }
 
2716
                                _g_object_unref0 (_id_it);
 
2717
                        }
 
2718
                } else {
 
2719
                        const gchar* _tmp38_;
 
2720
                        _tmp38_ = prop_name;
 
2721
                        if (g_strcmp0 (_tmp38_, "web-service-addresses") == 0) {
 
2722
                                {
 
2723
                                        GeeMultiMap* _tmp39_;
 
2724
                                        GeeMultiMap* _tmp40_;
 
2725
                                        GeeSet* _tmp41_ = NULL;
 
2726
                                        GeeSet* _tmp42_;
 
2727
                                        GeeIterator* _tmp43_ = NULL;
 
2728
                                        GeeIterator* _tmp44_;
 
2729
                                        GeeIterator* _web_service_it;
 
2730
                                        _tmp39_ = folks_web_service_details_get_web_service_addresses ((FolksWebServiceDetails*) self);
 
2731
                                        _tmp40_ = _tmp39_;
 
2732
                                        _tmp41_ = gee_multi_map_get_keys (_tmp40_);
 
2733
                                        _tmp42_ = _tmp41_;
 
2734
                                        _tmp43_ = gee_iterable_iterator ((GeeIterable*) _tmp42_);
 
2735
                                        _tmp44_ = _tmp43_;
 
2736
                                        _g_object_unref0 (_tmp42_);
 
2737
                                        _web_service_it = _tmp44_;
 
2738
                                        while (TRUE) {
 
2739
                                                GeeIterator* _tmp45_;
 
2740
                                                gboolean _tmp46_ = FALSE;
 
2741
                                                GeeIterator* _tmp47_;
 
2742
                                                gpointer _tmp48_ = NULL;
 
2743
                                                gchar* web_service;
 
2744
                                                GeeHashMultiMap* _tmp49_;
 
2745
                                                const gchar* _tmp50_;
 
2746
                                                GeeCollection* _tmp51_ = NULL;
 
2747
                                                GeeCollection* web_service_addresses;
 
2748
                                                _tmp45_ = _web_service_it;
 
2749
                                                _tmp46_ = gee_iterator_next (_tmp45_);
 
2750
                                                if (!_tmp46_) {
 
2751
                                                        break;
 
2752
                                                }
 
2753
                                                _tmp47_ = _web_service_it;
 
2754
                                                _tmp48_ = gee_iterator_get (_tmp47_);
 
2755
                                                web_service = (gchar*) _tmp48_;
 
2756
                                                _tmp49_ = self->priv->_web_service_addresses;
 
2757
                                                _tmp50_ = web_service;
 
2758
                                                _tmp51_ = gee_multi_map_get ((GeeMultiMap*) _tmp49_, _tmp50_);
 
2759
                                                web_service_addresses = _tmp51_;
 
2760
                                                {
 
2761
                                                        GeeCollection* _tmp52_;
 
2762
                                                        GeeIterator* _tmp53_ = NULL;
 
2763
                                                        GeeIterator* _ws_fd_it;
 
2764
                                                        _tmp52_ = web_service_addresses;
 
2765
                                                        _tmp53_ = gee_iterable_iterator ((GeeIterable*) _tmp52_);
 
2766
                                                        _ws_fd_it = _tmp53_;
 
2767
                                                        while (TRUE) {
 
2768
                                                                GeeIterator* _tmp54_;
 
2769
                                                                gboolean _tmp55_ = FALSE;
 
2770
                                                                GeeIterator* _tmp56_;
 
2771
                                                                gpointer _tmp57_ = NULL;
 
2772
                                                                FolksWebServiceFieldDetails* ws_fd;
 
2773
                                                                FolksPersonaLinkablePropertyCallback _tmp58_;
 
2774
                                                                void* _tmp58__target;
 
2775
                                                                const gchar* _tmp59_;
 
2776
                                                                gchar* _tmp60_;
 
2777
                                                                gchar* _tmp61_;
 
2778
                                                                FolksWebServiceFieldDetails* _tmp62_;
 
2779
                                                                gconstpointer _tmp63_;
 
2780
                                                                const gchar* _tmp64_;
 
2781
                                                                gchar* _tmp65_;
 
2782
                                                                gchar* _tmp66_;
 
2783
                                                                _tmp54_ = _ws_fd_it;
 
2784
                                                                _tmp55_ = gee_iterator_next (_tmp54_);
 
2785
                                                                if (!_tmp55_) {
 
2786
                                                                        break;
 
2787
                                                                }
 
2788
                                                                _tmp56_ = _ws_fd_it;
 
2789
                                                                _tmp57_ = gee_iterator_get (_tmp56_);
 
2790
                                                                ws_fd = (FolksWebServiceFieldDetails*) _tmp57_;
 
2791
                                                                _tmp58_ = callback;
 
2792
                                                                _tmp58__target = callback_target;
 
2793
                                                                _tmp59_ = web_service;
 
2794
                                                                _tmp60_ = g_strconcat (_tmp59_, ":", NULL);
 
2795
                                                                _tmp61_ = _tmp60_;
 
2796
                                                                _tmp62_ = ws_fd;
 
2797
                                                                _tmp63_ = folks_abstract_field_details_get_value ((FolksAbstractFieldDetails*) _tmp62_);
 
2798
                                                                _tmp64_ = _tmp63_;
 
2799
                                                                _tmp65_ = g_strconcat (_tmp61_, (const gchar*) _tmp64_, NULL);
 
2800
                                                                _tmp66_ = _tmp65_;
 
2801
                                                                _tmp58_ (_tmp66_, _tmp58__target);
 
2802
                                                                _g_free0 (_tmp66_);
 
2803
                                                                _g_free0 (_tmp61_);
 
2804
                                                                _g_object_unref0 (ws_fd);
 
2805
                                                        }
 
2806
                                                        _g_object_unref0 (_ws_fd_it);
 
2807
                                                }
 
2808
                                                _g_object_unref0 (web_service_addresses);
 
2809
                                                _g_free0 (web_service);
 
2810
                                        }
 
2811
                                        _g_object_unref0 (_web_service_it);
 
2812
                                }
 
2813
                        } else {
 
2814
                                const gchar* _tmp67_;
 
2815
                                FolksPersonaLinkablePropertyCallback _tmp68_;
 
2816
                                void* _tmp68__target;
 
2817
                                _tmp67_ = prop_name;
 
2818
                                _tmp68_ = callback;
 
2819
                                _tmp68__target = callback_target;
 
2820
                                FOLKS_PERSONA_CLASS (edsf_persona_parent_class)->linkable_property_to_links (FOLKS_PERSONA (self), _tmp67_, _tmp68_, _tmp68__target);
 
2821
                        }
 
2822
                }
 
2823
        }
 
2824
}
 
2825
 
 
2826
 
 
2827
/**
 
2828
   * Update attribs of the persona.
 
2829
   */
 
2830
void _edsf_persona_update (EdsfPersona* self, EContact* contact) {
 
2831
        EContact* _tmp0_;
 
2832
        g_return_if_fail (self != NULL);
 
2833
        g_return_if_fail (contact != NULL);
 
2834
        _tmp0_ = contact;
 
2835
        edsf_persona_set_contact (self, _tmp0_);
 
2836
        g_object_freeze_notify ((GObject*) self);
 
2837
        _edsf_persona_update_names (self);
 
2838
        _edsf_persona_update_avatar (self);
 
2839
        _edsf_persona_update_urls (self);
 
2840
        _edsf_persona_update_phones (self);
 
2841
        _edsf_persona_update_addresses (self);
 
2842
        _edsf_persona_update_emails (self);
 
2843
        _edsf_persona_update_im_addresses (self);
 
2844
        _edsf_persona_update_groups (self);
 
2845
        _edsf_persona_update_notes (self);
 
2846
        _edsf_persona_update_local_ids (self);
 
2847
        _edsf_persona_update_web_services_addresses (self);
 
2848
        _edsf_persona_update_gender (self);
 
2849
        _edsf_persona_update_birthday (self);
 
2850
        _edsf_persona_update_roles (self);
 
2851
        g_object_thaw_notify ((GObject*) self);
 
2852
}
 
2853
 
 
2854
 
 
2855
static void _edsf_persona_update_params (EdsfPersona* self, FolksAbstractFieldDetails* details, EVCardAttribute* attr) {
 
2856
        EVCardAttribute* _tmp0_;
 
2857
        GList* _tmp1_ = NULL;
 
2858
        g_return_if_fail (self != NULL);
 
2859
        g_return_if_fail (details != NULL);
 
2860
        g_return_if_fail (attr != NULL);
 
2861
        _tmp0_ = attr;
 
2862
        _tmp1_ = e_vcard_attribute_get_params (_tmp0_);
 
2863
        {
 
2864
                GList* param_collection = NULL;
 
2865
                GList* param_it = NULL;
 
2866
                param_collection = _tmp1_;
 
2867
                for (param_it = param_collection; param_it != NULL; param_it = param_it->next) {
 
2868
                        EVCardAttributeParam* param = NULL;
 
2869
                        param = (EVCardAttributeParam*) param_it->data;
 
2870
                        {
 
2871
                                EVCardAttributeParam* _tmp2_;
 
2872
                                const gchar* _tmp3_ = NULL;
 
2873
                                gchar* _tmp4_ = NULL;
 
2874
                                gchar* param_name;
 
2875
                                EVCardAttributeParam* _tmp5_;
 
2876
                                GList* _tmp6_ = NULL;
 
2877
                                _tmp2_ = param;
 
2878
                                _tmp3_ = e_vcard_attribute_param_get_name (_tmp2_);
 
2879
                                _tmp4_ = g_utf8_strdown (_tmp3_, (gssize) (-1));
 
2880
                                param_name = _tmp4_;
 
2881
                                _tmp5_ = param;
 
2882
                                _tmp6_ = e_vcard_attribute_param_get_values (_tmp5_);
 
2883
                                {
 
2884
                                        GList* param_value_collection = NULL;
 
2885
                                        GList* param_value_it = NULL;
 
2886
                                        param_value_collection = _tmp6_;
 
2887
                                        for (param_value_it = param_value_collection; param_value_it != NULL; param_value_it = param_value_it->next) {
 
2888
                                                const gchar* param_value = NULL;
 
2889
                                                param_value = (const gchar*) param_value_it->data;
 
2890
                                                {
 
2891
                                                        const gchar* _tmp7_;
 
2892
                                                        _tmp7_ = param_name;
 
2893
                                                        if (g_strcmp0 (_tmp7_, FOLKS_ABSTRACT_FIELD_DETAILS_PARAM_TYPE) == 0) {
 
2894
                                                                FolksAbstractFieldDetails* _tmp8_;
 
2895
                                                                const gchar* _tmp9_;
 
2896
                                                                const gchar* _tmp10_;
 
2897
                                                                gchar* _tmp11_ = NULL;
 
2898
                                                                gchar* _tmp12_;
 
2899
                                                                _tmp8_ = details;
 
2900
                                                                _tmp9_ = param_name;
 
2901
                                                                _tmp10_ = param_value;
 
2902
                                                                _tmp11_ = g_utf8_strdown (_tmp10_, (gssize) (-1));
 
2903
                                                                _tmp12_ = _tmp11_;
 
2904
                                                                folks_abstract_field_details_add_parameter (_tmp8_, _tmp9_, _tmp12_);
 
2905
                                                                _g_free0 (_tmp12_);
 
2906
                                                        } else {
 
2907
                                                                FolksAbstractFieldDetails* _tmp13_;
 
2908
                                                                const gchar* _tmp14_;
 
2909
                                                                const gchar* _tmp15_;
 
2910
                                                                _tmp13_ = details;
 
2911
                                                                _tmp14_ = param_name;
 
2912
                                                                _tmp15_ = param_value;
 
2913
                                                                folks_abstract_field_details_add_parameter (_tmp13_, _tmp14_, _tmp15_);
 
2914
                                                        }
 
2915
                                                }
 
2916
                                        }
 
2917
                                }
 
2918
                                _g_free0 (param_name);
 
2919
                        }
 
2920
                }
 
2921
        }
 
2922
}
 
2923
 
 
2924
 
 
2925
static EVCardAttribute* _vala_EVCardAttribute_copy (EVCardAttribute* self) {
 
2926
        return g_boxed_copy (e_vcard_attribute_get_type (), self);
 
2927
}
 
2928
 
 
2929
 
 
2930
static gpointer __vala_EVCardAttribute_copy0 (gpointer self) {
 
2931
        return self ? _vala_EVCardAttribute_copy (self) : NULL;
 
2932
}
 
2933
 
 
2934
 
 
2935
static void _vala_EVCardAttribute_free (EVCardAttribute* self) {
 
2936
        g_boxed_free (e_vcard_attribute_get_type (), self);
 
2937
}
 
2938
 
 
2939
 
 
2940
static void _edsf_persona_update_gender (EdsfPersona* self) {
 
2941
        FolksGender gender;
 
2942
        EContact* _tmp0_;
 
2943
        EVCardAttribute* _tmp1_ = NULL;
 
2944
        EVCardAttribute* _tmp2_;
 
2945
        EVCardAttribute* gender_attr;
 
2946
        EVCardAttribute* _tmp3_;
 
2947
        FolksGender _tmp11_;
 
2948
        FolksGender _tmp12_;
 
2949
        g_return_if_fail (self != NULL);
 
2950
        gender = FOLKS_GENDER_UNSPECIFIED;
 
2951
        _tmp0_ = self->priv->_contact;
 
2952
        _tmp1_ = e_vcard_get_attribute ((EVCard*) _tmp0_, EDSF_PERSONA_gender_attribute_name);
 
2953
        _tmp2_ = __vala_EVCardAttribute_copy0 (_tmp1_);
 
2954
        gender_attr = _tmp2_;
 
2955
        _tmp3_ = gender_attr;
 
2956
        if (_tmp3_ != NULL) {
 
2957
                EVCardAttribute* _tmp4_;
 
2958
                gchar* _tmp5_ = NULL;
 
2959
                gchar* _tmp6_;
 
2960
                gchar* _tmp7_ = NULL;
 
2961
                gchar* _tmp8_;
 
2962
                gchar* gender_str;
 
2963
                const gchar* _tmp9_;
 
2964
                _tmp4_ = gender_attr;
 
2965
                _tmp5_ = e_vcard_attribute_get_value (_tmp4_);
 
2966
                _tmp6_ = _tmp5_;
 
2967
                _tmp7_ = g_utf8_strup (_tmp6_, (gssize) (-1));
 
2968
                _tmp8_ = _tmp7_;
 
2969
                _g_free0 (_tmp6_);
 
2970
                gender_str = _tmp8_;
 
2971
                _tmp9_ = gender_str;
 
2972
                if (g_strcmp0 (_tmp9_, EDSF_PERSONA_gender_male) == 0) {
 
2973
                        gender = FOLKS_GENDER_MALE;
 
2974
                } else {
 
2975
                        const gchar* _tmp10_;
 
2976
                        _tmp10_ = gender_str;
 
2977
                        if (g_strcmp0 (_tmp10_, EDSF_PERSONA_gender_female) == 0) {
 
2978
                                gender = FOLKS_GENDER_FEMALE;
 
2979
                        }
 
2980
                }
 
2981
                _g_free0 (gender_str);
 
2982
        }
 
2983
        _tmp11_ = self->priv->_gender;
 
2984
        _tmp12_ = gender;
 
2985
        if (_tmp11_ != _tmp12_) {
 
2986
                FolksGender _tmp13_;
 
2987
                _tmp13_ = gender;
 
2988
                self->priv->_gender = _tmp13_;
 
2989
                g_object_notify ((GObject*) self, "gender");
 
2990
        }
 
2991
        __vala_EVCardAttribute_free0 (gender_attr);
 
2992
}
 
2993
 
 
2994
 
 
2995
static EContactDate* _vala_EContactDate_copy (EContactDate* self) {
 
2996
        return g_boxed_copy (e_contact_date_get_type (), self);
 
2997
}
 
2998
 
 
2999
 
 
3000
static gpointer __vala_EContactDate_copy0 (gpointer self) {
 
3001
        return self ? _vala_EContactDate_copy (self) : NULL;
 
3002
}
 
3003
 
 
3004
 
 
3005
static void _vala_EContactDate_free (EContactDate* self) {
 
3006
        g_boxed_free (e_contact_date_get_type (), self);
 
3007
}
 
3008
 
 
3009
 
 
3010
static void _edsf_persona_update_birthday (EdsfPersona* self) {
 
3011
        void* _tmp0_ = NULL;
 
3012
        EContactDate* _tmp1_;
 
3013
        EContactDate* bday;
 
3014
        EContactDate* _tmp2_;
 
3015
        g_return_if_fail (self != NULL);
 
3016
        _tmp0_ = _edsf_persona_get_property (self, "birth_date");
 
3017
        _tmp1_ = __vala_EContactDate_copy0 ((EContactDate*) _tmp0_);
 
3018
        bday = _tmp1_;
 
3019
        _tmp2_ = bday;
 
3020
        if (_tmp2_ != NULL) {
 
3021
                GTimeZone* _tmp3_;
 
3022
                EContactDate* _tmp4_;
 
3023
                guint _tmp5_;
 
3024
                EContactDate* _tmp6_;
 
3025
                guint _tmp7_;
 
3026
                EContactDate* _tmp8_;
 
3027
                guint _tmp9_;
 
3028
                GDateTime* _tmp10_;
 
3029
                GDateTime* d;
 
3030
                gboolean _tmp11_ = FALSE;
 
3031
                GDateTime* _tmp12_;
 
3032
                gboolean _tmp21_;
 
3033
                _tmp3_ = edsf_persona__local_time_zone;
 
3034
                _tmp4_ = bday;
 
3035
                _tmp5_ = _tmp4_->year;
 
3036
                _tmp6_ = bday;
 
3037
                _tmp7_ = _tmp6_->month;
 
3038
                _tmp8_ = bday;
 
3039
                _tmp9_ = _tmp8_->day;
 
3040
                _tmp10_ = g_date_time_new (_tmp3_, (gint) _tmp5_, (gint) _tmp7_, (gint) _tmp9_, 0, 0, 0.0);
 
3041
                d = _tmp10_;
 
3042
                _tmp12_ = self->priv->_birthday;
 
3043
                if (_tmp12_ == NULL) {
 
3044
                        _tmp11_ = TRUE;
 
3045
                } else {
 
3046
                        gboolean _tmp13_ = FALSE;
 
3047
                        GDateTime* _tmp14_;
 
3048
                        gboolean _tmp20_;
 
3049
                        _tmp14_ = self->priv->_birthday;
 
3050
                        if (_tmp14_ != NULL) {
 
3051
                                GDateTime* _tmp15_;
 
3052
                                GDateTime* _tmp16_;
 
3053
                                GDateTime* _tmp17_ = NULL;
 
3054
                                GDateTime* _tmp18_;
 
3055
                                gboolean _tmp19_ = FALSE;
 
3056
                                _tmp15_ = self->priv->_birthday;
 
3057
                                _tmp16_ = d;
 
3058
                                _tmp17_ = g_date_time_to_utc (_tmp16_);
 
3059
                                _tmp18_ = _tmp17_;
 
3060
                                _tmp19_ = g_date_time_equal (_tmp15_, _tmp18_);
 
3061
                                _tmp13_ = !_tmp19_;
 
3062
                                _g_date_time_unref0 (_tmp18_);
 
3063
                        } else {
 
3064
                                _tmp13_ = FALSE;
 
3065
                        }
 
3066
                        _tmp20_ = _tmp13_;
 
3067
                        _tmp11_ = _tmp20_;
 
3068
                }
 
3069
                _tmp21_ = _tmp11_;
 
3070
                if (_tmp21_) {
 
3071
                        GDateTime* _tmp22_;
 
3072
                        GDateTime* _tmp23_ = NULL;
 
3073
                        _tmp22_ = d;
 
3074
                        _tmp23_ = g_date_time_to_utc (_tmp22_);
 
3075
                        _g_date_time_unref0 (self->priv->_birthday);
 
3076
                        self->priv->_birthday = _tmp23_;
 
3077
                        g_object_notify ((GObject*) self, "birthday");
 
3078
                }
 
3079
                _g_date_time_unref0 (d);
 
3080
        } else {
 
3081
                GDateTime* _tmp24_;
 
3082
                _tmp24_ = self->priv->_birthday;
 
3083
                if (_tmp24_ != NULL) {
 
3084
                        _g_date_time_unref0 (self->priv->_birthday);
 
3085
                        self->priv->_birthday = NULL;
 
3086
                        g_object_notify ((GObject*) self, "birthday");
 
3087
                }
 
3088
        }
 
3089
        __vala_EContactDate_free0 (bday);
 
3090
}
 
3091
 
 
3092
 
 
3093
static void _edsf_persona_update_roles (EdsfPersona* self) {
 
3094
        GeeHashSet* _tmp0_;
 
3095
        GeeHashSet* new_roles;
 
3096
        FolksRoleFieldDetails* _tmp1_ = NULL;
 
3097
        FolksRoleFieldDetails* default_role_fd;
 
3098
        FolksRoleFieldDetails* _tmp2_;
 
3099
        EContact* _tmp5_;
 
3100
        EVCard* _tmp6_;
 
3101
        EVCard* vcard;
 
3102
        EVCard* _tmp7_;
 
3103
        GList* _tmp8_ = NULL;
 
3104
        EdsfSetComparator* _tmp40_;
 
3105
        EdsfSetComparator* comp;
 
3106
        EdsfSetComparator* _tmp41_;
 
3107
        GeeHashSet* _tmp42_;
 
3108
        GeeHashSet* _tmp43_;
 
3109
        gboolean _tmp44_ = FALSE;
 
3110
        g_return_if_fail (self != NULL);
 
3111
        _tmp0_ = gee_hash_set_new (FOLKS_TYPE_ROLE_FIELD_DETAILS, (GBoxedCopyFunc) g_object_ref, g_object_unref, (GHashFunc) folks_abstract_field_details_hash, (GEqualFunc) folks_abstract_field_details_equal);
 
3112
        new_roles = _tmp0_;
 
3113
        _tmp1_ = _edsf_persona_get_default_role (self);
 
3114
        default_role_fd = _tmp1_;
 
3115
        _tmp2_ = default_role_fd;
 
3116
        if (_tmp2_ != NULL) {
 
3117
                GeeHashSet* _tmp3_;
 
3118
                FolksRoleFieldDetails* _tmp4_;
 
3119
                _tmp3_ = new_roles;
 
3120
                _tmp4_ = default_role_fd;
 
3121
                gee_abstract_collection_add ((GeeAbstractCollection*) _tmp3_, _tmp4_);
 
3122
        }
 
3123
        _tmp5_ = self->priv->_contact;
 
3124
        _tmp6_ = _g_object_ref0 (E_VCARD (_tmp5_));
 
3125
        vcard = _tmp6_;
 
3126
        _tmp7_ = vcard;
 
3127
        _tmp8_ = e_vcard_get_attributes (_tmp7_);
 
3128
        {
 
3129
                GList* attr_collection = NULL;
 
3130
                GList* attr_it = NULL;
 
3131
                attr_collection = _tmp8_;
 
3132
                for (attr_it = attr_collection; attr_it != NULL; attr_it = attr_it->next) {
 
3133
                        EVCardAttribute* attr = NULL;
 
3134
                        attr = (EVCardAttribute*) attr_it->data;
 
3135
                        {
 
3136
                                EVCardAttribute* _tmp9_;
 
3137
                                const gchar* _tmp10_ = NULL;
 
3138
                                FolksRole* _tmp11_;
 
3139
                                FolksRole* role;
 
3140
                                FolksRole* _tmp12_;
 
3141
                                EVCardAttribute* _tmp13_;
 
3142
                                gchar* _tmp14_ = NULL;
 
3143
                                gchar* _tmp15_;
 
3144
                                FolksRole* _tmp16_;
 
3145
                                FolksRoleFieldDetails* _tmp17_;
 
3146
                                FolksRoleFieldDetails* role_fd;
 
3147
                                EVCardAttribute* _tmp18_;
 
3148
                                GList* _tmp19_ = NULL;
 
3149
                                GeeHashSet* _tmp38_;
 
3150
                                FolksRoleFieldDetails* _tmp39_;
 
3151
                                _tmp9_ = attr;
 
3152
                                _tmp10_ = e_vcard_attribute_get_name (_tmp9_);
 
3153
                                if (g_strcmp0 (_tmp10_, "X-ROLES") != 0) {
 
3154
                                        continue;
 
3155
                                }
 
3156
                                _tmp11_ = folks_role_new ("", "", NULL);
 
3157
                                role = _tmp11_;
 
3158
                                _tmp12_ = role;
 
3159
                                _tmp13_ = attr;
 
3160
                                _tmp14_ = e_vcard_attribute_get_value (_tmp13_);
 
3161
                                _tmp15_ = _tmp14_;
 
3162
                                folks_role_set_role (_tmp12_, _tmp15_);
 
3163
                                _g_free0 (_tmp15_);
 
3164
                                _tmp16_ = role;
 
3165
                                _tmp17_ = folks_role_field_details_new (_tmp16_, NULL);
 
3166
                                role_fd = _tmp17_;
 
3167
                                _tmp18_ = attr;
 
3168
                                _tmp19_ = e_vcard_attribute_get_params (_tmp18_);
 
3169
                                {
 
3170
                                        GList* param_collection = NULL;
 
3171
                                        GList* param_it = NULL;
 
3172
                                        param_collection = _tmp19_;
 
3173
                                        for (param_it = param_collection; param_it != NULL; param_it = param_it->next) {
 
3174
                                                EVCardAttributeParam* param = NULL;
 
3175
                                                param = (EVCardAttributeParam*) param_it->data;
 
3176
                                                {
 
3177
                                                        EVCardAttributeParam* _tmp20_;
 
3178
                                                        const gchar* _tmp21_ = NULL;
 
3179
                                                        gchar* _tmp22_ = NULL;
 
3180
                                                        gchar* param_name;
 
3181
                                                        const gchar* _tmp23_;
 
3182
                                                        _tmp20_ = param;
 
3183
                                                        _tmp21_ = e_vcard_attribute_param_get_name (_tmp20_);
 
3184
                                                        _tmp22_ = g_utf8_strdown (_tmp21_, (gssize) (-1));
 
3185
                                                        param_name = _tmp22_;
 
3186
                                                        _tmp23_ = param_name;
 
3187
                                                        if (g_strcmp0 (_tmp23_, "organisation_name") == 0) {
 
3188
                                                                EVCardAttributeParam* _tmp24_;
 
3189
                                                                GList* _tmp25_ = NULL;
 
3190
                                                                _tmp24_ = param;
 
3191
                                                                _tmp25_ = e_vcard_attribute_param_get_values (_tmp24_);
 
3192
                                                                {
 
3193
                                                                        GList* param_value_collection = NULL;
 
3194
                                                                        GList* param_value_it = NULL;
 
3195
                                                                        param_value_collection = _tmp25_;
 
3196
                                                                        for (param_value_it = param_value_collection; param_value_it != NULL; param_value_it = param_value_it->next) {
 
3197
                                                                                const gchar* param_value = NULL;
 
3198
                                                                                param_value = (const gchar*) param_value_it->data;
 
3199
                                                                                {
 
3200
                                                                                        FolksRole* _tmp26_;
 
3201
                                                                                        const gchar* _tmp27_;
 
3202
                                                                                        _tmp26_ = role;
 
3203
                                                                                        _tmp27_ = param_value;
 
3204
                                                                                        folks_role_set_organisation_name (_tmp26_, _tmp27_);
 
3205
                                                                                        break;
 
3206
                                                                                }
 
3207
                                                                        }
 
3208
                                                                }
 
3209
                                                        } else {
 
3210
                                                                const gchar* _tmp28_;
 
3211
                                                                _tmp28_ = param_name;
 
3212
                                                                if (g_strcmp0 (_tmp28_, "title") == 0) {
 
3213
                                                                        EVCardAttributeParam* _tmp29_;
 
3214
                                                                        GList* _tmp30_ = NULL;
 
3215
                                                                        _tmp29_ = param;
 
3216
                                                                        _tmp30_ = e_vcard_attribute_param_get_values (_tmp29_);
 
3217
                                                                        {
 
3218
                                                                                GList* param_value_collection = NULL;
 
3219
                                                                                GList* param_value_it = NULL;
 
3220
                                                                                param_value_collection = _tmp30_;
 
3221
                                                                                for (param_value_it = param_value_collection; param_value_it != NULL; param_value_it = param_value_it->next) {
 
3222
                                                                                        const gchar* param_value = NULL;
 
3223
                                                                                        param_value = (const gchar*) param_value_it->data;
 
3224
                                                                                        {
 
3225
                                                                                                FolksRole* _tmp31_;
 
3226
                                                                                                const gchar* _tmp32_;
 
3227
                                                                                                _tmp31_ = role;
 
3228
                                                                                                _tmp32_ = param_value;
 
3229
                                                                                                folks_role_set_title (_tmp31_, _tmp32_);
 
3230
                                                                                                break;
 
3231
                                                                                        }
 
3232
                                                                                }
 
3233
                                                                        }
 
3234
                                                                } else {
 
3235
                                                                        EVCardAttributeParam* _tmp33_;
 
3236
                                                                        GList* _tmp34_ = NULL;
 
3237
                                                                        _tmp33_ = param;
 
3238
                                                                        _tmp34_ = e_vcard_attribute_param_get_values (_tmp33_);
 
3239
                                                                        {
 
3240
                                                                                GList* param_value_collection = NULL;
 
3241
                                                                                GList* param_value_it = NULL;
 
3242
                                                                                param_value_collection = _tmp34_;
 
3243
                                                                                for (param_value_it = param_value_collection; param_value_it != NULL; param_value_it = param_value_it->next) {
 
3244
                                                                                        const gchar* param_value = NULL;
 
3245
                                                                                        param_value = (const gchar*) param_value_it->data;
 
3246
                                                                                        {
 
3247
                                                                                                FolksRoleFieldDetails* _tmp35_;
 
3248
                                                                                                const gchar* _tmp36_;
 
3249
                                                                                                const gchar* _tmp37_;
 
3250
                                                                                                _tmp35_ = role_fd;
 
3251
                                                                                                _tmp36_ = param_name;
 
3252
                                                                                                _tmp37_ = param_value;
 
3253
                                                                                                folks_abstract_field_details_add_parameter ((FolksAbstractFieldDetails*) _tmp35_, _tmp36_, _tmp37_);
 
3254
                                                                                        }
 
3255
                                                                                }
 
3256
                                                                        }
 
3257
                                                                }
 
3258
                                                        }
 
3259
                                                        _g_free0 (param_name);
 
3260
                                                }
 
3261
                                        }
 
3262
                                }
 
3263
                                _tmp38_ = new_roles;
 
3264
                                _tmp39_ = role_fd;
 
3265
                                gee_abstract_collection_add ((GeeAbstractCollection*) _tmp38_, _tmp39_);
 
3266
                                _g_object_unref0 (role_fd);
 
3267
                                _g_object_unref0 (role);
 
3268
                        }
 
3269
                }
 
3270
        }
 
3271
        _tmp40_ = edsf_set_comparator_new (FOLKS_TYPE_ROLE_FIELD_DETAILS, (GBoxedCopyFunc) g_object_ref, g_object_unref);
 
3272
        comp = _tmp40_;
 
3273
        _tmp41_ = comp;
 
3274
        _tmp42_ = new_roles;
 
3275
        _tmp43_ = self->priv->_roles;
 
3276
        _tmp44_ = edsf_set_comparator_equal (_tmp41_, (GeeSet*) _tmp42_, (GeeSet*) _tmp43_);
 
3277
        if (!_tmp44_) {
 
3278
                GeeHashSet* _tmp45_;
 
3279
                GeeHashSet* _tmp46_;
 
3280
                GeeHashSet* _tmp47_;
 
3281
                GeeSet* _tmp48_;
 
3282
                GeeSet* _tmp49_;
 
3283
                _tmp45_ = new_roles;
 
3284
                _tmp46_ = _g_object_ref0 (_tmp45_);
 
3285
                _g_object_unref0 (self->priv->_roles);
 
3286
                self->priv->_roles = _tmp46_;
 
3287
                _tmp47_ = new_roles;
 
3288
                _tmp48_ = gee_abstract_set_get_read_only_view ((GeeAbstractSet*) _tmp47_);
 
3289
                _tmp49_ = _tmp48_;
 
3290
                _g_object_unref0 (self->priv->_roles_ro);
 
3291
                self->priv->_roles_ro = _tmp49_;
 
3292
                g_object_notify ((GObject*) self, "roles");
 
3293
        }
 
3294
        _g_object_unref0 (comp);
 
3295
        _g_object_unref0 (vcard);
 
3296
        _g_object_unref0 (default_role_fd);
 
3297
        _g_object_unref0 (new_roles);
 
3298
}
 
3299
 
 
3300
 
 
3301
static FolksRoleFieldDetails* _edsf_persona_get_default_role (EdsfPersona* self) {
 
3302
        FolksRoleFieldDetails* result = NULL;
 
3303
        FolksRoleFieldDetails* default_role;
 
3304
        void* _tmp0_ = NULL;
 
3305
        gchar* _tmp1_;
 
3306
        gchar* org;
 
3307
        void* _tmp2_ = NULL;
 
3308
        gchar* _tmp3_;
 
3309
        gchar* org_unit;
 
3310
        void* _tmp4_ = NULL;
 
3311
        gchar* _tmp5_;
 
3312
        gchar* office;
 
3313
        void* _tmp6_ = NULL;
 
3314
        gchar* _tmp7_;
 
3315
        gchar* title;
 
3316
        void* _tmp8_ = NULL;
 
3317
        gchar* _tmp9_;
 
3318
        gchar* role;
 
3319
        void* _tmp10_ = NULL;
 
3320
        gchar* _tmp11_;
 
3321
        gchar* manager;
 
3322
        void* _tmp12_ = NULL;
 
3323
        gchar* _tmp13_;
 
3324
        gchar* assistant;
 
3325
        gboolean _tmp14_ = FALSE;
 
3326
        gboolean _tmp15_ = FALSE;
 
3327
        gboolean _tmp16_ = FALSE;
 
3328
        gboolean _tmp17_ = FALSE;
 
3329
        gboolean _tmp18_ = FALSE;
 
3330
        gboolean _tmp19_ = FALSE;
 
3331
        const gchar* _tmp20_;
 
3332
        gboolean _tmp22_;
 
3333
        gboolean _tmp24_;
 
3334
        gboolean _tmp26_;
 
3335
        gboolean _tmp28_;
 
3336
        gboolean _tmp30_;
 
3337
        gboolean _tmp32_;
 
3338
        g_return_val_if_fail (self != NULL, NULL);
 
3339
        default_role = NULL;
 
3340
        _tmp0_ = _edsf_persona_get_property (self, "org");
 
3341
        _tmp1_ = g_strdup ((const gchar*) _tmp0_);
 
3342
        org = _tmp1_;
 
3343
        _tmp2_ = _edsf_persona_get_property (self, "org_unit");
 
3344
        _tmp3_ = g_strdup ((const gchar*) _tmp2_);
 
3345
        org_unit = _tmp3_;
 
3346
        _tmp4_ = _edsf_persona_get_property (self, "office");
 
3347
        _tmp5_ = g_strdup ((const gchar*) _tmp4_);
 
3348
        office = _tmp5_;
 
3349
        _tmp6_ = _edsf_persona_get_property (self, "title");
 
3350
        _tmp7_ = g_strdup ((const gchar*) _tmp6_);
 
3351
        title = _tmp7_;
 
3352
        _tmp8_ = _edsf_persona_get_property (self, "role");
 
3353
        _tmp9_ = g_strdup ((const gchar*) _tmp8_);
 
3354
        role = _tmp9_;
 
3355
        _tmp10_ = _edsf_persona_get_property (self, "manager");
 
3356
        _tmp11_ = g_strdup ((const gchar*) _tmp10_);
 
3357
        manager = _tmp11_;
 
3358
        _tmp12_ = _edsf_persona_get_property (self, "assistant");
 
3359
        _tmp13_ = g_strdup ((const gchar*) _tmp12_);
 
3360
        assistant = _tmp13_;
 
3361
        _tmp20_ = org;
 
3362
        if (_tmp20_ != NULL) {
 
3363
                _tmp19_ = TRUE;
 
3364
        } else {
 
3365
                const gchar* _tmp21_;
 
3366
                _tmp21_ = org_unit;
 
3367
                _tmp19_ = _tmp21_ != NULL;
 
3368
        }
 
3369
        _tmp22_ = _tmp19_;
 
3370
        if (_tmp22_) {
 
3371
                _tmp18_ = TRUE;
 
3372
        } else {
 
3373
                const gchar* _tmp23_;
 
3374
                _tmp23_ = office;
 
3375
                _tmp18_ = _tmp23_ != NULL;
 
3376
        }
 
3377
        _tmp24_ = _tmp18_;
 
3378
        if (_tmp24_) {
 
3379
                _tmp17_ = TRUE;
 
3380
        } else {
 
3381
                const gchar* _tmp25_;
 
3382
                _tmp25_ = title;
 
3383
                _tmp17_ = _tmp25_ != NULL;
 
3384
        }
 
3385
        _tmp26_ = _tmp17_;
 
3386
        if (_tmp26_) {
 
3387
                _tmp16_ = TRUE;
 
3388
        } else {
 
3389
                const gchar* _tmp27_;
 
3390
                _tmp27_ = role;
 
3391
                _tmp16_ = _tmp27_ != NULL;
 
3392
        }
 
3393
        _tmp28_ = _tmp16_;
 
3394
        if (_tmp28_) {
 
3395
                _tmp15_ = TRUE;
 
3396
        } else {
 
3397
                const gchar* _tmp29_;
 
3398
                _tmp29_ = manager;
 
3399
                _tmp15_ = _tmp29_ != NULL;
 
3400
        }
 
3401
        _tmp30_ = _tmp15_;
 
3402
        if (_tmp30_) {
 
3403
                _tmp14_ = TRUE;
 
3404
        } else {
 
3405
                const gchar* _tmp31_;
 
3406
                _tmp31_ = assistant;
 
3407
                _tmp14_ = _tmp31_ != NULL;
 
3408
        }
 
3409
        _tmp32_ = _tmp14_;
 
3410
        if (_tmp32_) {
 
3411
                const gchar* _tmp33_;
 
3412
                const gchar* _tmp34_;
 
3413
                FolksRole* _tmp35_;
 
3414
                FolksRole* new_role;
 
3415
                const gchar* _tmp36_;
 
3416
                FolksRole* _tmp39_;
 
3417
                FolksRoleFieldDetails* _tmp40_;
 
3418
                const gchar* _tmp41_;
 
3419
                const gchar* _tmp44_;
 
3420
                const gchar* _tmp47_;
 
3421
                const gchar* _tmp50_;
 
3422
                _tmp33_ = title;
 
3423
                _tmp34_ = org;
 
3424
                _tmp35_ = folks_role_new (_tmp33_, _tmp34_, NULL);
 
3425
                new_role = _tmp35_;
 
3426
                _tmp36_ = role;
 
3427
                if (_tmp36_ != NULL) {
 
3428
                        FolksRole* _tmp37_;
 
3429
                        const gchar* _tmp38_;
 
3430
                        _tmp37_ = new_role;
 
3431
                        _tmp38_ = role;
 
3432
                        folks_role_set_role (_tmp37_, _tmp38_);
 
3433
                }
 
3434
                _tmp39_ = new_role;
 
3435
                _tmp40_ = folks_role_field_details_new (_tmp39_, NULL);
 
3436
                _g_object_unref0 (default_role);
 
3437
                default_role = _tmp40_;
 
3438
                _tmp41_ = org_unit;
 
3439
                if (_tmp41_ != NULL) {
 
3440
                        FolksRoleFieldDetails* _tmp42_;
 
3441
                        const gchar* _tmp43_;
 
3442
                        _tmp42_ = default_role;
 
3443
                        _tmp43_ = org_unit;
 
3444
                        folks_abstract_field_details_set_parameter ((FolksAbstractFieldDetails*) _tmp42_, "org_unit", _tmp43_);
 
3445
                }
 
3446
                _tmp44_ = office;
 
3447
                if (_tmp44_ != NULL) {
 
3448
                        FolksRoleFieldDetails* _tmp45_;
 
3449
                        const gchar* _tmp46_;
 
3450
                        _tmp45_ = default_role;
 
3451
                        _tmp46_ = office;
 
3452
                        folks_abstract_field_details_set_parameter ((FolksAbstractFieldDetails*) _tmp45_, "office", _tmp46_);
 
3453
                }
 
3454
                _tmp47_ = manager;
 
3455
                if (_tmp47_ != NULL) {
 
3456
                        FolksRoleFieldDetails* _tmp48_;
 
3457
                        const gchar* _tmp49_;
 
3458
                        _tmp48_ = default_role;
 
3459
                        _tmp49_ = manager;
 
3460
                        folks_abstract_field_details_set_parameter ((FolksAbstractFieldDetails*) _tmp48_, "manager", _tmp49_);
 
3461
                }
 
3462
                _tmp50_ = assistant;
 
3463
                if (_tmp50_ != NULL) {
 
3464
                        FolksRoleFieldDetails* _tmp51_;
 
3465
                        const gchar* _tmp52_;
 
3466
                        _tmp51_ = default_role;
 
3467
                        _tmp52_ = assistant;
 
3468
                        folks_abstract_field_details_set_parameter ((FolksAbstractFieldDetails*) _tmp51_, "assistant", _tmp52_);
 
3469
                }
 
3470
                _g_object_unref0 (new_role);
 
3471
        }
 
3472
        result = default_role;
 
3473
        _g_free0 (assistant);
 
3474
        _g_free0 (manager);
 
3475
        _g_free0 (role);
 
3476
        _g_free0 (title);
 
3477
        _g_free0 (office);
 
3478
        _g_free0 (org_unit);
 
3479
        _g_free0 (org);
 
3480
        return result;
 
3481
}
 
3482
 
 
3483
 
 
3484
static EVCardAttributeParam* _vala_EVCardAttributeParam_copy (EVCardAttributeParam* self) {
 
3485
        return g_boxed_copy (e_vcard_attribute_param_get_type (), self);
 
3486
}
 
3487
 
 
3488
 
 
3489
static gpointer __vala_EVCardAttributeParam_copy0 (gpointer self) {
 
3490
        return self ? _vala_EVCardAttributeParam_copy (self) : NULL;
 
3491
}
 
3492
 
 
3493
 
 
3494
static void _vala_EVCardAttributeParam_free (EVCardAttributeParam* self) {
 
3495
        g_boxed_free (e_vcard_attribute_param_get_type (), self);
 
3496
}
 
3497
 
 
3498
 
 
3499
static void _edsf_persona_update_web_services_addresses (EdsfPersona* self) {
 
3500
        GeeHashMultiMap* _tmp0_;
 
3501
        GeeHashMultiMap* new_services;
 
3502
        EContact* _tmp1_;
 
3503
        EVCardAttribute* _tmp2_ = NULL;
 
3504
        EVCardAttribute* _tmp3_;
 
3505
        EVCardAttribute* services;
 
3506
        EVCardAttribute* _tmp4_;
 
3507
        GeeHashMultiMap* _tmp20_;
 
3508
        GeeHashMultiMap* _tmp21_;
 
3509
        gboolean _tmp22_ = FALSE;
 
3510
        g_return_if_fail (self != NULL);
 
3511
        _tmp0_ = gee_hash_multi_map_new (G_TYPE_STRING, (GBoxedCopyFunc) g_strdup, g_free, FOLKS_TYPE_WEB_SERVICE_FIELD_DETAILS, (GBoxedCopyFunc) g_object_ref, g_object_unref, NULL, NULL, (GHashFunc) folks_abstract_field_details_hash, (GEqualFunc) folks_abstract_field_details_equal);
 
3512
        new_services = _tmp0_;
 
3513
        _tmp1_ = self->priv->_contact;
 
3514
        _tmp2_ = e_vcard_get_attribute ((EVCard*) _tmp1_, "X-FOLKS-WEB-SERVICES-IDS");
 
3515
        _tmp3_ = __vala_EVCardAttribute_copy0 (_tmp2_);
 
3516
        services = _tmp3_;
 
3517
        _tmp4_ = services;
 
3518
        if (_tmp4_ != NULL) {
 
3519
                EVCardAttribute* _tmp5_;
 
3520
                GList* _tmp6_ = NULL;
 
3521
                _tmp5_ = services;
 
3522
                _tmp6_ = e_vcard_attribute_get_params (_tmp5_);
 
3523
                {
 
3524
                        GList* service_collection = NULL;
 
3525
                        GList* service_it = NULL;
 
3526
                        service_collection = _tmp6_;
 
3527
                        for (service_it = service_collection; service_it != NULL; service_it = service_it->next) {
 
3528
                                EVCardAttributeParam* _tmp7_;
 
3529
                                EVCardAttributeParam* service = NULL;
 
3530
                                _tmp7_ = __vala_EVCardAttributeParam_copy0 ((EVCardAttributeParam*) service_it->data);
 
3531
                                service = _tmp7_;
 
3532
                                {
 
3533
                                        EVCardAttributeParam* _tmp8_;
 
3534
                                        const gchar* _tmp9_ = NULL;
 
3535
                                        gchar* _tmp10_ = NULL;
 
3536
                                        gchar* service_name;
 
3537
                                        EVCardAttributeParam* _tmp11_;
 
3538
                                        GList* _tmp12_ = NULL;
 
3539
                                        _tmp8_ = service;
 
3540
                                        _tmp9_ = e_vcard_attribute_param_get_name (_tmp8_);
 
3541
                                        _tmp10_ = g_utf8_strdown (_tmp9_, (gssize) (-1));
 
3542
                                        service_name = _tmp10_;
 
3543
                                        _tmp11_ = service;
 
3544
                                        _tmp12_ = e_vcard_attribute_param_get_values (_tmp11_);
 
3545
                                        {
 
3546
                                                GList* service_id_collection = NULL;
 
3547
                                                GList* service_id_it = NULL;
 
3548
                                                service_id_collection = _tmp12_;
 
3549
                                                for (service_id_it = service_id_collection; service_id_it != NULL; service_id_it = service_id_it->next) {
 
3550
                                                        gchar* _tmp13_;
 
3551
                                                        gchar* service_id = NULL;
 
3552
                                                        _tmp13_ = g_strdup ((const gchar*) service_id_it->data);
 
3553
                                                        service_id = _tmp13_;
 
3554
                                                        {
 
3555
                                                                const gchar* _tmp14_;
 
3556
                                                                GeeHashMultiMap* _tmp15_;
 
3557
                                                                const gchar* _tmp16_;
 
3558
                                                                const gchar* _tmp17_;
 
3559
                                                                FolksWebServiceFieldDetails* _tmp18_;
 
3560
                                                                FolksWebServiceFieldDetails* _tmp19_;
 
3561
                                                                _tmp14_ = service_id;
 
3562
                                                                if (_tmp14_ == NULL) {
 
3563
                                                                        _g_free0 (service_id);
 
3564
                                                                        continue;
 
3565
                                                                }
 
3566
                                                                _tmp15_ = new_services;
 
3567
                                                                _tmp16_ = service_name;
 
3568
                                                                _tmp17_ = service_id;
 
3569
                                                                _tmp18_ = folks_web_service_field_details_new (_tmp17_, NULL);
 
3570
                                                                _tmp19_ = _tmp18_;
 
3571
                                                                gee_multi_map_set ((GeeMultiMap*) _tmp15_, _tmp16_, _tmp19_);
 
3572
                                                                _g_object_unref0 (_tmp19_);
 
3573
                                                                _g_free0 (service_id);
 
3574
                                                        }
 
3575
                                                }
 
3576
                                        }
 
3577
                                        _g_free0 (service_name);
 
3578
                                        __vala_EVCardAttributeParam_free0 (service);
 
3579
                                }
 
3580
                        }
 
3581
                }
 
3582
        }
 
3583
        _tmp20_ = new_services;
 
3584
        _tmp21_ = self->priv->_web_service_addresses;
 
3585
        _tmp22_ = folks_utils_multi_map_str_afd_equal ((GeeMultiMap*) _tmp20_, (GeeMultiMap*) _tmp21_);
 
3586
        if (!_tmp22_) {
 
3587
                GeeHashMultiMap* _tmp23_;
 
3588
                GeeHashMultiMap* _tmp24_;
 
3589
                _tmp23_ = new_services;
 
3590
                _tmp24_ = _g_object_ref0 (_tmp23_);
 
3591
                _g_object_unref0 (self->priv->_web_service_addresses);
 
3592
                self->priv->_web_service_addresses = _tmp24_;
 
3593
                g_object_notify ((GObject*) self, "web-service-addresses");
 
3594
        }
 
3595
        __vala_EVCardAttribute_free0 (services);
 
3596
        _g_object_unref0 (new_services);
 
3597
}
 
3598
 
 
3599
 
 
3600
static void __vala_EVCardAttribute_free0_ (gpointer var) {
 
3601
        (var == NULL) ? NULL : (var = (_vala_EVCardAttribute_free (var), NULL));
 
3602
}
 
3603
 
 
3604
 
 
3605
static void _g_list_free___vala_EVCardAttribute_free0_ (GList* self) {
 
3606
        g_list_foreach (self, (GFunc) __vala_EVCardAttribute_free0_, NULL);
 
3607
        g_list_free (self);
 
3608
}
 
3609
 
 
3610
 
 
3611
static void _edsf_persona_update_emails (EdsfPersona* self) {
 
3612
        GeeHashSet* _tmp0_;
 
3613
        GeeHashSet* new_email_addresses;
 
3614
        EContact* _tmp1_;
 
3615
        GList* _tmp2_ = NULL;
 
3616
        GList* attrs;
 
3617
        GList* _tmp3_;
 
3618
        EdsfSetComparator* _tmp14_;
 
3619
        EdsfSetComparator* comp;
 
3620
        EdsfSetComparator* _tmp15_;
 
3621
        GeeHashSet* _tmp16_;
 
3622
        GeeHashSet* _tmp17_;
 
3623
        gboolean _tmp18_ = FALSE;
 
3624
        g_return_if_fail (self != NULL);
 
3625
        _tmp0_ = gee_hash_set_new (FOLKS_TYPE_EMAIL_FIELD_DETAILS, (GBoxedCopyFunc) g_object_ref, g_object_unref, (GHashFunc) folks_abstract_field_details_hash, (GEqualFunc) folks_abstract_field_details_equal);
 
3626
        new_email_addresses = _tmp0_;
 
3627
        _tmp1_ = self->priv->_contact;
 
3628
        _tmp2_ = e_contact_get_attributes (_tmp1_, E_CONTACT_EMAIL);
 
3629
        attrs = _tmp2_;
 
3630
        _tmp3_ = attrs;
 
3631
        {
 
3632
                GList* attr_collection = NULL;
 
3633
                GList* attr_it = NULL;
 
3634
                attr_collection = _tmp3_;
 
3635
                for (attr_it = attr_collection; attr_it != NULL; attr_it = attr_it->next) {
 
3636
                        EVCardAttribute* _tmp4_;
 
3637
                        EVCardAttribute* attr = NULL;
 
3638
                        _tmp4_ = __vala_EVCardAttribute_copy0 ((EVCardAttribute*) attr_it->data);
 
3639
                        attr = _tmp4_;
 
3640
                        {
 
3641
                                EVCardAttribute* _tmp5_;
 
3642
                                gchar* _tmp6_ = NULL;
 
3643
                                gchar* _tmp7_;
 
3644
                                FolksEmailFieldDetails* _tmp8_;
 
3645
                                FolksEmailFieldDetails* _tmp9_;
 
3646
                                FolksEmailFieldDetails* email_fd;
 
3647
                                FolksEmailFieldDetails* _tmp10_;
 
3648
                                EVCardAttribute* _tmp11_;
 
3649
                                GeeHashSet* _tmp12_;
 
3650
                                FolksEmailFieldDetails* _tmp13_;
 
3651
                                _tmp5_ = attr;
 
3652
                                _tmp6_ = e_vcard_attribute_get_value (_tmp5_);
 
3653
                                _tmp7_ = _tmp6_;
 
3654
                                _tmp8_ = folks_email_field_details_new (_tmp7_, NULL);
 
3655
                                _tmp9_ = _tmp8_;
 
3656
                                _g_free0 (_tmp7_);
 
3657
                                email_fd = _tmp9_;
 
3658
                                _tmp10_ = email_fd;
 
3659
                                _tmp11_ = attr;
 
3660
                                _edsf_persona_update_params (self, (FolksAbstractFieldDetails*) _tmp10_, _tmp11_);
 
3661
                                _tmp12_ = new_email_addresses;
 
3662
                                _tmp13_ = email_fd;
 
3663
                                gee_abstract_collection_add ((GeeAbstractCollection*) _tmp12_, _tmp13_);
 
3664
                                _g_object_unref0 (email_fd);
 
3665
                                __vala_EVCardAttribute_free0 (attr);
 
3666
                        }
 
3667
                }
 
3668
        }
 
3669
        _tmp14_ = edsf_set_comparator_new (FOLKS_TYPE_EMAIL_FIELD_DETAILS, (GBoxedCopyFunc) g_object_ref, g_object_unref);
 
3670
        comp = _tmp14_;
 
3671
        _tmp15_ = comp;
 
3672
        _tmp16_ = new_email_addresses;
 
3673
        _tmp17_ = self->priv->_email_addresses;
 
3674
        _tmp18_ = edsf_set_comparator_equal (_tmp15_, (GeeSet*) _tmp16_, (GeeSet*) _tmp17_);
 
3675
        if (!_tmp18_) {
 
3676
                GeeHashSet* _tmp19_;
 
3677
                GeeHashSet* _tmp20_;
 
3678
                GeeHashSet* _tmp21_;
 
3679
                GeeSet* _tmp22_;
 
3680
                GeeSet* _tmp23_;
 
3681
                _tmp19_ = new_email_addresses;
 
3682
                _tmp20_ = _g_object_ref0 (_tmp19_);
 
3683
                _g_object_unref0 (self->priv->_email_addresses);
 
3684
                self->priv->_email_addresses = _tmp20_;
 
3685
                _tmp21_ = new_email_addresses;
 
3686
                _tmp22_ = gee_abstract_set_get_read_only_view ((GeeAbstractSet*) _tmp21_);
 
3687
                _tmp23_ = _tmp22_;
 
3688
                _g_object_unref0 (self->priv->_email_addresses_ro);
 
3689
                self->priv->_email_addresses_ro = _tmp23_;
 
3690
                g_object_notify ((GObject*) self, "email-addresses");
 
3691
        }
 
3692
        _g_object_unref0 (comp);
 
3693
        __g_list_free___vala_EVCardAttribute_free0_0 (attrs);
 
3694
        _g_object_unref0 (new_email_addresses);
 
3695
}
 
3696
 
 
3697
 
 
3698
static void _edsf_persona_update_notes (EdsfPersona* self) {
 
3699
        GeeHashSet* _tmp0_;
 
3700
        GeeHashSet* new_notes;
 
3701
        void* _tmp1_ = NULL;
 
3702
        gchar* _tmp2_;
 
3703
        gchar* n;
 
3704
        gboolean _tmp3_ = FALSE;
 
3705
        const gchar* _tmp4_;
 
3706
        gboolean _tmp6_;
 
3707
        EdsfSetComparator* _tmp11_;
 
3708
        EdsfSetComparator* comp;
 
3709
        EdsfSetComparator* _tmp12_;
 
3710
        GeeHashSet* _tmp13_;
 
3711
        GeeHashSet* _tmp14_;
 
3712
        gboolean _tmp15_ = FALSE;
 
3713
        g_return_if_fail (self != NULL);
 
3714
        _tmp0_ = gee_hash_set_new (FOLKS_TYPE_NOTE_FIELD_DETAILS, (GBoxedCopyFunc) g_object_ref, g_object_unref, (GHashFunc) folks_abstract_field_details_hash, (GEqualFunc) folks_abstract_field_details_equal);
 
3715
        new_notes = _tmp0_;
 
3716
        _tmp1_ = _edsf_persona_get_property (self, "note");
 
3717
        _tmp2_ = g_strdup ((const gchar*) _tmp1_);
 
3718
        n = _tmp2_;
 
3719
        _tmp4_ = n;
 
3720
        if (_tmp4_ != NULL) {
 
3721
                const gchar* _tmp5_;
 
3722
                _tmp5_ = n;
 
3723
                _tmp3_ = g_strcmp0 (_tmp5_, "") != 0;
 
3724
        } else {
 
3725
                _tmp3_ = FALSE;
 
3726
        }
 
3727
        _tmp6_ = _tmp3_;
 
3728
        if (_tmp6_) {
 
3729
                const gchar* _tmp7_;
 
3730
                FolksNoteFieldDetails* _tmp8_;
 
3731
                FolksNoteFieldDetails* note;
 
3732
                GeeHashSet* _tmp9_;
 
3733
                FolksNoteFieldDetails* _tmp10_;
 
3734
                _tmp7_ = n;
 
3735
                _tmp8_ = folks_note_field_details_new (_tmp7_, NULL, NULL);
 
3736
                note = _tmp8_;
 
3737
                _tmp9_ = new_notes;
 
3738
                _tmp10_ = note;
 
3739
                gee_abstract_collection_add ((GeeAbstractCollection*) _tmp9_, _tmp10_);
 
3740
                _g_object_unref0 (note);
 
3741
        }
 
3742
        _tmp11_ = edsf_set_comparator_new (FOLKS_TYPE_NOTE_FIELD_DETAILS, (GBoxedCopyFunc) g_object_ref, g_object_unref);
 
3743
        comp = _tmp11_;
 
3744
        _tmp12_ = comp;
 
3745
        _tmp13_ = new_notes;
 
3746
        _tmp14_ = self->priv->_notes;
 
3747
        _tmp15_ = edsf_set_comparator_equal (_tmp12_, (GeeSet*) _tmp13_, (GeeSet*) _tmp14_);
 
3748
        if (!_tmp15_) {
 
3749
                GeeHashSet* _tmp16_;
 
3750
                GeeHashSet* _tmp17_;
 
3751
                GeeHashSet* _tmp18_;
 
3752
                GeeSet* _tmp19_;
 
3753
                GeeSet* _tmp20_;
 
3754
                _tmp16_ = new_notes;
 
3755
                _tmp17_ = _g_object_ref0 (_tmp16_);
 
3756
                _g_object_unref0 (self->priv->_notes);
 
3757
                self->priv->_notes = _tmp17_;
 
3758
                _tmp18_ = self->priv->_notes;
 
3759
                _tmp19_ = gee_abstract_set_get_read_only_view ((GeeAbstractSet*) _tmp18_);
 
3760
                _tmp20_ = _tmp19_;
 
3761
                _g_object_unref0 (self->priv->_notes_ro);
 
3762
                self->priv->_notes_ro = _tmp20_;
 
3763
                g_object_notify ((GObject*) self, "notes");
 
3764
        }
 
3765
        _g_object_unref0 (comp);
 
3766
        _g_free0 (n);
 
3767
        _g_object_unref0 (new_notes);
 
3768
}
 
3769
 
 
3770
 
 
3771
static EContactName* _vala_EContactName_copy (EContactName* self) {
 
3772
        return g_boxed_copy (e_contact_name_get_type (), self);
 
3773
}
 
3774
 
 
3775
 
 
3776
static gpointer __vala_EContactName_copy0 (gpointer self) {
 
3777
        return self ? _vala_EContactName_copy (self) : NULL;
 
3778
}
 
3779
 
 
3780
 
 
3781
static void _vala_EContactName_free (EContactName* self) {
 
3782
        g_boxed_free (e_contact_name_get_type (), self);
 
3783
}
 
3784
 
 
3785
 
 
3786
static void _edsf_persona_update_names (EdsfPersona* self) {
 
3787
        void* _tmp0_ = NULL;
 
3788
        gchar* _tmp1_;
 
3789
        gchar* full_name;
 
3790
        const gchar* _tmp2_;
 
3791
        const gchar* _tmp4_;
 
3792
        const gchar* _tmp5_;
 
3793
        void* _tmp8_ = NULL;
 
3794
        gchar* _tmp9_;
 
3795
        gchar* nickname;
 
3796
        const gchar* _tmp10_;
 
3797
        const gchar* _tmp12_;
 
3798
        const gchar* _tmp13_;
 
3799
        FolksStructuredName* structured_name;
 
3800
        void* _tmp16_ = NULL;
 
3801
        EContactName* _tmp17_;
 
3802
        EContactName* cn;
 
3803
        EContactName* _tmp18_;
 
3804
        gboolean _tmp40_ = FALSE;
 
3805
        FolksStructuredName* _tmp41_;
 
3806
        gboolean _tmp44_;
 
3807
        g_return_if_fail (self != NULL);
 
3808
        _tmp0_ = _edsf_persona_get_property (self, "full_name");
 
3809
        _tmp1_ = g_strdup ((const gchar*) _tmp0_);
 
3810
        full_name = _tmp1_;
 
3811
        _tmp2_ = full_name;
 
3812
        if (_tmp2_ == NULL) {
 
3813
                gchar* _tmp3_;
 
3814
                _tmp3_ = g_strdup ("");
 
3815
                _g_free0 (full_name);
 
3816
                full_name = _tmp3_;
 
3817
        }
 
3818
        _tmp4_ = self->priv->_full_name;
 
3819
        _tmp5_ = full_name;
 
3820
        if (g_strcmp0 (_tmp4_, _tmp5_) != 0) {
 
3821
                const gchar* _tmp6_;
 
3822
                gchar* _tmp7_;
 
3823
                _tmp6_ = full_name;
 
3824
                _tmp7_ = g_strdup (_tmp6_);
 
3825
                _g_free0 (self->priv->_full_name);
 
3826
                self->priv->_full_name = _tmp7_;
 
3827
                g_object_notify ((GObject*) self, "full-name");
 
3828
        }
 
3829
        _tmp8_ = _edsf_persona_get_property (self, "nickname");
 
3830
        _tmp9_ = g_strdup ((const gchar*) _tmp8_);
 
3831
        nickname = _tmp9_;
 
3832
        _tmp10_ = nickname;
 
3833
        if (_tmp10_ == NULL) {
 
3834
                gchar* _tmp11_;
 
3835
                _tmp11_ = g_strdup ("");
 
3836
                _g_free0 (nickname);
 
3837
                nickname = _tmp11_;
 
3838
        }
 
3839
        _tmp12_ = self->priv->_nickname;
 
3840
        _tmp13_ = nickname;
 
3841
        if (g_strcmp0 (_tmp12_, _tmp13_) != 0) {
 
3842
                const gchar* _tmp14_;
 
3843
                gchar* _tmp15_;
 
3844
                _tmp14_ = nickname;
 
3845
                _tmp15_ = g_strdup (_tmp14_);
 
3846
                _g_free0 (self->priv->_nickname);
 
3847
                self->priv->_nickname = _tmp15_;
 
3848
                g_object_notify ((GObject*) self, "nickname");
 
3849
        }
 
3850
        structured_name = NULL;
 
3851
        _tmp16_ = _edsf_persona_get_property (self, "name");
 
3852
        _tmp17_ = __vala_EContactName_copy0 ((EContactName*) _tmp16_);
 
3853
        cn = _tmp17_;
 
3854
        _tmp18_ = cn;
 
3855
        if (_tmp18_ != NULL) {
 
3856
                EContactName* _tmp19_;
 
3857
                const gchar* _tmp20_;
 
3858
                gchar* _tmp21_;
 
3859
                gchar* family_name;
 
3860
                EContactName* _tmp22_;
 
3861
                const gchar* _tmp23_;
 
3862
                gchar* _tmp24_;
 
3863
                gchar* given_name;
 
3864
                EContactName* _tmp25_;
 
3865
                const gchar* _tmp26_;
 
3866
                gchar* _tmp27_;
 
3867
                gchar* additional_names;
 
3868
                EContactName* _tmp28_;
 
3869
                const gchar* _tmp29_;
 
3870
                gchar* _tmp30_;
 
3871
                gchar* prefixes;
 
3872
                EContactName* _tmp31_;
 
3873
                const gchar* _tmp32_;
 
3874
                gchar* _tmp33_;
 
3875
                gchar* suffixes;
 
3876
                const gchar* _tmp34_;
 
3877
                const gchar* _tmp35_;
 
3878
                const gchar* _tmp36_;
 
3879
                const gchar* _tmp37_;
 
3880
                const gchar* _tmp38_;
 
3881
                FolksStructuredName* _tmp39_;
 
3882
                _tmp19_ = cn;
 
3883
                _tmp20_ = _tmp19_->family;
 
3884
                _tmp21_ = g_strdup (_tmp20_);
 
3885
                family_name = _tmp21_;
 
3886
                _tmp22_ = cn;
 
3887
                _tmp23_ = _tmp22_->given;
 
3888
                _tmp24_ = g_strdup (_tmp23_);
 
3889
                given_name = _tmp24_;
 
3890
                _tmp25_ = cn;
 
3891
                _tmp26_ = _tmp25_->additional;
 
3892
                _tmp27_ = g_strdup (_tmp26_);
 
3893
                additional_names = _tmp27_;
 
3894
                _tmp28_ = cn;
 
3895
                _tmp29_ = _tmp28_->prefixes;
 
3896
                _tmp30_ = g_strdup (_tmp29_);
 
3897
                prefixes = _tmp30_;
 
3898
                _tmp31_ = cn;
 
3899
                _tmp32_ = _tmp31_->suffixes;
 
3900
                _tmp33_ = g_strdup (_tmp32_);
 
3901
                suffixes = _tmp33_;
 
3902
                _tmp34_ = family_name;
 
3903
                _tmp35_ = given_name;
 
3904
                _tmp36_ = additional_names;
 
3905
                _tmp37_ = prefixes;
 
3906
                _tmp38_ = suffixes;
 
3907
                _tmp39_ = folks_structured_name_new (_tmp34_, _tmp35_, _tmp36_, _tmp37_, _tmp38_);
 
3908
                _g_object_unref0 (structured_name);
 
3909
                structured_name = _tmp39_;
 
3910
                _g_free0 (suffixes);
 
3911
                _g_free0 (prefixes);
 
3912
                _g_free0 (additional_names);
 
3913
                _g_free0 (given_name);
 
3914
                _g_free0 (family_name);
 
3915
        }
 
3916
        _tmp41_ = structured_name;
 
3917
        if (_tmp41_ != NULL) {
 
3918
                FolksStructuredName* _tmp42_;
 
3919
                gboolean _tmp43_ = FALSE;
 
3920
                _tmp42_ = structured_name;
 
3921
                _tmp43_ = folks_structured_name_is_empty (_tmp42_);
 
3922
                _tmp40_ = !_tmp43_;
 
3923
        } else {
 
3924
                _tmp40_ = FALSE;
 
3925
        }
 
3926
        _tmp44_ = _tmp40_;
 
3927
        if (_tmp44_) {
 
3928
                FolksStructuredName* _tmp45_;
 
3929
                FolksStructuredName* _tmp46_;
 
3930
                _tmp45_ = structured_name;
 
3931
                _tmp46_ = _g_object_ref0 (_tmp45_);
 
3932
                _g_object_unref0 (self->priv->_structured_name);
 
3933
                self->priv->_structured_name = _tmp46_;
 
3934
                g_object_notify ((GObject*) self, "structured-name");
 
3935
        } else {
 
3936
                FolksStructuredName* _tmp47_;
 
3937
                _tmp47_ = self->priv->_structured_name;
 
3938
                if (_tmp47_ != NULL) {
 
3939
                        _g_object_unref0 (self->priv->_structured_name);
 
3940
                        self->priv->_structured_name = NULL;
 
3941
                        g_object_notify ((GObject*) self, "structured-name");
 
3942
                }
 
3943
        }
 
3944
        __vala_EContactName_free0 (cn);
 
3945
        _g_object_unref0 (structured_name);
 
3946
        _g_free0 (nickname);
 
3947
        _g_free0 (full_name);
 
3948
}
 
3949
 
 
3950
 
 
3951
static GLoadableIcon* _edsf_persona_contact_photo_to_loadable_icon (EdsfPersona* self, EContactPhoto* p) {
 
3952
        GLoadableIcon* result = NULL;
 
3953
        EContactPhoto* _tmp0_;
 
3954
        EContactPhoto* _tmp1_;
 
3955
        EContactPhotoType _tmp2_;
 
3956
        g_return_val_if_fail (self != NULL, NULL);
 
3957
        _tmp0_ = p;
 
3958
        if (_tmp0_ == NULL) {
 
3959
                result = NULL;
 
3960
                return result;
 
3961
        }
 
3962
        _tmp1_ = p;
 
3963
        _tmp2_ = _tmp1_->type;
 
3964
        switch (_tmp2_) {
 
3965
                case E_CONTACT_PHOTO_TYPE_URI:
 
3966
                {
 
3967
                        EContactPhoto* _tmp3_;
 
3968
                        const gchar* _tmp4_ = NULL;
 
3969
                        EContactPhoto* _tmp5_;
 
3970
                        const gchar* _tmp6_ = NULL;
 
3971
                        GFile* _tmp7_ = NULL;
 
3972
                        GFile* _tmp8_;
 
3973
                        GFileIcon* _tmp9_;
 
3974
                        GLoadableIcon* _tmp10_;
 
3975
                        _tmp3_ = p;
 
3976
                        _tmp4_ = e_contact_photo_get_uri (_tmp3_);
 
3977
                        if (_tmp4_ == NULL) {
 
3978
                                result = NULL;
 
3979
                                return result;
 
3980
                        }
 
3981
                        _tmp5_ = p;
 
3982
                        _tmp6_ = e_contact_photo_get_uri (_tmp5_);
 
3983
                        _tmp7_ = g_file_new_for_uri (_tmp6_);
 
3984
                        _tmp8_ = _tmp7_;
 
3985
                        _tmp9_ = (GFileIcon*) g_file_icon_new (_tmp8_);
 
3986
                        _tmp10_ = (GLoadableIcon*) _tmp9_;
 
3987
                        _g_object_unref0 (_tmp8_);
 
3988
                        result = _tmp10_;
 
3989
                        return result;
 
3990
                }
 
3991
                case E_CONTACT_PHOTO_TYPE_INLINED:
 
3992
                {
 
3993
                        gboolean _tmp11_ = FALSE;
 
3994
                        EContactPhoto* _tmp12_;
 
3995
                        const gchar* _tmp13_ = NULL;
 
3996
                        gboolean _tmp17_;
 
3997
                        EContactPhoto* _tmp18_;
 
3998
                        const gchar* _tmp19_ = NULL;
 
3999
                        EContactPhoto* _tmp20_;
 
4000
                        gsize _tmp21_;
 
4001
                        guint8* _tmp22_ = NULL;
 
4002
                        EdsfMemoryIcon* _tmp23_;
 
4003
                        _tmp12_ = p;
 
4004
                        _tmp13_ = e_contact_photo_get_mime_type (_tmp12_);
 
4005
                        if (_tmp13_ == NULL) {
 
4006
                                _tmp11_ = TRUE;
 
4007
                        } else {
 
4008
                                EContactPhoto* _tmp14_;
 
4009
                                gsize _tmp15_;
 
4010
                                guint8* _tmp16_ = NULL;
 
4011
                                _tmp14_ = p;
 
4012
                                _tmp16_ = e_contact_photo_get_inlined (_tmp14_, &_tmp15_);
 
4013
                                _tmp11_ = _tmp16_ == NULL;
 
4014
                        }
 
4015
                        _tmp17_ = _tmp11_;
 
4016
                        if (_tmp17_) {
 
4017
                                result = NULL;
 
4018
                                return result;
 
4019
                        }
 
4020
                        _tmp18_ = p;
 
4021
                        _tmp19_ = e_contact_photo_get_mime_type (_tmp18_);
 
4022
                        _tmp20_ = p;
 
4023
                        _tmp22_ = e_contact_photo_get_inlined (_tmp20_, &_tmp21_);
 
4024
                        _tmp23_ = edsf_memory_icon_new (_tmp19_, _tmp22_, _tmp21_);
 
4025
                        result = (GLoadableIcon*) _tmp23_;
 
4026
                        return result;
 
4027
                }
 
4028
                default:
 
4029
                {
 
4030
                        result = NULL;
 
4031
                        return result;
 
4032
                }
 
4033
        }
 
4034
}
 
4035
 
 
4036
 
 
4037
static Block1Data* block1_data_ref (Block1Data* _data1_) {
 
4038
        g_atomic_int_inc (&_data1_->_ref_count_);
 
4039
        return _data1_;
 
4040
}
 
4041
 
 
4042
 
 
4043
static void block1_data_unref (Block1Data* _data1_) {
 
4044
        if (g_atomic_int_dec_and_test (&_data1_->_ref_count_)) {
 
4045
                _g_object_unref0 (_data1_->self);
 
4046
                _g_object_unref0 (_data1_->new_avatar);
 
4047
                _g_object_unref0 (_data1_->cache);
 
4048
                g_slice_free (Block1Data, _data1_);
 
4049
        }
 
4050
}
 
4051
 
 
4052
 
 
4053
static EContactPhoto* _vala_EContactPhoto_copy (EContactPhoto* self) {
 
4054
        return g_boxed_copy (e_contact_photo_get_type (), self);
 
4055
}
 
4056
 
 
4057
 
 
4058
static gpointer __vala_EContactPhoto_copy0 (gpointer self) {
 
4059
        return self ? _vala_EContactPhoto_copy (self) : NULL;
 
4060
}
 
4061
 
 
4062
 
 
4063
static void ___lambda4_ (Block1Data* _data1_, GObject* obj, GAsyncResult* res) {
 
4064
        EdsfPersona * self;
 
4065
        GError * _inner_error_ = NULL;
 
4066
        self = _data1_->self;
 
4067
        g_return_if_fail (res != NULL);
 
4068
        {
 
4069
                FolksAvatarCache* _tmp0_;
 
4070
                GAsyncResult* _tmp1_;
 
4071
                _tmp0_ = _data1_->cache;
 
4072
                _tmp1_ = res;
 
4073
                folks_avatar_cache_remove_avatar_finish (_tmp0_, _tmp1_, &_inner_error_);
 
4074
                if (_inner_error_ != NULL) {
 
4075
                        goto __catch0_g_error;
 
4076
                }
 
4077
        }
 
4078
        goto __finally0;
 
4079
        __catch0_g_error:
 
4080
        {
 
4081
                GError* e1 = NULL;
 
4082
                e1 = _inner_error_;
 
4083
                _inner_error_ = NULL;
 
4084
                _g_error_free0 (e1);
 
4085
        }
 
4086
        __finally0:
 
4087
        if (_inner_error_ != NULL) {
 
4088
                g_critical ("file %s: line %d: uncaught error: %s (%s, %d)", __FILE__, __LINE__, _inner_error_->message, g_quark_to_string (_inner_error_->domain), _inner_error_->code);
 
4089
                g_clear_error (&_inner_error_);
 
4090
                return;
 
4091
        }
 
4092
        _g_object_unref0 (self->priv->_avatar);
 
4093
        self->priv->_avatar = NULL;
 
4094
        g_object_notify ((GObject*) self, "avatar");
 
4095
}
 
4096
 
 
4097
 
 
4098
static void ____lambda4__gasync_ready_callback (GObject* source_object, GAsyncResult* res, gpointer self) {
 
4099
        ___lambda4_ (self, source_object, res);
 
4100
        block1_data_unref (self);
 
4101
}
 
4102
 
 
4103
 
 
4104
static void ____lambda7_ (Block1Data* _data1_, GObject* obj, GAsyncResult* res) {
 
4105
        EdsfPersona * self;
 
4106
        GError * _inner_error_ = NULL;
 
4107
        self = _data1_->self;
 
4108
        g_return_if_fail (res != NULL);
 
4109
        {
 
4110
                FolksAvatarCache* _tmp0_;
 
4111
                GAsyncResult* _tmp1_;
 
4112
                gchar* _tmp2_ = NULL;
 
4113
                gchar* _tmp3_;
 
4114
                GLoadableIcon* _tmp4_;
 
4115
                GLoadableIcon* _tmp5_;
 
4116
                _tmp0_ = _data1_->cache;
 
4117
                _tmp1_ = res;
 
4118
                _tmp2_ = folks_avatar_cache_store_avatar_finish (_tmp0_, _tmp1_, &_inner_error_);
 
4119
                _tmp3_ = _tmp2_;
 
4120
                _g_free0 (_tmp3_);
 
4121
                if (_inner_error_ != NULL) {
 
4122
                        goto __catch1_g_error;
 
4123
                }
 
4124
                _tmp4_ = _data1_->new_avatar;
 
4125
                _tmp5_ = _g_object_ref0 (_tmp4_);
 
4126
                _g_object_unref0 (self->priv->_avatar);
 
4127
                self->priv->_avatar = _tmp5_;
 
4128
                g_object_notify ((GObject*) self, "avatar");
 
4129
        }
 
4130
        goto __finally1;
 
4131
        __catch1_g_error:
 
4132
        {
 
4133
                GError* e2 = NULL;
 
4134
                const gchar* _tmp6_;
 
4135
                const gchar* _tmp7_;
 
4136
                GError* _tmp8_;
 
4137
                const gchar* _tmp9_;
 
4138
                e2 = _inner_error_;
 
4139
                _inner_error_ = NULL;
 
4140
                _tmp6_ = folks_persona_get_uid ((FolksPersona*) self);
 
4141
                _tmp7_ = _tmp6_;
 
4142
                _tmp8_ = e2;
 
4143
                _tmp9_ = _tmp8_->message;
 
4144
                g_warning ("edsf-persona.vala:1190: Couldn't cache avatar for Edsf.Persona '%s': %" \
 
4145
"s", _tmp7_, _tmp9_);
 
4146
                _g_object_unref0 (_data1_->new_avatar);
 
4147
                _data1_->new_avatar = NULL;
 
4148
                _g_error_free0 (e2);
 
4149
        }
 
4150
        __finally1:
 
4151
        if (_inner_error_ != NULL) {
 
4152
                g_critical ("file %s: line %d: uncaught error: %s (%s, %d)", __FILE__, __LINE__, _inner_error_->message, g_quark_to_string (_inner_error_->domain), _inner_error_->code);
 
4153
                g_clear_error (&_inner_error_);
 
4154
                return;
 
4155
        }
 
4156
}
 
4157
 
 
4158
 
 
4159
static void _____lambda7__gasync_ready_callback (GObject* source_object, GAsyncResult* res, gpointer self) {
 
4160
        ____lambda7_ (self, source_object, res);
 
4161
        block1_data_unref (self);
 
4162
}
 
4163
 
 
4164
 
 
4165
static void _vala_EContactPhoto_free (EContactPhoto* self) {
 
4166
        g_boxed_free (e_contact_photo_get_type (), self);
 
4167
}
 
4168
 
 
4169
 
 
4170
static void _edsf_persona_update_avatar (EdsfPersona* self) {
 
4171
        Block1Data* _data1_;
 
4172
        void* _tmp0_ = NULL;
 
4173
        EContactPhoto* _tmp1_;
 
4174
        EContactPhoto* p;
 
4175
        FolksAvatarCache* _tmp2_ = NULL;
 
4176
        EContactPhoto* _tmp3_;
 
4177
        GLoadableIcon* _tmp4_ = NULL;
 
4178
        gboolean _tmp5_ = FALSE;
 
4179
        GLoadableIcon* _tmp6_;
 
4180
        gboolean _tmp8_;
 
4181
        g_return_if_fail (self != NULL);
 
4182
        _data1_ = g_slice_new0 (Block1Data);
 
4183
        _data1_->_ref_count_ = 1;
 
4184
        _data1_->self = g_object_ref (self);
 
4185
        _tmp0_ = _edsf_persona_get_property (self, "photo");
 
4186
        _tmp1_ = __vala_EContactPhoto_copy0 ((EContactPhoto*) _tmp0_);
 
4187
        p = _tmp1_;
 
4188
        _tmp2_ = folks_avatar_cache_dup ();
 
4189
        _data1_->cache = _tmp2_;
 
4190
        _tmp3_ = p;
 
4191
        _tmp4_ = _edsf_persona_contact_photo_to_loadable_icon (self, _tmp3_);
 
4192
        _data1_->new_avatar = _tmp4_;
 
4193
        _tmp6_ = self->priv->_avatar;
 
4194
        if (_tmp6_ != NULL) {
 
4195
                GLoadableIcon* _tmp7_;
 
4196
                _tmp7_ = _data1_->new_avatar;
 
4197
                _tmp5_ = _tmp7_ == NULL;
 
4198
        } else {
 
4199
                _tmp5_ = FALSE;
 
4200
        }
 
4201
        _tmp8_ = _tmp5_;
 
4202
        if (_tmp8_) {
 
4203
                FolksAvatarCache* _tmp9_;
 
4204
                const gchar* _tmp10_;
 
4205
                const gchar* _tmp11_;
 
4206
                _tmp9_ = _data1_->cache;
 
4207
                _tmp10_ = folks_persona_get_uid ((FolksPersona*) self);
 
4208
                _tmp11_ = _tmp10_;
 
4209
                folks_avatar_cache_remove_avatar (_tmp9_, _tmp11_, ____lambda4__gasync_ready_callback, block1_data_ref (_data1_));
 
4210
        } else {
 
4211
                gboolean _tmp12_ = FALSE;
 
4212
                gboolean _tmp13_ = FALSE;
 
4213
                GLoadableIcon* _tmp14_;
 
4214
                GLoadableIcon* _tmp15_;
 
4215
                gboolean _tmp17_;
 
4216
                gboolean _tmp28_;
 
4217
                _tmp14_ = folks_avatar_details_get_avatar ((FolksAvatarDetails*) self);
 
4218
                _tmp15_ = _tmp14_;
 
4219
                if (_tmp15_ == NULL) {
 
4220
                        GLoadableIcon* _tmp16_;
 
4221
                        _tmp16_ = _data1_->new_avatar;
 
4222
                        _tmp13_ = _tmp16_ != NULL;
 
4223
                } else {
 
4224
                        _tmp13_ = FALSE;
 
4225
                }
 
4226
                _tmp17_ = _tmp13_;
 
4227
                if (_tmp17_) {
 
4228
                        _tmp12_ = TRUE;
 
4229
                } else {
 
4230
                        gboolean _tmp18_ = FALSE;
 
4231
                        gboolean _tmp19_ = FALSE;
 
4232
                        GLoadableIcon* _tmp20_;
 
4233
                        GLoadableIcon* _tmp21_;
 
4234
                        gboolean _tmp23_;
 
4235
                        gboolean _tmp27_;
 
4236
                        _tmp20_ = folks_avatar_details_get_avatar ((FolksAvatarDetails*) self);
 
4237
                        _tmp21_ = _tmp20_;
 
4238
                        if (_tmp21_ != NULL) {
 
4239
                                GLoadableIcon* _tmp22_;
 
4240
                                _tmp22_ = _data1_->new_avatar;
 
4241
                                _tmp19_ = _tmp22_ != NULL;
 
4242
                        } else {
 
4243
                                _tmp19_ = FALSE;
 
4244
                        }
 
4245
                        _tmp23_ = _tmp19_;
 
4246
                        if (_tmp23_) {
 
4247
                                GLoadableIcon* _tmp24_;
 
4248
                                GLoadableIcon* _tmp25_;
 
4249
                                gboolean _tmp26_ = FALSE;
 
4250
                                _tmp24_ = self->priv->_avatar;
 
4251
                                _tmp25_ = _data1_->new_avatar;
 
4252
                                _tmp26_ = g_icon_equal ((GIcon*) _tmp24_, (GIcon*) _tmp25_);
 
4253
                                _tmp18_ = _tmp26_ == FALSE;
 
4254
                        } else {
 
4255
                                _tmp18_ = FALSE;
 
4256
                        }
 
4257
                        _tmp27_ = _tmp18_;
 
4258
                        _tmp12_ = _tmp27_;
 
4259
                }
 
4260
                _tmp28_ = _tmp12_;
 
4261
                if (_tmp28_) {
 
4262
                        FolksAvatarCache* _tmp29_;
 
4263
                        const gchar* _tmp30_;
 
4264
                        const gchar* _tmp31_;
 
4265
                        GLoadableIcon* _tmp32_;
 
4266
                        _tmp29_ = _data1_->cache;
 
4267
                        _tmp30_ = folks_persona_get_uid ((FolksPersona*) self);
 
4268
                        _tmp31_ = _tmp30_;
 
4269
                        _tmp32_ = _data1_->new_avatar;
 
4270
                        folks_avatar_cache_store_avatar (_tmp29_, _tmp31_, _tmp32_, _____lambda7__gasync_ready_callback, block1_data_ref (_data1_));
 
4271
                }
 
4272
        }
 
4273
        __vala_EContactPhoto_free0 (p);
 
4274
        block1_data_unref (_data1_);
 
4275
        _data1_ = NULL;
 
4276
}
 
4277
 
 
4278
 
 
4279
static void _edsf_persona_update_urls (EdsfPersona* self) {
 
4280
        GeeHashSet* _tmp0_;
 
4281
        GeeHashSet* new_urls;
 
4282
        EContact* _tmp21_;
 
4283
        EVCard* _tmp22_;
 
4284
        EVCard* vcard;
 
4285
        EVCard* _tmp23_;
 
4286
        GList* _tmp24_ = NULL;
 
4287
        GeeHashSet* _tmp36_;
 
4288
        GeeHashSet* _tmp37_;
 
4289
        gboolean _tmp38_ = FALSE;
 
4290
        g_return_if_fail (self != NULL);
 
4291
        _tmp0_ = gee_hash_set_new (FOLKS_TYPE_URL_FIELD_DETAILS, (GBoxedCopyFunc) g_object_ref, g_object_unref, NULL, NULL);
 
4292
        new_urls = _tmp0_;
 
4293
        {
 
4294
                EdsfPersonaUrlTypeMapping* mapping_collection = NULL;
 
4295
                gint mapping_collection_length1 = 0;
 
4296
                gint _mapping_collection_size_ = 0;
 
4297
                gint mapping_it = 0;
 
4298
                mapping_collection = EDSF_PERSONA__url_properties;
 
4299
                mapping_collection_length1 = G_N_ELEMENTS (EDSF_PERSONA__url_properties);
 
4300
                for (mapping_it = 0; mapping_it < G_N_ELEMENTS (EDSF_PERSONA__url_properties); mapping_it = mapping_it + 1) {
 
4301
                        EdsfPersonaUrlTypeMapping mapping = {0};
 
4302
                        mapping = mapping_collection[mapping_it];
 
4303
                        {
 
4304
                                EdsfPersonaUrlTypeMapping _tmp1_;
 
4305
                                const gchar* _tmp2_;
 
4306
                                gchar* _tmp3_;
 
4307
                                gchar* url_property;
 
4308
                                EdsfPersonaUrlTypeMapping _tmp4_;
 
4309
                                const gchar* _tmp5_;
 
4310
                                gchar* _tmp6_;
 
4311
                                gchar* folks_type;
 
4312
                                const gchar* _tmp7_;
 
4313
                                void* _tmp8_ = NULL;
 
4314
                                gchar* _tmp9_;
 
4315
                                gchar* u;
 
4316
                                gboolean _tmp10_ = FALSE;
 
4317
                                const gchar* _tmp11_;
 
4318
                                gboolean _tmp13_;
 
4319
                                _tmp1_ = mapping;
 
4320
                                _tmp2_ = _tmp1_.vcard_field_name;
 
4321
                                _tmp3_ = g_strdup (_tmp2_);
 
4322
                                url_property = _tmp3_;
 
4323
                                _tmp4_ = mapping;
 
4324
                                _tmp5_ = _tmp4_.folks_type;
 
4325
                                _tmp6_ = g_strdup (_tmp5_);
 
4326
                                folks_type = _tmp6_;
 
4327
                                _tmp7_ = url_property;
 
4328
                                _tmp8_ = _edsf_persona_get_property (self, _tmp7_);
 
4329
                                _tmp9_ = g_strdup ((const gchar*) _tmp8_);
 
4330
                                u = _tmp9_;
 
4331
                                _tmp11_ = u;
 
4332
                                if (_tmp11_ != NULL) {
 
4333
                                        const gchar* _tmp12_;
 
4334
                                        _tmp12_ = u;
 
4335
                                        _tmp10_ = g_strcmp0 (_tmp12_, "") != 0;
 
4336
                                } else {
 
4337
                                        _tmp10_ = FALSE;
 
4338
                                }
 
4339
                                _tmp13_ = _tmp10_;
 
4340
                                if (_tmp13_) {
 
4341
                                        const gchar* _tmp14_;
 
4342
                                        FolksUrlFieldDetails* _tmp15_;
 
4343
                                        FolksUrlFieldDetails* fd_u;
 
4344
                                        FolksUrlFieldDetails* _tmp16_;
 
4345
                                        FolksUrlFieldDetails* _tmp17_;
 
4346
                                        const gchar* _tmp18_;
 
4347
                                        GeeHashSet* _tmp19_;
 
4348
                                        FolksUrlFieldDetails* _tmp20_;
 
4349
                                        _tmp14_ = u;
 
4350
                                        _tmp15_ = folks_url_field_details_new (_tmp14_, NULL);
 
4351
                                        fd_u = _tmp15_;
 
4352
                                        _tmp16_ = fd_u;
 
4353
                                        _tmp17_ = fd_u;
 
4354
                                        _tmp18_ = folks_type;
 
4355
                                        folks_abstract_field_details_set_parameter ((FolksAbstractFieldDetails*) _tmp16_, FOLKS_ABSTRACT_FIELD_DETAILS_PARAM_TYPE, _tmp18_);
 
4356
                                        _tmp19_ = new_urls;
 
4357
                                        _tmp20_ = fd_u;
 
4358
                                        gee_abstract_collection_add ((GeeAbstractCollection*) _tmp19_, _tmp20_);
 
4359
                                        _g_object_unref0 (fd_u);
 
4360
                                }
 
4361
                                _g_free0 (u);
 
4362
                                _g_free0 (folks_type);
 
4363
                                _g_free0 (url_property);
 
4364
                        }
 
4365
                }
 
4366
        }
 
4367
        _tmp21_ = self->priv->_contact;
 
4368
        _tmp22_ = _g_object_ref0 (E_VCARD (_tmp21_));
 
4369
        vcard = _tmp22_;
 
4370
        _tmp23_ = vcard;
 
4371
        _tmp24_ = e_vcard_get_attributes (_tmp23_);
 
4372
        {
 
4373
                GList* attr_collection = NULL;
 
4374
                GList* attr_it = NULL;
 
4375
                attr_collection = _tmp24_;
 
4376
                for (attr_it = attr_collection; attr_it != NULL; attr_it = attr_it->next) {
 
4377
                        EVCardAttribute* attr = NULL;
 
4378
                        attr = (EVCardAttribute*) attr_it->data;
 
4379
                        {
 
4380
                                EVCardAttribute* _tmp25_;
 
4381
                                const gchar* _tmp26_ = NULL;
 
4382
                                _tmp25_ = attr;
 
4383
                                _tmp26_ = e_vcard_attribute_get_name (_tmp25_);
 
4384
                                if (g_strcmp0 (_tmp26_, "X-URIS") == 0) {
 
4385
                                        EVCardAttribute* _tmp27_;
 
4386
                                        gchar* _tmp28_ = NULL;
 
4387
                                        gchar* _tmp29_;
 
4388
                                        FolksUrlFieldDetails* _tmp30_;
 
4389
                                        FolksUrlFieldDetails* _tmp31_;
 
4390
                                        FolksUrlFieldDetails* url_fd;
 
4391
                                        FolksUrlFieldDetails* _tmp32_;
 
4392
                                        EVCardAttribute* _tmp33_;
 
4393
                                        GeeHashSet* _tmp34_;
 
4394
                                        FolksUrlFieldDetails* _tmp35_;
 
4395
                                        _tmp27_ = attr;
 
4396
                                        _tmp28_ = e_vcard_attribute_get_value (_tmp27_);
 
4397
                                        _tmp29_ = _tmp28_;
 
4398
                                        _tmp30_ = folks_url_field_details_new (_tmp29_, NULL);
 
4399
                                        _tmp31_ = _tmp30_;
 
4400
                                        _g_free0 (_tmp29_);
 
4401
                                        url_fd = _tmp31_;
 
4402
                                        _tmp32_ = url_fd;
 
4403
                                        _tmp33_ = attr;
 
4404
                                        _edsf_persona_update_params (self, (FolksAbstractFieldDetails*) _tmp32_, _tmp33_);
 
4405
                                        _tmp34_ = new_urls;
 
4406
                                        _tmp35_ = url_fd;
 
4407
                                        gee_abstract_collection_add ((GeeAbstractCollection*) _tmp34_, _tmp35_);
 
4408
                                        _g_object_unref0 (url_fd);
 
4409
                                }
 
4410
                        }
 
4411
                }
 
4412
        }
 
4413
        _tmp36_ = new_urls;
 
4414
        _tmp37_ = self->priv->_urls;
 
4415
        _tmp38_ = folks_utils_set_afd_equal ((GeeSet*) _tmp36_, (GeeSet*) _tmp37_);
 
4416
        if (!_tmp38_) {
 
4417
                GeeHashSet* _tmp39_;
 
4418
                GeeHashSet* _tmp40_;
 
4419
                GeeHashSet* _tmp41_;
 
4420
                GeeSet* _tmp42_;
 
4421
                GeeSet* _tmp43_;
 
4422
                _tmp39_ = new_urls;
 
4423
                _tmp40_ = _g_object_ref0 (_tmp39_);
 
4424
                _g_object_unref0 (self->priv->_urls);
 
4425
                self->priv->_urls = _tmp40_;
 
4426
                _tmp41_ = new_urls;
 
4427
                _tmp42_ = gee_abstract_set_get_read_only_view ((GeeAbstractSet*) _tmp41_);
 
4428
                _tmp43_ = _tmp42_;
 
4429
                _g_object_unref0 (self->priv->_urls_ro);
 
4430
                self->priv->_urls_ro = _tmp43_;
 
4431
                g_object_notify ((GObject*) self, "urls");
 
4432
        }
 
4433
        _g_object_unref0 (vcard);
 
4434
        _g_object_unref0 (new_urls);
 
4435
}
 
4436
 
 
4437
 
 
4438
static void _edsf_persona_update_im_addresses (EdsfPersona* self) {
 
4439
        GHashTable* _tmp0_ = NULL;
 
4440
        GHashTable* im_eds_map;
 
4441
        GeeHashMultiMap* _tmp1_;
 
4442
        GeeHashMultiMap* new_im_addresses;
 
4443
        GHashTable* _tmp2_;
 
4444
        GList* _tmp3_ = NULL;
 
4445
        GeeHashMultiMap* _tmp73_;
 
4446
        GeeHashMultiMap* _tmp74_;
 
4447
        gboolean _tmp75_ = FALSE;
 
4448
        GError * _inner_error_ = NULL;
 
4449
        g_return_if_fail (self != NULL);
 
4450
        _tmp0_ = _edsf_persona_get_im_eds_map ();
 
4451
        im_eds_map = _tmp0_;
 
4452
        _tmp1_ = gee_hash_multi_map_new (G_TYPE_STRING, (GBoxedCopyFunc) g_strdup, g_free, FOLKS_TYPE_IM_FIELD_DETAILS, (GBoxedCopyFunc) g_object_ref, g_object_unref, NULL, NULL, (GHashFunc) folks_abstract_field_details_hash, (GEqualFunc) folks_abstract_field_details_equal);
 
4453
        new_im_addresses = _tmp1_;
 
4454
        _tmp2_ = im_eds_map;
 
4455
        _tmp3_ = g_hash_table_get_keys (_tmp2_);
 
4456
        {
 
4457
                GList* im_proto_collection = NULL;
 
4458
                GList* im_proto_it = NULL;
 
4459
                im_proto_collection = _tmp3_;
 
4460
                for (im_proto_it = im_proto_collection; im_proto_it != NULL; im_proto_it = im_proto_it->next) {
 
4461
                        const gchar* im_proto = NULL;
 
4462
                        im_proto = (const gchar*) im_proto_it->data;
 
4463
                        {
 
4464
                                EContact* _tmp4_;
 
4465
                                GHashTable* _tmp5_;
 
4466
                                const gchar* _tmp6_;
 
4467
                                gconstpointer _tmp7_ = NULL;
 
4468
                                GList* _tmp8_ = NULL;
 
4469
                                GList* addresses;
 
4470
                                GList* _tmp9_;
 
4471
                                _tmp4_ = self->priv->_contact;
 
4472
                                _tmp5_ = im_eds_map;
 
4473
                                _tmp6_ = im_proto;
 
4474
                                _tmp7_ = g_hash_table_lookup (_tmp5_, _tmp6_);
 
4475
                                _tmp8_ = e_contact_get_attributes (_tmp4_, GPOINTER_TO_INT (_tmp7_));
 
4476
                                addresses = _tmp8_;
 
4477
                                _tmp9_ = addresses;
 
4478
                                {
 
4479
                                        GList* attr_collection = NULL;
 
4480
                                        GList* attr_it = NULL;
 
4481
                                        attr_collection = _tmp9_;
 
4482
                                        for (attr_it = attr_collection; attr_it != NULL; attr_it = attr_it->next) {
 
4483
                                                EVCardAttribute* _tmp10_;
 
4484
                                                EVCardAttribute* attr = NULL;
 
4485
                                                _tmp10_ = __vala_EVCardAttribute_copy0 ((EVCardAttribute*) attr_it->data);
 
4486
                                                attr = _tmp10_;
 
4487
                                                {
 
4488
                                                        {
 
4489
                                                                EVCardAttribute* _tmp11_;
 
4490
                                                                gchar* _tmp12_ = NULL;
 
4491
                                                                gchar* addr;
 
4492
                                                                const gchar* _tmp13_;
 
4493
                                                                const gchar* _tmp14_;
 
4494
                                                                gchar* _tmp15_ = NULL;
 
4495
                                                                gchar* _tmp16_;
 
4496
                                                                gchar* _tmp17_;
 
4497
                                                                gchar* _tmp18_;
 
4498
                                                                gchar* _tmp19_;
 
4499
                                                                gchar* normalised_addr;
 
4500
                                                                const gchar* _tmp20_;
 
4501
                                                                FolksImFieldDetails* _tmp21_;
 
4502
                                                                FolksImFieldDetails* im_fd;
 
4503
                                                                GeeHashMultiMap* _tmp22_;
 
4504
                                                                const gchar* _tmp23_;
 
4505
                                                                FolksImFieldDetails* _tmp24_;
 
4506
                                                                _tmp11_ = attr;
 
4507
                                                                _tmp12_ = e_vcard_attribute_get_value (_tmp11_);
 
4508
                                                                addr = _tmp12_;
 
4509
                                                                _tmp13_ = addr;
 
4510
                                                                _tmp14_ = im_proto;
 
4511
                                                                _tmp15_ = folks_im_details_normalise_im_address (_tmp13_, _tmp14_, &_inner_error_);
 
4512
                                                                _tmp16_ = _tmp15_;
 
4513
                                                                if (_inner_error_ != NULL) {
 
4514
                                                                        _g_free0 (addr);
 
4515
                                                                        if (_inner_error_->domain == FOLKS_IM_DETAILS_ERROR) {
 
4516
                                                                                goto __catch2_folks_im_details_error;
 
4517
                                                                        }
 
4518
                                                                        _g_free0 (addr);
 
4519
                                                                        __vala_EVCardAttribute_free0 (attr);
 
4520
                                                                        __g_list_free___vala_EVCardAttribute_free0_0 (addresses);
 
4521
                                                                        _g_list_free0 (im_proto_collection);
 
4522
                                                                        _g_object_unref0 (new_im_addresses);
 
4523
                                                                        _g_hash_table_unref0 (im_eds_map);
 
4524
                                                                        g_critical ("file %s: line %d: unexpected error: %s (%s, %d)", __FILE__, __LINE__, _inner_error_->message, g_quark_to_string (_inner_error_->domain), _inner_error_->code);
 
4525
                                                                        g_clear_error (&_inner_error_);
 
4526
                                                                        return;
 
4527
                                                                }
 
4528
                                                                _tmp17_ = _tmp16_;
 
4529
                                                                _tmp18_ = _tmp17_;
 
4530
                                                                _tmp17_ = NULL;
 
4531
                                                                _tmp19_ = _tmp18_;
 
4532
                                                                _g_free0 (_tmp17_);
 
4533
                                                                normalised_addr = _tmp19_;
 
4534
                                                                _tmp20_ = normalised_addr;
 
4535
                                                                _tmp21_ = folks_im_field_details_new (_tmp20_, NULL);
 
4536
                                                                im_fd = _tmp21_;
 
4537
                                                                _tmp22_ = new_im_addresses;
 
4538
                                                                _tmp23_ = im_proto;
 
4539
                                                                _tmp24_ = im_fd;
 
4540
                                                                gee_multi_map_set ((GeeMultiMap*) _tmp22_, _tmp23_, _tmp24_);
 
4541
                                                                _g_object_unref0 (im_fd);
 
4542
                                                                _g_free0 (normalised_addr);
 
4543
                                                                _g_free0 (addr);
 
4544
                                                        }
 
4545
                                                        goto __finally2;
 
4546
                                                        __catch2_folks_im_details_error:
 
4547
                                                        {
 
4548
                                                                GError* e = NULL;
 
4549
                                                                GError* _tmp25_;
 
4550
                                                                const gchar* _tmp26_;
 
4551
                                                                e = _inner_error_;
 
4552
                                                                _inner_error_ = NULL;
 
4553
                                                                _tmp25_ = e;
 
4554
                                                                _tmp26_ = _tmp25_->message;
 
4555
                                                                g_warning ("edsf-persona.vala:1260: Problem when trying to normalise address: %s\n", _tmp26_);
 
4556
                                                                _g_error_free0 (e);
 
4557
                                                        }
 
4558
                                                        __finally2:
 
4559
                                                        if (_inner_error_ != NULL) {
 
4560
                                                                __vala_EVCardAttribute_free0 (attr);
 
4561
                                                                __g_list_free___vala_EVCardAttribute_free0_0 (addresses);
 
4562
                                                                _g_list_free0 (im_proto_collection);
 
4563
                                                                _g_object_unref0 (new_im_addresses);
 
4564
                                                                _g_hash_table_unref0 (im_eds_map);
 
4565
                                                                g_critical ("file %s: line %d: uncaught error: %s (%s, %d)", __FILE__, __LINE__, _inner_error_->message, g_quark_to_string (_inner_error_->domain), _inner_error_->code);
 
4566
                                                                g_clear_error (&_inner_error_);
 
4567
                                                                return;
 
4568
                                                        }
 
4569
                                                        __vala_EVCardAttribute_free0 (attr);
 
4570
                                                }
 
4571
                                        }
 
4572
                                }
 
4573
                                __g_list_free___vala_EVCardAttribute_free0_0 (addresses);
 
4574
                        }
 
4575
                }
 
4576
                _g_list_free0 (im_proto_collection);
 
4577
        }
 
4578
        {
 
4579
                GeeSet* _tmp27_;
 
4580
                GeeSet* _tmp28_;
 
4581
                GeeIterator* _tmp29_ = NULL;
 
4582
                GeeIterator* _email_it;
 
4583
                _tmp27_ = folks_email_details_get_email_addresses ((FolksEmailDetails*) self);
 
4584
                _tmp28_ = _tmp27_;
 
4585
                _tmp29_ = gee_iterable_iterator ((GeeIterable*) _tmp28_);
 
4586
                _email_it = _tmp29_;
 
4587
                while (TRUE) {
 
4588
                        GeeIterator* _tmp30_;
 
4589
                        gboolean _tmp31_ = FALSE;
 
4590
                        GeeIterator* _tmp32_;
 
4591
                        gpointer _tmp33_ = NULL;
 
4592
                        FolksEmailFieldDetails* email;
 
4593
                        FolksEmailFieldDetails* _tmp34_;
 
4594
                        gconstpointer _tmp35_;
 
4595
                        const gchar* _tmp36_;
 
4596
                        gchar* _tmp37_ = NULL;
 
4597
                        gchar* proto;
 
4598
                        const gchar* _tmp38_;
 
4599
                        _tmp30_ = _email_it;
 
4600
                        _tmp31_ = gee_iterator_next (_tmp30_);
 
4601
                        if (!_tmp31_) {
 
4602
                                break;
 
4603
                        }
 
4604
                        _tmp32_ = _email_it;
 
4605
                        _tmp33_ = gee_iterator_get (_tmp32_);
 
4606
                        email = (FolksEmailFieldDetails*) _tmp33_;
 
4607
                        _tmp34_ = email;
 
4608
                        _tmp35_ = folks_abstract_field_details_get_value ((FolksAbstractFieldDetails*) _tmp34_);
 
4609
                        _tmp36_ = _tmp35_;
 
4610
                        _tmp37_ = _edsf_persona_im_proto_from_addr (self, (const gchar*) _tmp36_);
 
4611
                        proto = _tmp37_;
 
4612
                        _tmp38_ = proto;
 
4613
                        if (_tmp38_ != NULL) {
 
4614
                                gboolean exists;
 
4615
                                GeeMultiMap* _tmp39_;
 
4616
                                GeeMultiMap* _tmp40_;
 
4617
                                const gchar* _tmp41_;
 
4618
                                GeeCollection* _tmp42_ = NULL;
 
4619
                                GeeCollection* current_im_addrs;
 
4620
                                GeeCollection* _tmp43_;
 
4621
                                gboolean _tmp56_;
 
4622
                                exists = FALSE;
 
4623
                                _tmp39_ = folks_im_details_get_im_addresses ((FolksImDetails*) self);
 
4624
                                _tmp40_ = _tmp39_;
 
4625
                                _tmp41_ = proto;
 
4626
                                _tmp42_ = gee_multi_map_get (_tmp40_, _tmp41_);
 
4627
                                current_im_addrs = _tmp42_;
 
4628
                                _tmp43_ = current_im_addrs;
 
4629
                                if (_tmp43_ != NULL) {
 
4630
                                        {
 
4631
                                                GeeCollection* _tmp44_;
 
4632
                                                GeeIterator* _tmp45_ = NULL;
 
4633
                                                GeeIterator* _cur_im_it;
 
4634
                                                _tmp44_ = current_im_addrs;
 
4635
                                                _tmp45_ = gee_iterable_iterator ((GeeIterable*) _tmp44_);
 
4636
                                                _cur_im_it = _tmp45_;
 
4637
                                                while (TRUE) {
 
4638
                                                        GeeIterator* _tmp46_;
 
4639
                                                        gboolean _tmp47_ = FALSE;
 
4640
                                                        GeeIterator* _tmp48_;
 
4641
                                                        gpointer _tmp49_ = NULL;
 
4642
                                                        FolksImFieldDetails* cur_im;
 
4643
                                                        FolksImFieldDetails* _tmp50_;
 
4644
                                                        gconstpointer _tmp51_;
 
4645
                                                        const gchar* _tmp52_;
 
4646
                                                        FolksEmailFieldDetails* _tmp53_;
 
4647
                                                        gconstpointer _tmp54_;
 
4648
                                                        const gchar* _tmp55_;
 
4649
                                                        _tmp46_ = _cur_im_it;
 
4650
                                                        _tmp47_ = gee_iterator_next (_tmp46_);
 
4651
                                                        if (!_tmp47_) {
 
4652
                                                                break;
 
4653
                                                        }
 
4654
                                                        _tmp48_ = _cur_im_it;
 
4655
                                                        _tmp49_ = gee_iterator_get (_tmp48_);
 
4656
                                                        cur_im = (FolksImFieldDetails*) _tmp49_;
 
4657
                                                        _tmp50_ = cur_im;
 
4658
                                                        _tmp51_ = folks_abstract_field_details_get_value ((FolksAbstractFieldDetails*) _tmp50_);
 
4659
                                                        _tmp52_ = _tmp51_;
 
4660
                                                        _tmp53_ = email;
 
4661
                                                        _tmp54_ = folks_abstract_field_details_get_value ((FolksAbstractFieldDetails*) _tmp53_);
 
4662
                                                        _tmp55_ = _tmp54_;
 
4663
                                                        if (g_strcmp0 ((const gchar*) _tmp52_, (const gchar*) _tmp55_) == 0) {
 
4664
                                                                exists = TRUE;
 
4665
                                                                _g_object_unref0 (cur_im);
 
4666
                                                                break;
 
4667
                                                        }
 
4668
                                                        _g_object_unref0 (cur_im);
 
4669
                                                }
 
4670
                                                _g_object_unref0 (_cur_im_it);
 
4671
                                        }
 
4672
                                }
 
4673
                                _tmp56_ = exists;
 
4674
                                if (_tmp56_) {
 
4675
                                        _g_object_unref0 (current_im_addrs);
 
4676
                                        _g_free0 (proto);
 
4677
                                        _g_object_unref0 (email);
 
4678
                                        continue;
 
4679
                                }
 
4680
                                {
 
4681
                                        FolksEmailFieldDetails* _tmp57_;
 
4682
                                        gconstpointer _tmp58_;
 
4683
                                        const gchar* _tmp59_;
 
4684
                                        const gchar* _tmp60_;
 
4685
                                        gchar* _tmp61_ = NULL;
 
4686
                                        gchar* _tmp62_;
 
4687
                                        gchar* _tmp63_;
 
4688
                                        gchar* _tmp64_;
 
4689
                                        gchar* _tmp65_;
 
4690
                                        gchar* normalised_addr;
 
4691
                                        const gchar* _tmp66_;
 
4692
                                        FolksImFieldDetails* _tmp67_;
 
4693
                                        FolksImFieldDetails* im_fd;
 
4694
                                        GeeHashMultiMap* _tmp68_;
 
4695
                                        const gchar* _tmp69_;
 
4696
                                        FolksImFieldDetails* _tmp70_;
 
4697
                                        _tmp57_ = email;
 
4698
                                        _tmp58_ = folks_abstract_field_details_get_value ((FolksAbstractFieldDetails*) _tmp57_);
 
4699
                                        _tmp59_ = _tmp58_;
 
4700
                                        _tmp60_ = proto;
 
4701
                                        _tmp61_ = folks_im_details_normalise_im_address ((const gchar*) _tmp59_, _tmp60_, &_inner_error_);
 
4702
                                        _tmp62_ = _tmp61_;
 
4703
                                        if (_inner_error_ != NULL) {
 
4704
                                                if (_inner_error_->domain == FOLKS_IM_DETAILS_ERROR) {
 
4705
                                                        goto __catch3_folks_im_details_error;
 
4706
                                                }
 
4707
                                                _g_object_unref0 (current_im_addrs);
 
4708
                                                _g_free0 (proto);
 
4709
                                                _g_object_unref0 (email);
 
4710
                                                _g_object_unref0 (_email_it);
 
4711
                                                _g_object_unref0 (new_im_addresses);
 
4712
                                                _g_hash_table_unref0 (im_eds_map);
 
4713
                                                g_critical ("file %s: line %d: unexpected error: %s (%s, %d)", __FILE__, __LINE__, _inner_error_->message, g_quark_to_string (_inner_error_->domain), _inner_error_->code);
 
4714
                                                g_clear_error (&_inner_error_);
 
4715
                                                return;
 
4716
                                        }
 
4717
                                        _tmp63_ = _tmp62_;
 
4718
                                        _tmp64_ = _tmp63_;
 
4719
                                        _tmp63_ = NULL;
 
4720
                                        _tmp65_ = _tmp64_;
 
4721
                                        _g_free0 (_tmp63_);
 
4722
                                        normalised_addr = _tmp65_;
 
4723
                                        _tmp66_ = normalised_addr;
 
4724
                                        _tmp67_ = folks_im_field_details_new (_tmp66_, NULL);
 
4725
                                        im_fd = _tmp67_;
 
4726
                                        _tmp68_ = new_im_addresses;
 
4727
                                        _tmp69_ = proto;
 
4728
                                        _tmp70_ = im_fd;
 
4729
                                        gee_multi_map_set ((GeeMultiMap*) _tmp68_, _tmp69_, _tmp70_);
 
4730
                                        _g_object_unref0 (im_fd);
 
4731
                                        _g_free0 (normalised_addr);
 
4732
                                }
 
4733
                                goto __finally3;
 
4734
                                __catch3_folks_im_details_error:
 
4735
                                {
 
4736
                                        GError* e = NULL;
 
4737
                                        GError* _tmp71_;
 
4738
                                        const gchar* _tmp72_;
 
4739
                                        e = _inner_error_;
 
4740
                                        _inner_error_ = NULL;
 
4741
                                        _tmp71_ = e;
 
4742
                                        _tmp72_ = _tmp71_->message;
 
4743
                                        g_warning ("edsf-persona.vala:1308: Problem when trying to normalise address: %s\n", _tmp72_);
 
4744
                                        _g_error_free0 (e);
 
4745
                                }
 
4746
                                __finally3:
 
4747
                                if (_inner_error_ != NULL) {
 
4748
                                        _g_object_unref0 (current_im_addrs);
 
4749
                                        _g_free0 (proto);
 
4750
                                        _g_object_unref0 (email);
 
4751
                                        _g_object_unref0 (_email_it);
 
4752
                                        _g_object_unref0 (new_im_addresses);
 
4753
                                        _g_hash_table_unref0 (im_eds_map);
 
4754
                                        g_critical ("file %s: line %d: uncaught error: %s (%s, %d)", __FILE__, __LINE__, _inner_error_->message, g_quark_to_string (_inner_error_->domain), _inner_error_->code);
 
4755
                                        g_clear_error (&_inner_error_);
 
4756
                                        return;
 
4757
                                }
 
4758
                                _g_object_unref0 (current_im_addrs);
 
4759
                        }
 
4760
                        _g_free0 (proto);
 
4761
                        _g_object_unref0 (email);
 
4762
                }
 
4763
                _g_object_unref0 (_email_it);
 
4764
        }
 
4765
        _tmp73_ = new_im_addresses;
 
4766
        _tmp74_ = self->priv->_im_addresses;
 
4767
        _tmp75_ = folks_utils_multi_map_str_afd_equal ((GeeMultiMap*) _tmp73_, (GeeMultiMap*) _tmp74_);
 
4768
        if (!_tmp75_) {
 
4769
                GeeHashMultiMap* _tmp76_;
 
4770
                GeeHashMultiMap* _tmp77_;
 
4771
                _tmp76_ = new_im_addresses;
 
4772
                _tmp77_ = _g_object_ref0 (_tmp76_);
 
4773
                _g_object_unref0 (self->priv->_im_addresses);
 
4774
                self->priv->_im_addresses = _tmp77_;
 
4775
                g_object_notify ((GObject*) self, "im-addresses");
 
4776
        }
 
4777
        _g_object_unref0 (new_im_addresses);
 
4778
        _g_hash_table_unref0 (im_eds_map);
 
4779
}
 
4780
 
 
4781
 
 
4782
static void _edsf_persona_update_groups (EdsfPersona* self) {
 
4783
        EContact* _tmp0_;
 
4784
        void* _tmp1_ = NULL;
 
4785
        GList* category_names;
 
4786
        GeeHashSet* _tmp2_;
 
4787
        GeeHashSet* new_categories;
 
4788
        GeeLinkedList* _tmp3_;
 
4789
        GeeLinkedList* added_categories;
 
4790
        GList* _tmp4_;
 
4791
        GeeLinkedList* _tmp13_;
 
4792
        GeeLinkedList* removed_categories;
 
4793
        gboolean _tmp53_ = FALSE;
 
4794
        GeeLinkedList* _tmp54_;
 
4795
        gint _tmp55_;
 
4796
        gint _tmp56_;
 
4797
        gboolean _tmp60_;
 
4798
        g_return_if_fail (self != NULL);
 
4799
        _tmp0_ = self->priv->_contact;
 
4800
        _tmp1_ = e_contact_get (_tmp0_, E_CONTACT_CATEGORY_LIST);
 
4801
        category_names = (GList*) _tmp1_;
 
4802
        _tmp2_ = gee_hash_set_new (G_TYPE_STRING, (GBoxedCopyFunc) g_strdup, g_free, NULL, NULL);
 
4803
        new_categories = _tmp2_;
 
4804
        _tmp3_ = gee_linked_list_new (G_TYPE_STRING, (GBoxedCopyFunc) g_strdup, g_free, NULL);
 
4805
        added_categories = _tmp3_;
 
4806
        _tmp4_ = category_names;
 
4807
        {
 
4808
                GList* category_name_collection = NULL;
 
4809
                GList* category_name_it = NULL;
 
4810
                category_name_collection = _tmp4_;
 
4811
                for (category_name_it = category_name_collection; category_name_it != NULL; category_name_it = category_name_it->next) {
 
4812
                        gchar* _tmp5_;
 
4813
                        gchar* category_name = NULL;
 
4814
                        _tmp5_ = g_strdup ((const gchar*) category_name_it->data);
 
4815
                        category_name = _tmp5_;
 
4816
                        {
 
4817
                                GeeHashSet* _tmp6_;
 
4818
                                const gchar* _tmp7_;
 
4819
                                GeeHashSet* _tmp8_;
 
4820
                                const gchar* _tmp9_;
 
4821
                                gboolean _tmp10_ = FALSE;
 
4822
                                _tmp6_ = new_categories;
 
4823
                                _tmp7_ = category_name;
 
4824
                                gee_abstract_collection_add ((GeeAbstractCollection*) _tmp6_, _tmp7_);
 
4825
                                _tmp8_ = self->priv->_groups;
 
4826
                                _tmp9_ = category_name;
 
4827
                                _tmp10_ = gee_abstract_collection_contains ((GeeAbstractCollection*) _tmp8_, _tmp9_);
 
4828
                                if (!_tmp10_) {
 
4829
                                        GeeLinkedList* _tmp11_;
 
4830
                                        const gchar* _tmp12_;
 
4831
                                        _tmp11_ = added_categories;
 
4832
                                        _tmp12_ = category_name;
 
4833
                                        gee_abstract_collection_add ((GeeAbstractCollection*) _tmp11_, _tmp12_);
 
4834
                                }
 
4835
                                _g_free0 (category_name);
 
4836
                        }
 
4837
                }
 
4838
        }
 
4839
        _tmp13_ = gee_linked_list_new (G_TYPE_STRING, (GBoxedCopyFunc) g_strdup, g_free, NULL);
 
4840
        removed_categories = _tmp13_;
 
4841
        {
 
4842
                GeeHashSet* _tmp14_;
 
4843
                GeeIterator* _tmp15_ = NULL;
 
4844
                GeeIterator* _category_name_it;
 
4845
                _tmp14_ = self->priv->_groups;
 
4846
                _tmp15_ = gee_abstract_collection_iterator ((GeeAbstractCollection*) _tmp14_);
 
4847
                _category_name_it = _tmp15_;
 
4848
                while (TRUE) {
 
4849
                        GeeIterator* _tmp16_;
 
4850
                        gboolean _tmp17_ = FALSE;
 
4851
                        GeeIterator* _tmp18_;
 
4852
                        gpointer _tmp19_ = NULL;
 
4853
                        gchar* category_name;
 
4854
                        GeeHashSet* _tmp20_;
 
4855
                        const gchar* _tmp21_;
 
4856
                        gboolean _tmp22_ = FALSE;
 
4857
                        _tmp16_ = _category_name_it;
 
4858
                        _tmp17_ = gee_iterator_next (_tmp16_);
 
4859
                        if (!_tmp17_) {
 
4860
                                break;
 
4861
                        }
 
4862
                        _tmp18_ = _category_name_it;
 
4863
                        _tmp19_ = gee_iterator_get (_tmp18_);
 
4864
                        category_name = (gchar*) _tmp19_;
 
4865
                        _tmp20_ = new_categories;
 
4866
                        _tmp21_ = category_name;
 
4867
                        _tmp22_ = gee_abstract_collection_contains ((GeeAbstractCollection*) _tmp20_, _tmp21_);
 
4868
                        if (!_tmp22_) {
 
4869
                                GeeLinkedList* _tmp23_;
 
4870
                                const gchar* _tmp24_;
 
4871
                                _tmp23_ = removed_categories;
 
4872
                                _tmp24_ = category_name;
 
4873
                                gee_abstract_collection_add ((GeeAbstractCollection*) _tmp23_, _tmp24_);
 
4874
                        }
 
4875
                        _g_free0 (category_name);
 
4876
                }
 
4877
                _g_object_unref0 (_category_name_it);
 
4878
        }
 
4879
        {
 
4880
                GeeLinkedList* _tmp25_;
 
4881
                GeeLinkedList* _tmp26_;
 
4882
                GeeLinkedList* _category_name_list;
 
4883
                GeeLinkedList* _tmp27_;
 
4884
                gint _tmp28_;
 
4885
                gint _tmp29_;
 
4886
                gint _category_name_size;
 
4887
                gint _category_name_index;
 
4888
                _tmp25_ = removed_categories;
 
4889
                _tmp26_ = _g_object_ref0 (_tmp25_);
 
4890
                _category_name_list = _tmp26_;
 
4891
                _tmp27_ = _category_name_list;
 
4892
                _tmp28_ = gee_collection_get_size ((GeeCollection*) _tmp27_);
 
4893
                _tmp29_ = _tmp28_;
 
4894
                _category_name_size = _tmp29_;
 
4895
                _category_name_index = -1;
 
4896
                while (TRUE) {
 
4897
                        gint _tmp30_;
 
4898
                        gint _tmp31_;
 
4899
                        gint _tmp32_;
 
4900
                        GeeLinkedList* _tmp33_;
 
4901
                        gint _tmp34_;
 
4902
                        gpointer _tmp35_ = NULL;
 
4903
                        gchar* category_name;
 
4904
                        const gchar* _tmp36_;
 
4905
                        GeeHashSet* _tmp37_;
 
4906
                        const gchar* _tmp38_;
 
4907
                        _tmp30_ = _category_name_index;
 
4908
                        _category_name_index = _tmp30_ + 1;
 
4909
                        _tmp31_ = _category_name_index;
 
4910
                        _tmp32_ = _category_name_size;
 
4911
                        if (!(_tmp31_ < _tmp32_)) {
 
4912
                                break;
 
4913
                        }
 
4914
                        _tmp33_ = _category_name_list;
 
4915
                        _tmp34_ = _category_name_index;
 
4916
                        _tmp35_ = gee_abstract_list_get ((GeeAbstractList*) _tmp33_, _tmp34_);
 
4917
                        category_name = (gchar*) _tmp35_;
 
4918
                        _tmp36_ = category_name;
 
4919
                        g_signal_emit_by_name ((FolksGroupDetails*) self, "group-changed", _tmp36_, FALSE);
 
4920
                        _tmp37_ = self->priv->_groups;
 
4921
                        _tmp38_ = category_name;
 
4922
                        gee_abstract_collection_remove ((GeeAbstractCollection*) _tmp37_, _tmp38_);
 
4923
                        _g_free0 (category_name);
 
4924
                }
 
4925
                _g_object_unref0 (_category_name_list);
 
4926
        }
 
4927
        {
 
4928
                GeeLinkedList* _tmp39_;
 
4929
                GeeLinkedList* _tmp40_;
 
4930
                GeeLinkedList* _category_name_list;
 
4931
                GeeLinkedList* _tmp41_;
 
4932
                gint _tmp42_;
 
4933
                gint _tmp43_;
 
4934
                gint _category_name_size;
 
4935
                gint _category_name_index;
 
4936
                _tmp39_ = added_categories;
 
4937
                _tmp40_ = _g_object_ref0 (_tmp39_);
 
4938
                _category_name_list = _tmp40_;
 
4939
                _tmp41_ = _category_name_list;
 
4940
                _tmp42_ = gee_collection_get_size ((GeeCollection*) _tmp41_);
 
4941
                _tmp43_ = _tmp42_;
 
4942
                _category_name_size = _tmp43_;
 
4943
                _category_name_index = -1;
 
4944
                while (TRUE) {
 
4945
                        gint _tmp44_;
 
4946
                        gint _tmp45_;
 
4947
                        gint _tmp46_;
 
4948
                        GeeLinkedList* _tmp47_;
 
4949
                        gint _tmp48_;
 
4950
                        gpointer _tmp49_ = NULL;
 
4951
                        gchar* category_name;
 
4952
                        GeeHashSet* _tmp50_;
 
4953
                        const gchar* _tmp51_;
 
4954
                        const gchar* _tmp52_;
 
4955
                        _tmp44_ = _category_name_index;
 
4956
                        _category_name_index = _tmp44_ + 1;
 
4957
                        _tmp45_ = _category_name_index;
 
4958
                        _tmp46_ = _category_name_size;
 
4959
                        if (!(_tmp45_ < _tmp46_)) {
 
4960
                                break;
 
4961
                        }
 
4962
                        _tmp47_ = _category_name_list;
 
4963
                        _tmp48_ = _category_name_index;
 
4964
                        _tmp49_ = gee_abstract_list_get ((GeeAbstractList*) _tmp47_, _tmp48_);
 
4965
                        category_name = (gchar*) _tmp49_;
 
4966
                        _tmp50_ = self->priv->_groups;
 
4967
                        _tmp51_ = category_name;
 
4968
                        gee_abstract_collection_add ((GeeAbstractCollection*) _tmp50_, _tmp51_);
 
4969
                        _tmp52_ = category_name;
 
4970
                        g_signal_emit_by_name ((FolksGroupDetails*) self, "group-changed", _tmp52_, TRUE);
 
4971
                        _g_free0 (category_name);
 
4972
                }
 
4973
                _g_object_unref0 (_category_name_list);
 
4974
        }
 
4975
        _tmp54_ = added_categories;
 
4976
        _tmp55_ = gee_collection_get_size ((GeeCollection*) _tmp54_);
 
4977
        _tmp56_ = _tmp55_;
 
4978
        if (_tmp56_ != 0) {
 
4979
                _tmp53_ = TRUE;
 
4980
        } else {
 
4981
                GeeLinkedList* _tmp57_;
 
4982
                gint _tmp58_;
 
4983
                gint _tmp59_;
 
4984
                _tmp57_ = removed_categories;
 
4985
                _tmp58_ = gee_collection_get_size ((GeeCollection*) _tmp57_);
 
4986
                _tmp59_ = _tmp58_;
 
4987
                _tmp53_ = _tmp59_ != 0;
 
4988
        }
 
4989
        _tmp60_ = _tmp53_;
 
4990
        if (_tmp60_) {
 
4991
                g_object_notify ((GObject*) self, "groups");
 
4992
        }
 
4993
        _g_object_unref0 (removed_categories);
 
4994
        _g_object_unref0 (added_categories);
 
4995
        _g_object_unref0 (new_categories);
 
4996
}
 
4997
 
 
4998
 
 
4999
/**
 
5000
   * build a table of im protocols / im protocol aliases
 
5001
   */
 
5002
static void _g_free0_ (gpointer var) {
 
5003
        var = (g_free (var), NULL);
 
5004
}
 
5005
 
 
5006
 
 
5007
static gpointer _g_hash_table_ref0 (gpointer self) {
 
5008
        return self ? g_hash_table_ref (self) : NULL;
 
5009
}
 
5010
 
 
5011
 
 
5012
GHashTable* _edsf_persona_get_im_eds_map (void) {
 
5013
        GHashTable* result = NULL;
 
5014
        GHashTable* _tmp22_;
 
5015
        GHashTable* _tmp23_;
 
5016
        GError * _inner_error_ = NULL;
 
5017
        {
 
5018
                GHashTable* _tmp0_;
 
5019
                _tmp0_ = edsf_persona__im_eds_map;
 
5020
                g_static_rec_mutex_lock (&__lock_edsf_persona__im_eds_map);
 
5021
                {
 
5022
                        GHashTable* _tmp1_;
 
5023
                        _tmp1_ = edsf_persona__im_eds_map;
 
5024
                        if (_tmp1_ == NULL) {
 
5025
                                GHashFunc _tmp2_;
 
5026
                                GEqualFunc _tmp3_;
 
5027
                                GHashTable* _tmp4_;
 
5028
                                GHashTable* _tmp5_;
 
5029
                                gchar* _tmp6_;
 
5030
                                GHashTable* _tmp7_;
 
5031
                                gchar* _tmp8_;
 
5032
                                GHashTable* _tmp9_;
 
5033
                                gchar* _tmp10_;
 
5034
                                GHashTable* _tmp11_;
 
5035
                                gchar* _tmp12_;
 
5036
                                GHashTable* _tmp13_;
 
5037
                                gchar* _tmp14_;
 
5038
                                GHashTable* _tmp15_;
 
5039
                                gchar* _tmp16_;
 
5040
                                GHashTable* _tmp17_;
 
5041
                                gchar* _tmp18_;
 
5042
                                GHashTable* _tmp19_;
 
5043
                                gchar* _tmp20_;
 
5044
                                _tmp2_ = g_str_hash;
 
5045
                                _tmp3_ = g_str_equal;
 
5046
                                _tmp4_ = g_hash_table_new_full (_tmp2_, _tmp3_, _g_free0_, NULL);
 
5047
                                _g_hash_table_unref0 (edsf_persona__im_eds_map);
 
5048
                                edsf_persona__im_eds_map = _tmp4_;
 
5049
                                _tmp5_ = edsf_persona__im_eds_map;
 
5050
                                _tmp6_ = g_strdup ("aim");
 
5051
                                g_hash_table_insert (_tmp5_, _tmp6_, GINT_TO_POINTER (E_CONTACT_IM_AIM));
 
5052
                                _tmp7_ = edsf_persona__im_eds_map;
 
5053
                                _tmp8_ = g_strdup ("yahoo");
 
5054
                                g_hash_table_insert (_tmp7_, _tmp8_, GINT_TO_POINTER (E_CONTACT_IM_YAHOO));
 
5055
                                _tmp9_ = edsf_persona__im_eds_map;
 
5056
                                _tmp10_ = g_strdup ("groupwise");
 
5057
                                g_hash_table_insert (_tmp9_, _tmp10_, GINT_TO_POINTER (E_CONTACT_IM_GROUPWISE));
 
5058
                                _tmp11_ = edsf_persona__im_eds_map;
 
5059
                                _tmp12_ = g_strdup ("jabber");
 
5060
                                g_hash_table_insert (_tmp11_, _tmp12_, GINT_TO_POINTER (E_CONTACT_IM_JABBER));
 
5061
                                _tmp13_ = edsf_persona__im_eds_map;
 
5062
                                _tmp14_ = g_strdup ("msn");
 
5063
                                g_hash_table_insert (_tmp13_, _tmp14_, GINT_TO_POINTER (E_CONTACT_IM_MSN));
 
5064
                                _tmp15_ = edsf_persona__im_eds_map;
 
5065
                                _tmp16_ = g_strdup ("icq");
 
5066
                                g_hash_table_insert (_tmp15_, _tmp16_, GINT_TO_POINTER (E_CONTACT_IM_ICQ));
 
5067
                                _tmp17_ = edsf_persona__im_eds_map;
 
5068
                                _tmp18_ = g_strdup ("gadugadu");
 
5069
                                g_hash_table_insert (_tmp17_, _tmp18_, GINT_TO_POINTER (E_CONTACT_IM_GADUGADU));
 
5070
                                _tmp19_ = edsf_persona__im_eds_map;
 
5071
                                _tmp20_ = g_strdup ("skype");
 
5072
                                g_hash_table_insert (_tmp19_, _tmp20_, GINT_TO_POINTER (E_CONTACT_IM_SKYPE));
 
5073
                        }
 
5074
                }
 
5075
                __finally4:
 
5076
                {
 
5077
                        GHashTable* _tmp21_;
 
5078
                        _tmp21_ = edsf_persona__im_eds_map;
 
5079
                        g_static_rec_mutex_unlock (&__lock_edsf_persona__im_eds_map);
 
5080
                }
 
5081
                if (_inner_error_ != NULL) {
 
5082
                        g_critical ("file %s: line %d: uncaught error: %s (%s, %d)", __FILE__, __LINE__, _inner_error_->message, g_quark_to_string (_inner_error_->domain), _inner_error_->code);
 
5083
                        g_clear_error (&_inner_error_);
 
5084
                        return NULL;
 
5085
                }
 
5086
        }
 
5087
        _tmp22_ = edsf_persona__im_eds_map;
 
5088
        _tmp23_ = _g_hash_table_ref0 (_tmp22_);
 
5089
        result = _tmp23_;
 
5090
        return result;
 
5091
}
 
5092
 
 
5093
 
 
5094
static void _edsf_persona_update_phones (EdsfPersona* self) {
 
5095
        GeeHashSet* _tmp0_;
 
5096
        GeeHashSet* new_phone_numbers;
 
5097
        EContact* _tmp1_;
 
5098
        GList* _tmp2_ = NULL;
 
5099
        GList* attrs;
 
5100
        GList* _tmp3_;
 
5101
        EdsfSetComparator* _tmp14_;
 
5102
        EdsfSetComparator* comp;
 
5103
        EdsfSetComparator* _tmp15_;
 
5104
        GeeHashSet* _tmp16_;
 
5105
        GeeHashSet* _tmp17_;
 
5106
        gboolean _tmp18_ = FALSE;
 
5107
        g_return_if_fail (self != NULL);
 
5108
        _tmp0_ = gee_hash_set_new (FOLKS_TYPE_PHONE_FIELD_DETAILS, (GBoxedCopyFunc) g_object_ref, g_object_unref, (GHashFunc) folks_abstract_field_details_hash, (GEqualFunc) folks_abstract_field_details_equal);
 
5109
        new_phone_numbers = _tmp0_;
 
5110
        _tmp1_ = self->priv->_contact;
 
5111
        _tmp2_ = e_contact_get_attributes (_tmp1_, E_CONTACT_TEL);
 
5112
        attrs = _tmp2_;
 
5113
        _tmp3_ = attrs;
 
5114
        {
 
5115
                GList* attr_collection = NULL;
 
5116
                GList* attr_it = NULL;
 
5117
                attr_collection = _tmp3_;
 
5118
                for (attr_it = attr_collection; attr_it != NULL; attr_it = attr_it->next) {
 
5119
                        EVCardAttribute* _tmp4_;
 
5120
                        EVCardAttribute* attr = NULL;
 
5121
                        _tmp4_ = __vala_EVCardAttribute_copy0 ((EVCardAttribute*) attr_it->data);
 
5122
                        attr = _tmp4_;
 
5123
                        {
 
5124
                                EVCardAttribute* _tmp5_;
 
5125
                                gchar* _tmp6_ = NULL;
 
5126
                                gchar* _tmp7_;
 
5127
                                FolksPhoneFieldDetails* _tmp8_;
 
5128
                                FolksPhoneFieldDetails* _tmp9_;
 
5129
                                FolksPhoneFieldDetails* phone_fd;
 
5130
                                FolksPhoneFieldDetails* _tmp10_;
 
5131
                                EVCardAttribute* _tmp11_;
 
5132
                                GeeHashSet* _tmp12_;
 
5133
                                FolksPhoneFieldDetails* _tmp13_;
 
5134
                                _tmp5_ = attr;
 
5135
                                _tmp6_ = e_vcard_attribute_get_value (_tmp5_);
 
5136
                                _tmp7_ = _tmp6_;
 
5137
                                _tmp8_ = folks_phone_field_details_new (_tmp7_, NULL);
 
5138
                                _tmp9_ = _tmp8_;
 
5139
                                _g_free0 (_tmp7_);
 
5140
                                phone_fd = _tmp9_;
 
5141
                                _tmp10_ = phone_fd;
 
5142
                                _tmp11_ = attr;
 
5143
                                _edsf_persona_update_params (self, (FolksAbstractFieldDetails*) _tmp10_, _tmp11_);
 
5144
                                _tmp12_ = new_phone_numbers;
 
5145
                                _tmp13_ = phone_fd;
 
5146
                                gee_abstract_collection_add ((GeeAbstractCollection*) _tmp12_, _tmp13_);
 
5147
                                _g_object_unref0 (phone_fd);
 
5148
                                __vala_EVCardAttribute_free0 (attr);
 
5149
                        }
 
5150
                }
 
5151
        }
 
5152
        _tmp14_ = edsf_set_comparator_new (FOLKS_TYPE_PHONE_FIELD_DETAILS, (GBoxedCopyFunc) g_object_ref, g_object_unref);
 
5153
        comp = _tmp14_;
 
5154
        _tmp15_ = comp;
 
5155
        _tmp16_ = new_phone_numbers;
 
5156
        _tmp17_ = self->priv->_phone_numbers;
 
5157
        _tmp18_ = edsf_set_comparator_equal (_tmp15_, (GeeSet*) _tmp16_, (GeeSet*) _tmp17_);
 
5158
        if (!_tmp18_) {
 
5159
                GeeHashSet* _tmp19_;
 
5160
                GeeHashSet* _tmp20_;
 
5161
                GeeHashSet* _tmp21_;
 
5162
                GeeSet* _tmp22_;
 
5163
                GeeSet* _tmp23_;
 
5164
                _tmp19_ = new_phone_numbers;
 
5165
                _tmp20_ = _g_object_ref0 (_tmp19_);
 
5166
                _g_object_unref0 (self->priv->_phone_numbers);
 
5167
                self->priv->_phone_numbers = _tmp20_;
 
5168
                _tmp21_ = new_phone_numbers;
 
5169
                _tmp22_ = gee_abstract_set_get_read_only_view ((GeeAbstractSet*) _tmp21_);
 
5170
                _tmp23_ = _tmp22_;
 
5171
                _g_object_unref0 (self->priv->_phone_numbers_ro);
 
5172
                self->priv->_phone_numbers_ro = _tmp23_;
 
5173
                g_object_notify ((GObject*) self, "phone-numbers");
 
5174
        }
 
5175
        _g_object_unref0 (comp);
 
5176
        __g_list_free___vala_EVCardAttribute_free0_0 (attrs);
 
5177
        _g_object_unref0 (new_phone_numbers);
 
5178
}
 
5179
 
 
5180
 
 
5181
static FolksPostalAddress* _edsf_persona_postal_address_from_attribute (EdsfPersona* self, EVCardAttribute* attr) {
 
5182
        FolksPostalAddress* result = NULL;
 
5183
        EVCardAttribute* _tmp0_;
 
5184
        GList* _tmp1_ = NULL;
 
5185
        GList* values;
 
5186
        GList* _tmp2_;
 
5187
        GList* l;
 
5188
        gchar* _tmp3_;
 
5189
        gchar* address_format;
 
5190
        gchar* _tmp4_;
 
5191
        gchar* po_box;
 
5192
        gchar* _tmp5_;
 
5193
        gchar* extension;
 
5194
        gchar* _tmp6_;
 
5195
        gchar* street;
 
5196
        gchar* _tmp7_;
 
5197
        gchar* locality;
 
5198
        gchar* _tmp8_;
 
5199
        gchar* region;
 
5200
        gchar* _tmp9_;
 
5201
        gchar* postal_code;
 
5202
        gchar* _tmp10_;
 
5203
        gchar* country;
 
5204
        GList* _tmp11_;
 
5205
        GList* _tmp17_;
 
5206
        GList* _tmp23_;
 
5207
        GList* _tmp29_;
 
5208
        GList* _tmp35_;
 
5209
        GList* _tmp41_;
 
5210
        GList* _tmp47_;
 
5211
        const gchar* _tmp53_;
 
5212
        const gchar* _tmp54_;
 
5213
        const gchar* _tmp55_;
 
5214
        const gchar* _tmp56_;
 
5215
        const gchar* _tmp57_;
 
5216
        const gchar* _tmp58_;
 
5217
        const gchar* _tmp59_;
 
5218
        const gchar* _tmp60_;
 
5219
        FolksPostalAddress* _tmp61_;
 
5220
        g_return_val_if_fail (self != NULL, NULL);
 
5221
        g_return_val_if_fail (attr != NULL, NULL);
 
5222
        _tmp0_ = attr;
 
5223
        _tmp1_ = e_vcard_attribute_get_values (_tmp0_);
 
5224
        values = _tmp1_;
 
5225
        _tmp2_ = values;
 
5226
        l = _tmp2_;
 
5227
        _tmp3_ = g_strdup ("");
 
5228
        address_format = _tmp3_;
 
5229
        _tmp4_ = g_strdup ("");
 
5230
        po_box = _tmp4_;
 
5231
        _tmp5_ = g_strdup ("");
 
5232
        extension = _tmp5_;
 
5233
        _tmp6_ = g_strdup ("");
 
5234
        street = _tmp6_;
 
5235
        _tmp7_ = g_strdup ("");
 
5236
        locality = _tmp7_;
 
5237
        _tmp8_ = g_strdup ("");
 
5238
        region = _tmp8_;
 
5239
        _tmp9_ = g_strdup ("");
 
5240
        postal_code = _tmp9_;
 
5241
        _tmp10_ = g_strdup ("");
 
5242
        country = _tmp10_;
 
5243
        _tmp11_ = l;
 
5244
        if (_tmp11_ != NULL) {
 
5245
                GList* _tmp12_;
 
5246
                gconstpointer _tmp13_;
 
5247
                gchar* _tmp14_;
 
5248
                GList* _tmp15_;
 
5249
                GList* _tmp16_;
 
5250
                _tmp12_ = l;
 
5251
                _tmp13_ = _tmp12_->data;
 
5252
                _tmp14_ = g_strdup ((const gchar*) _tmp13_);
 
5253
                _g_free0 (po_box);
 
5254
                po_box = _tmp14_;
 
5255
                _tmp15_ = l;
 
5256
                _tmp16_ = _tmp15_->next;
 
5257
                l = _tmp16_;
 
5258
        }
 
5259
        _tmp17_ = l;
 
5260
        if (_tmp17_ != NULL) {
 
5261
                GList* _tmp18_;
 
5262
                gconstpointer _tmp19_;
 
5263
                gchar* _tmp20_;
 
5264
                GList* _tmp21_;
 
5265
                GList* _tmp22_;
 
5266
                _tmp18_ = l;
 
5267
                _tmp19_ = _tmp18_->data;
 
5268
                _tmp20_ = g_strdup ((const gchar*) _tmp19_);
 
5269
                _g_free0 (extension);
 
5270
                extension = _tmp20_;
 
5271
                _tmp21_ = l;
 
5272
                _tmp22_ = _tmp21_->next;
 
5273
                l = _tmp22_;
 
5274
        }
 
5275
        _tmp23_ = l;
 
5276
        if (_tmp23_ != NULL) {
 
5277
                GList* _tmp24_;
 
5278
                gconstpointer _tmp25_;
 
5279
                gchar* _tmp26_;
 
5280
                GList* _tmp27_;
 
5281
                GList* _tmp28_;
 
5282
                _tmp24_ = l;
 
5283
                _tmp25_ = _tmp24_->data;
 
5284
                _tmp26_ = g_strdup ((const gchar*) _tmp25_);
 
5285
                _g_free0 (street);
 
5286
                street = _tmp26_;
 
5287
                _tmp27_ = l;
 
5288
                _tmp28_ = _tmp27_->next;
 
5289
                l = _tmp28_;
 
5290
        }
 
5291
        _tmp29_ = l;
 
5292
        if (_tmp29_ != NULL) {
 
5293
                GList* _tmp30_;
 
5294
                gconstpointer _tmp31_;
 
5295
                gchar* _tmp32_;
 
5296
                GList* _tmp33_;
 
5297
                GList* _tmp34_;
 
5298
                _tmp30_ = l;
 
5299
                _tmp31_ = _tmp30_->data;
 
5300
                _tmp32_ = g_strdup ((const gchar*) _tmp31_);
 
5301
                _g_free0 (locality);
 
5302
                locality = _tmp32_;
 
5303
                _tmp33_ = l;
 
5304
                _tmp34_ = _tmp33_->next;
 
5305
                l = _tmp34_;
 
5306
        }
 
5307
        _tmp35_ = l;
 
5308
        if (_tmp35_ != NULL) {
 
5309
                GList* _tmp36_;
 
5310
                gconstpointer _tmp37_;
 
5311
                gchar* _tmp38_;
 
5312
                GList* _tmp39_;
 
5313
                GList* _tmp40_;
 
5314
                _tmp36_ = l;
 
5315
                _tmp37_ = _tmp36_->data;
 
5316
                _tmp38_ = g_strdup ((const gchar*) _tmp37_);
 
5317
                _g_free0 (region);
 
5318
                region = _tmp38_;
 
5319
                _tmp39_ = l;
 
5320
                _tmp40_ = _tmp39_->next;
 
5321
                l = _tmp40_;
 
5322
        }
 
5323
        _tmp41_ = l;
 
5324
        if (_tmp41_ != NULL) {
 
5325
                GList* _tmp42_;
 
5326
                gconstpointer _tmp43_;
 
5327
                gchar* _tmp44_;
 
5328
                GList* _tmp45_;
 
5329
                GList* _tmp46_;
 
5330
                _tmp42_ = l;
 
5331
                _tmp43_ = _tmp42_->data;
 
5332
                _tmp44_ = g_strdup ((const gchar*) _tmp43_);
 
5333
                _g_free0 (postal_code);
 
5334
                postal_code = _tmp44_;
 
5335
                _tmp45_ = l;
 
5336
                _tmp46_ = _tmp45_->next;
 
5337
                l = _tmp46_;
 
5338
        }
 
5339
        _tmp47_ = l;
 
5340
        if (_tmp47_ != NULL) {
 
5341
                GList* _tmp48_;
 
5342
                gconstpointer _tmp49_;
 
5343
                gchar* _tmp50_;
 
5344
                GList* _tmp51_;
 
5345
                GList* _tmp52_;
 
5346
                _tmp48_ = l;
 
5347
                _tmp49_ = _tmp48_->data;
 
5348
                _tmp50_ = g_strdup ((const gchar*) _tmp49_);
 
5349
                _g_free0 (country);
 
5350
                country = _tmp50_;
 
5351
                _tmp51_ = l;
 
5352
                _tmp52_ = _tmp51_->next;
 
5353
                l = _tmp52_;
 
5354
        }
 
5355
        _tmp53_ = po_box;
 
5356
        _tmp54_ = extension;
 
5357
        _tmp55_ = street;
 
5358
        _tmp56_ = locality;
 
5359
        _tmp57_ = region;
 
5360
        _tmp58_ = postal_code;
 
5361
        _tmp59_ = country;
 
5362
        _tmp60_ = address_format;
 
5363
        _tmp61_ = folks_postal_address_new (_tmp53_, _tmp54_, _tmp55_, _tmp56_, _tmp57_, _tmp58_, _tmp59_, _tmp60_, NULL);
 
5364
        result = _tmp61_;
 
5365
        _g_free0 (country);
 
5366
        _g_free0 (postal_code);
 
5367
        _g_free0 (region);
 
5368
        _g_free0 (locality);
 
5369
        _g_free0 (street);
 
5370
        _g_free0 (extension);
 
5371
        _g_free0 (po_box);
 
5372
        _g_free0 (address_format);
 
5373
        return result;
 
5374
}
 
5375
 
 
5376
 
 
5377
static void _edsf_persona_update_addresses (EdsfPersona* self) {
 
5378
        GeeHashSet* _tmp0_;
 
5379
        GeeHashSet* new_postal_addresses;
 
5380
        EContact* _tmp1_;
 
5381
        GList* _tmp2_ = NULL;
 
5382
        GList* attrs;
 
5383
        GList* _tmp3_;
 
5384
        EdsfSetComparator* _tmp13_;
 
5385
        EdsfSetComparator* comp;
 
5386
        EdsfSetComparator* _tmp14_;
 
5387
        GeeHashSet* _tmp15_;
 
5388
        GeeHashSet* _tmp16_;
 
5389
        gboolean _tmp17_ = FALSE;
 
5390
        g_return_if_fail (self != NULL);
 
5391
        _tmp0_ = gee_hash_set_new (FOLKS_TYPE_POSTAL_ADDRESS_FIELD_DETAILS, (GBoxedCopyFunc) g_object_ref, g_object_unref, (GHashFunc) folks_abstract_field_details_hash, (GEqualFunc) folks_abstract_field_details_equal);
 
5392
        new_postal_addresses = _tmp0_;
 
5393
        _tmp1_ = self->priv->_contact;
 
5394
        _tmp2_ = e_contact_get_attributes (_tmp1_, E_CONTACT_ADDRESS);
 
5395
        attrs = _tmp2_;
 
5396
        _tmp3_ = attrs;
 
5397
        {
 
5398
                GList* attr_collection = NULL;
 
5399
                GList* attr_it = NULL;
 
5400
                attr_collection = _tmp3_;
 
5401
                for (attr_it = attr_collection; attr_it != NULL; attr_it = attr_it->next) {
 
5402
                        EVCardAttribute* attr = NULL;
 
5403
                        attr = (EVCardAttribute*) attr_it->data;
 
5404
                        {
 
5405
                                EVCardAttribute* _tmp4_;
 
5406
                                FolksPostalAddress* _tmp5_ = NULL;
 
5407
                                FolksPostalAddress* _tmp6_;
 
5408
                                FolksPostalAddressFieldDetails* _tmp7_;
 
5409
                                FolksPostalAddressFieldDetails* _tmp8_;
 
5410
                                FolksPostalAddressFieldDetails* pa_fd;
 
5411
                                FolksPostalAddressFieldDetails* _tmp9_;
 
5412
                                EVCardAttribute* _tmp10_;
 
5413
                                GeeHashSet* _tmp11_;
 
5414
                                FolksPostalAddressFieldDetails* _tmp12_;
 
5415
                                _tmp4_ = attr;
 
5416
                                _tmp5_ = _edsf_persona_postal_address_from_attribute (self, _tmp4_);
 
5417
                                _tmp6_ = _tmp5_;
 
5418
                                _tmp7_ = folks_postal_address_field_details_new (_tmp6_, NULL);
 
5419
                                _tmp8_ = _tmp7_;
 
5420
                                _g_object_unref0 (_tmp6_);
 
5421
                                pa_fd = _tmp8_;
 
5422
                                _tmp9_ = pa_fd;
 
5423
                                _tmp10_ = attr;
 
5424
                                _edsf_persona_update_params (self, (FolksAbstractFieldDetails*) _tmp9_, _tmp10_);
 
5425
                                _tmp11_ = new_postal_addresses;
 
5426
                                _tmp12_ = pa_fd;
 
5427
                                gee_abstract_collection_add ((GeeAbstractCollection*) _tmp11_, _tmp12_);
 
5428
                                _g_object_unref0 (pa_fd);
 
5429
                        }
 
5430
                }
 
5431
        }
 
5432
        _tmp13_ = edsf_set_comparator_new (FOLKS_TYPE_POSTAL_ADDRESS_FIELD_DETAILS, (GBoxedCopyFunc) g_object_ref, g_object_unref);
 
5433
        comp = _tmp13_;
 
5434
        _tmp14_ = comp;
 
5435
        _tmp15_ = new_postal_addresses;
 
5436
        _tmp16_ = self->priv->_postal_addresses;
 
5437
        _tmp17_ = edsf_set_comparator_equal (_tmp14_, (GeeSet*) _tmp15_, (GeeSet*) _tmp16_);
 
5438
        if (!_tmp17_) {
 
5439
                GeeHashSet* _tmp18_;
 
5440
                GeeHashSet* _tmp19_;
 
5441
                GeeHashSet* _tmp20_;
 
5442
                GeeSet* _tmp21_;
 
5443
                GeeSet* _tmp22_;
 
5444
                _tmp18_ = new_postal_addresses;
 
5445
                _tmp19_ = _g_object_ref0 (_tmp18_);
 
5446
                _g_object_unref0 (self->priv->_postal_addresses);
 
5447
                self->priv->_postal_addresses = _tmp19_;
 
5448
                _tmp20_ = new_postal_addresses;
 
5449
                _tmp21_ = gee_abstract_set_get_read_only_view ((GeeAbstractSet*) _tmp20_);
 
5450
                _tmp22_ = _tmp21_;
 
5451
                _g_object_unref0 (self->priv->_postal_addresses_ro);
 
5452
                self->priv->_postal_addresses_ro = _tmp22_;
 
5453
                g_object_notify ((GObject*) self, "phone-numbers");
 
5454
        }
 
5455
        g_object_notify ((GObject*) self, "postal-addresses");
 
5456
        _g_object_unref0 (comp);
 
5457
        __g_list_free___vala_EVCardAttribute_free0_0 (attrs);
 
5458
        _g_object_unref0 (new_postal_addresses);
 
5459
}
 
5460
 
 
5461
 
 
5462
static void _edsf_persona_update_local_ids (EdsfPersona* self) {
 
5463
        GeeHashSet* _tmp0_;
 
5464
        GeeHashSet* new_local_ids;
 
5465
        EContact* _tmp1_;
 
5466
        EVCardAttribute* _tmp2_ = NULL;
 
5467
        EVCardAttribute* _tmp3_;
 
5468
        EVCardAttribute* ids;
 
5469
        EVCardAttribute* _tmp4_;
 
5470
        GeeHashSet* _tmp11_;
 
5471
        const gchar* _tmp12_;
 
5472
        const gchar* _tmp13_;
 
5473
        EdsfSetComparator* _tmp14_;
 
5474
        EdsfSetComparator* comp;
 
5475
        EdsfSetComparator* _tmp15_;
 
5476
        GeeHashSet* _tmp16_;
 
5477
        GeeSet* _tmp17_;
 
5478
        GeeSet* _tmp18_;
 
5479
        gboolean _tmp19_ = FALSE;
 
5480
        g_return_if_fail (self != NULL);
 
5481
        _tmp0_ = gee_hash_set_new (G_TYPE_STRING, (GBoxedCopyFunc) g_strdup, g_free, NULL, NULL);
 
5482
        new_local_ids = _tmp0_;
 
5483
        _tmp1_ = self->priv->_contact;
 
5484
        _tmp2_ = e_vcard_get_attribute ((EVCard*) _tmp1_, "X-FOLKS-CONTACTS-IDS");
 
5485
        _tmp3_ = __vala_EVCardAttribute_copy0 (_tmp2_);
 
5486
        ids = _tmp3_;
 
5487
        _tmp4_ = ids;
 
5488
        if (_tmp4_ != NULL) {
 
5489
                EVCardAttribute* _tmp5_;
 
5490
                GList* _tmp6_ = NULL;
 
5491
                GList* ids_v;
 
5492
                GList* _tmp7_;
 
5493
                _tmp5_ = ids;
 
5494
                _tmp6_ = e_vcard_attribute_get_values (_tmp5_);
 
5495
                ids_v = _tmp6_;
 
5496
                _tmp7_ = ids_v;
 
5497
                {
 
5498
                        GList* local_id_collection = NULL;
 
5499
                        GList* local_id_it = NULL;
 
5500
                        local_id_collection = _tmp7_;
 
5501
                        for (local_id_it = local_id_collection; local_id_it != NULL; local_id_it = local_id_it->next) {
 
5502
                                gchar* _tmp8_;
 
5503
                                gchar* local_id = NULL;
 
5504
                                _tmp8_ = g_strdup ((const gchar*) local_id_it->data);
 
5505
                                local_id = _tmp8_;
 
5506
                                {
 
5507
                                        GeeHashSet* _tmp9_;
 
5508
                                        const gchar* _tmp10_;
 
5509
                                        _tmp9_ = new_local_ids;
 
5510
                                        _tmp10_ = local_id;
 
5511
                                        gee_abstract_collection_add ((GeeAbstractCollection*) _tmp9_, _tmp10_);
 
5512
                                        _g_free0 (local_id);
 
5513
                                }
 
5514
                        }
 
5515
                }
 
5516
        }
 
5517
        _tmp11_ = new_local_ids;
 
5518
        _tmp12_ = folks_persona_get_iid ((FolksPersona*) self);
 
5519
        _tmp13_ = _tmp12_;
 
5520
        gee_abstract_collection_add ((GeeAbstractCollection*) _tmp11_, _tmp13_);
 
5521
        _tmp14_ = edsf_set_comparator_new (G_TYPE_STRING, (GBoxedCopyFunc) g_strdup, g_free);
 
5522
        comp = _tmp14_;
 
5523
        _tmp15_ = comp;
 
5524
        _tmp16_ = new_local_ids;
 
5525
        _tmp17_ = folks_local_id_details_get_local_ids ((FolksLocalIdDetails*) self);
 
5526
        _tmp18_ = _tmp17_;
 
5527
        _tmp19_ = edsf_set_comparator_equal (_tmp15_, (GeeSet*) _tmp16_, _tmp18_);
 
5528
        if (!_tmp19_) {
 
5529
                GeeHashSet* _tmp20_;
 
5530
                GeeHashSet* _tmp21_;
 
5531
                GeeHashSet* _tmp22_;
 
5532
                GeeSet* _tmp23_;
 
5533
                GeeSet* _tmp24_;
 
5534
                _tmp20_ = new_local_ids;
 
5535
                _tmp21_ = _g_object_ref0 (_tmp20_);
 
5536
                _g_object_unref0 (self->priv->_local_ids);
 
5537
                self->priv->_local_ids = _tmp21_;
 
5538
                _tmp22_ = self->priv->_local_ids;
 
5539
                _tmp23_ = gee_abstract_set_get_read_only_view ((GeeAbstractSet*) _tmp22_);
 
5540
                _tmp24_ = _tmp23_;
 
5541
                _g_object_unref0 (self->priv->_local_ids_ro);
 
5542
                self->priv->_local_ids_ro = _tmp24_;
 
5543
                g_object_notify ((GObject*) self, "local-ids");
 
5544
        }
 
5545
        _g_object_unref0 (comp);
 
5546
        __vala_EVCardAttribute_free0 (ids);
 
5547
        _g_object_unref0 (new_local_ids);
 
5548
}
 
5549
 
 
5550
 
 
5551
void* _edsf_persona_get_property_from_contact (EContact* contact, const gchar* prop_name) {
 
5552
        void* result = NULL;
 
5553
        void* prop_value;
 
5554
        EContact* _tmp0_;
 
5555
        const gchar* _tmp1_;
 
5556
        EContactField _tmp2_ = 0;
 
5557
        void* _tmp3_ = NULL;
 
5558
        void* _tmp4_;
 
5559
        g_return_val_if_fail (contact != NULL, NULL);
 
5560
        g_return_val_if_fail (prop_name != NULL, NULL);
 
5561
        prop_value = NULL;
 
5562
        _tmp0_ = contact;
 
5563
        _tmp1_ = prop_name;
 
5564
        _tmp2_ = e_contact_field_id (_tmp1_);
 
5565
        _tmp3_ = e_contact_get (_tmp0_, _tmp2_);
 
5566
        prop_value = _tmp3_;
 
5567
        _tmp4_ = prop_value;
 
5568
        result = _tmp4_;
 
5569
        return result;
 
5570
}
 
5571
 
 
5572
 
 
5573
static void* _edsf_persona_get_property (EdsfPersona* self, const gchar* prop_name) {
 
5574
        void* result = NULL;
 
5575
        EContact* _tmp0_;
 
5576
        const gchar* _tmp1_;
 
5577
        void* _tmp2_ = NULL;
 
5578
        g_return_val_if_fail (self != NULL, NULL);
 
5579
        g_return_val_if_fail (prop_name != NULL, NULL);
 
5580
        _tmp0_ = self->priv->_contact;
 
5581
        _tmp1_ = prop_name;
 
5582
        _tmp2_ = _edsf_persona_get_property_from_contact (_tmp0_, _tmp1_);
 
5583
        result = _tmp2_;
 
5584
        return result;
 
5585
}
 
5586
 
 
5587
 
 
5588
static gint string_index_of (const gchar* self, const gchar* needle, gint start_index) {
 
5589
        gint result = 0;
 
5590
        gint _tmp0_;
 
5591
        const gchar* _tmp1_;
 
5592
        gchar* _tmp2_ = NULL;
 
5593
        gchar* _result_;
 
5594
        gchar* _tmp3_;
 
5595
        g_return_val_if_fail (self != NULL, 0);
 
5596
        g_return_val_if_fail (needle != NULL, 0);
 
5597
        _tmp0_ = start_index;
 
5598
        _tmp1_ = needle;
 
5599
        _tmp2_ = strstr (((gchar*) self) + _tmp0_, (gchar*) _tmp1_);
 
5600
        _result_ = _tmp2_;
 
5601
        _tmp3_ = _result_;
 
5602
        if (_tmp3_ != NULL) {
 
5603
                gchar* _tmp4_;
 
5604
                _tmp4_ = _result_;
 
5605
                result = (gint) (_tmp4_ - ((gchar*) self));
 
5606
                return result;
 
5607
        } else {
 
5608
                result = -1;
 
5609
                return result;
 
5610
        }
 
5611
}
 
5612
 
 
5613
 
 
5614
static gchar* _edsf_persona_im_proto_from_addr (EdsfPersona* self, const gchar* addr) {
 
5615
        gchar* result = NULL;
 
5616
        const gchar* _tmp0_;
 
5617
        gint _tmp1_ = 0;
 
5618
        const gchar* _tmp2_;
 
5619
        gchar** _tmp3_;
 
5620
        gchar** _tmp4_ = NULL;
 
5621
        gchar** tokens;
 
5622
        gint tokens_length1;
 
5623
        gint _tokens_size_;
 
5624
        gchar** _tmp5_;
 
5625
        gint _tmp5__length1;
 
5626
        gchar** _tmp6_;
 
5627
        gint _tmp6__length1;
 
5628
        const gchar* _tmp7_;
 
5629
        gchar* _tmp8_;
 
5630
        gchar* domain;
 
5631
        const gchar* _tmp9_;
 
5632
        gint _tmp10_ = 0;
 
5633
        const gchar* _tmp11_;
 
5634
        gchar** _tmp12_;
 
5635
        gchar** _tmp13_ = NULL;
 
5636
        gchar** _tmp14_;
 
5637
        gint _tmp14__length1;
 
5638
        gchar** _tmp15_;
 
5639
        gint _tmp15__length1;
 
5640
        const gchar* _tmp16_;
 
5641
        gchar* _tmp17_;
 
5642
        gboolean _tmp18_ = FALSE;
 
5643
        gboolean _tmp19_ = FALSE;
 
5644
        const gchar* _tmp20_;
 
5645
        gboolean _tmp22_;
 
5646
        gboolean _tmp24_;
 
5647
        g_return_val_if_fail (self != NULL, NULL);
 
5648
        g_return_val_if_fail (addr != NULL, NULL);
 
5649
        _tmp0_ = addr;
 
5650
        _tmp1_ = string_index_of (_tmp0_, "@", 0);
 
5651
        if (_tmp1_ == (-1)) {
 
5652
                result = NULL;
 
5653
                return result;
 
5654
        }
 
5655
        _tmp2_ = addr;
 
5656
        _tmp4_ = _tmp3_ = g_strsplit (_tmp2_, "@", 2);
 
5657
        tokens = _tmp4_;
 
5658
        tokens_length1 = _vala_array_length (_tmp3_);
 
5659
        _tokens_size_ = tokens_length1;
 
5660
        _tmp5_ = tokens;
 
5661
        _tmp5__length1 = tokens_length1;
 
5662
        if (_tmp5__length1 != 2) {
 
5663
                result = NULL;
 
5664
                tokens = (_vala_array_free (tokens, tokens_length1, (GDestroyNotify) g_free), NULL);
 
5665
                return result;
 
5666
        }
 
5667
        _tmp6_ = tokens;
 
5668
        _tmp6__length1 = tokens_length1;
 
5669
        _tmp7_ = _tmp6_[1];
 
5670
        _tmp8_ = g_strdup (_tmp7_);
 
5671
        domain = _tmp8_;
 
5672
        _tmp9_ = domain;
 
5673
        _tmp10_ = string_index_of (_tmp9_, ".", 0);
 
5674
        if (_tmp10_ == (-1)) {
 
5675
                result = NULL;
 
5676
                _g_free0 (domain);
 
5677
                tokens = (_vala_array_free (tokens, tokens_length1, (GDestroyNotify) g_free), NULL);
 
5678
                return result;
 
5679
        }
 
5680
        _tmp11_ = domain;
 
5681
        _tmp13_ = _tmp12_ = g_strsplit (_tmp11_, ".", 2);
 
5682
        tokens = (_vala_array_free (tokens, tokens_length1, (GDestroyNotify) g_free), NULL);
 
5683
        tokens = _tmp13_;
 
5684
        tokens_length1 = _vala_array_length (_tmp12_);
 
5685
        _tokens_size_ = tokens_length1;
 
5686
        _tmp14_ = tokens;
 
5687
        _tmp14__length1 = tokens_length1;
 
5688
        if (_tmp14__length1 != 2) {
 
5689
                result = NULL;
 
5690
                _g_free0 (domain);
 
5691
                tokens = (_vala_array_free (tokens, tokens_length1, (GDestroyNotify) g_free), NULL);
 
5692
                return result;
 
5693
        }
 
5694
        _tmp15_ = tokens;
 
5695
        _tmp15__length1 = tokens_length1;
 
5696
        _tmp16_ = _tmp15_[0];
 
5697
        _tmp17_ = g_strdup (_tmp16_);
 
5698
        _g_free0 (domain);
 
5699
        domain = _tmp17_;
 
5700
        _tmp20_ = domain;
 
5701
        if (g_strcmp0 (_tmp20_, "msn") == 0) {
 
5702
                _tmp19_ = TRUE;
 
5703
        } else {
 
5704
                const gchar* _tmp21_;
 
5705
                _tmp21_ = domain;
 
5706
                _tmp19_ = g_strcmp0 (_tmp21_, "hotmail") == 0;
 
5707
        }
 
5708
        _tmp22_ = _tmp19_;
 
5709
        if (_tmp22_) {
 
5710
                _tmp18_ = TRUE;
 
5711
        } else {
 
5712
                const gchar* _tmp23_;
 
5713
                _tmp23_ = domain;
 
5714
                _tmp18_ = g_strcmp0 (_tmp23_, "live") == 0;
 
5715
        }
 
5716
        _tmp24_ = _tmp18_;
 
5717
        if (_tmp24_) {
 
5718
                gchar* _tmp25_;
 
5719
                _tmp25_ = g_strdup ("msn");
 
5720
                result = _tmp25_;
 
5721
                _g_free0 (domain);
 
5722
                tokens = (_vala_array_free (tokens, tokens_length1, (GDestroyNotify) g_free), NULL);
 
5723
                return result;
 
5724
        } else {
 
5725
                gboolean _tmp26_ = FALSE;
 
5726
                const gchar* _tmp27_;
 
5727
                gboolean _tmp29_;
 
5728
                _tmp27_ = domain;
 
5729
                if (g_strcmp0 (_tmp27_, "gmail") == 0) {
 
5730
                        _tmp26_ = TRUE;
 
5731
                } else {
 
5732
                        const gchar* _tmp28_;
 
5733
                        _tmp28_ = domain;
 
5734
                        _tmp26_ = g_strcmp0 (_tmp28_, "googlemail") == 0;
 
5735
                }
 
5736
                _tmp29_ = _tmp26_;
 
5737
                if (_tmp29_) {
 
5738
                        gchar* _tmp30_;
 
5739
                        _tmp30_ = g_strdup ("jabber");
 
5740
                        result = _tmp30_;
 
5741
                        _g_free0 (domain);
 
5742
                        tokens = (_vala_array_free (tokens, tokens_length1, (GDestroyNotify) g_free), NULL);
 
5743
                        return result;
 
5744
                } else {
 
5745
                        const gchar* _tmp31_;
 
5746
                        _tmp31_ = domain;
 
5747
                        if (g_strcmp0 (_tmp31_, "yahoo") == 0) {
 
5748
                                gchar* _tmp32_;
 
5749
                                _tmp32_ = g_strdup ("yahoo");
 
5750
                                result = _tmp32_;
 
5751
                                _g_free0 (domain);
 
5752
                                tokens = (_vala_array_free (tokens, tokens_length1, (GDestroyNotify) g_free), NULL);
 
5753
                                return result;
 
5754
                        }
 
5755
                }
 
5756
        }
 
5757
        result = NULL;
 
5758
        _g_free0 (domain);
 
5759
        tokens = (_vala_array_free (tokens, tokens_length1, (GDestroyNotify) g_free), NULL);
 
5760
        return result;
 
5761
}
 
5762
 
 
5763
 
 
5764
EContact* edsf_persona_get_contact (EdsfPersona* self) {
 
5765
        EContact* result;
 
5766
        EContact* _tmp0_;
 
5767
        g_return_val_if_fail (self != NULL, NULL);
 
5768
        _tmp0_ = self->priv->_contact;
 
5769
        result = _tmp0_;
 
5770
        return result;
 
5771
}
 
5772
 
 
5773
 
 
5774
static void edsf_persona_set_contact (EdsfPersona* self, EContact* value) {
 
5775
        EContact* _tmp0_;
 
5776
        EContact* _tmp1_;
 
5777
        g_return_if_fail (self != NULL);
 
5778
        _tmp0_ = value;
 
5779
        _tmp1_ = _g_object_ref0 (_tmp0_);
 
5780
        _g_object_unref0 (self->priv->_contact);
 
5781
        self->priv->_contact = _tmp1_;
 
5782
        g_object_notify ((GObject *) self, "contact");
 
5783
}
 
5784
 
 
5785
 
 
5786
static GeeMultiMap* edsf_persona_real_get_web_service_addresses (FolksWebServiceDetails* base) {
 
5787
        GeeMultiMap* result;
 
5788
        EdsfPersona* self;
 
5789
        GeeHashMultiMap* _tmp0_;
 
5790
        self = (EdsfPersona*) base;
 
5791
        _tmp0_ = self->priv->_web_service_addresses;
 
5792
        result = (GeeMultiMap*) _tmp0_;
 
5793
        return result;
 
5794
}
 
5795
 
 
5796
 
 
5797
static void edsf_persona_real_set_web_service_addresses (FolksWebServiceDetails* base, GeeMultiMap* value) {
 
5798
        EdsfPersona* self;
 
5799
        GeeMultiMap* _tmp0_;
 
5800
        self = (EdsfPersona*) base;
 
5801
        _tmp0_ = value;
 
5802
        folks_web_service_details_change_web_service_addresses ((FolksWebServiceDetails*) self, _tmp0_, NULL, NULL);
 
5803
}
 
5804
 
 
5805
 
 
5806
static GeeSet* edsf_persona_real_get_local_ids (FolksLocalIdDetails* base) {
 
5807
        GeeSet* result;
 
5808
        EdsfPersona* self;
 
5809
        GeeHashSet* _tmp0_;
 
5810
        const gchar* _tmp1_;
 
5811
        const gchar* _tmp2_;
 
5812
        gboolean _tmp3_ = FALSE;
 
5813
        GeeSet* _tmp7_;
 
5814
        self = (EdsfPersona*) base;
 
5815
        _tmp0_ = self->priv->_local_ids;
 
5816
        _tmp1_ = folks_persona_get_iid ((FolksPersona*) self);
 
5817
        _tmp2_ = _tmp1_;
 
5818
        _tmp3_ = gee_abstract_collection_contains ((GeeAbstractCollection*) _tmp0_, _tmp2_);
 
5819
        if (_tmp3_ == FALSE) {
 
5820
                GeeHashSet* _tmp4_;
 
5821
                const gchar* _tmp5_;
 
5822
                const gchar* _tmp6_;
 
5823
                _tmp4_ = self->priv->_local_ids;
 
5824
                _tmp5_ = folks_persona_get_iid ((FolksPersona*) self);
 
5825
                _tmp6_ = _tmp5_;
 
5826
                gee_abstract_collection_add ((GeeAbstractCollection*) _tmp4_, _tmp6_);
 
5827
        }
 
5828
        _tmp7_ = self->priv->_local_ids_ro;
 
5829
        result = _tmp7_;
 
5830
        return result;
 
5831
}
 
5832
 
 
5833
 
 
5834
static void edsf_persona_real_set_local_ids (FolksLocalIdDetails* base, GeeSet* value) {
 
5835
        EdsfPersona* self;
 
5836
        GeeSet* _tmp0_;
 
5837
        self = (EdsfPersona*) base;
 
5838
        _tmp0_ = value;
 
5839
        folks_local_id_details_change_local_ids ((FolksLocalIdDetails*) self, _tmp0_, NULL, NULL);
 
5840
}
 
5841
 
 
5842
 
 
5843
static GeeSet* edsf_persona_real_get_postal_addresses (FolksPostalAddressDetails* base) {
 
5844
        GeeSet* result;
 
5845
        EdsfPersona* self;
 
5846
        GeeSet* _tmp0_;
 
5847
        self = (EdsfPersona*) base;
 
5848
        _tmp0_ = self->priv->_postal_addresses_ro;
 
5849
        result = _tmp0_;
 
5850
        return result;
 
5851
}
 
5852
 
 
5853
 
 
5854
static void edsf_persona_real_set_postal_addresses (FolksPostalAddressDetails* base, GeeSet* value) {
 
5855
        EdsfPersona* self;
 
5856
        GeeSet* _tmp0_;
 
5857
        self = (EdsfPersona*) base;
 
5858
        _tmp0_ = value;
 
5859
        folks_postal_address_details_change_postal_addresses ((FolksPostalAddressDetails*) self, _tmp0_, NULL, NULL);
 
5860
}
 
5861
 
 
5862
 
 
5863
static GeeSet* edsf_persona_real_get_phone_numbers (FolksPhoneDetails* base) {
 
5864
        GeeSet* result;
 
5865
        EdsfPersona* self;
 
5866
        GeeSet* _tmp0_;
 
5867
        self = (EdsfPersona*) base;
 
5868
        _tmp0_ = self->priv->_phone_numbers_ro;
 
5869
        result = _tmp0_;
 
5870
        return result;
 
5871
}
 
5872
 
 
5873
 
 
5874
static void edsf_persona_real_set_phone_numbers (FolksPhoneDetails* base, GeeSet* value) {
 
5875
        EdsfPersona* self;
 
5876
        GeeSet* _tmp0_;
 
5877
        self = (EdsfPersona*) base;
 
5878
        _tmp0_ = value;
 
5879
        folks_phone_details_change_phone_numbers ((FolksPhoneDetails*) self, _tmp0_, NULL, NULL);
 
5880
}
 
5881
 
 
5882
 
 
5883
static GeeSet* edsf_persona_real_get_email_addresses (FolksEmailDetails* base) {
 
5884
        GeeSet* result;
 
5885
        EdsfPersona* self;
 
5886
        GeeSet* _tmp0_;
 
5887
        self = (EdsfPersona*) base;
 
5888
        _tmp0_ = self->priv->_email_addresses_ro;
 
5889
        result = _tmp0_;
 
5890
        return result;
 
5891
}
 
5892
 
 
5893
 
 
5894
static void edsf_persona_real_set_email_addresses (FolksEmailDetails* base, GeeSet* value) {
 
5895
        EdsfPersona* self;
 
5896
        GeeSet* _tmp0_;
 
5897
        self = (EdsfPersona*) base;
 
5898
        _tmp0_ = value;
 
5899
        folks_email_details_change_email_addresses ((FolksEmailDetails*) self, _tmp0_, NULL, NULL);
 
5900
}
 
5901
 
 
5902
 
 
5903
static GeeSet* edsf_persona_real_get_notes (FolksNoteDetails* base) {
 
5904
        GeeSet* result;
 
5905
        EdsfPersona* self;
 
5906
        GeeSet* _tmp0_;
 
5907
        self = (EdsfPersona*) base;
 
5908
        _tmp0_ = self->priv->_notes_ro;
 
5909
        result = _tmp0_;
 
5910
        return result;
 
5911
}
 
5912
 
 
5913
 
 
5914
static void edsf_persona_real_set_notes (FolksNoteDetails* base, GeeSet* value) {
 
5915
        EdsfPersona* self;
 
5916
        GeeSet* _tmp0_;
 
5917
        self = (EdsfPersona*) base;
 
5918
        _tmp0_ = value;
 
5919
        folks_note_details_change_notes ((FolksNoteDetails*) self, _tmp0_, NULL, NULL);
 
5920
}
 
5921
 
 
5922
 
 
5923
static gchar** edsf_persona_real_get_linkable_properties (FolksPersona* base, int* result_length1) {
 
5924
        gchar** result;
 
5925
        EdsfPersona* self;
 
5926
        gchar** _tmp0_;
 
5927
        gint _tmp0__length1;
 
5928
        self = (EdsfPersona*) base;
 
5929
        _tmp0_ = EDSF_PERSONA__linkable_properties;
 
5930
        _tmp0__length1 = G_N_ELEMENTS (EDSF_PERSONA__linkable_properties);
 
5931
        if (result_length1) {
 
5932
                *result_length1 = _tmp0__length1;
 
5933
        }
 
5934
        result = _tmp0_;
 
5935
        return result;
 
5936
}
 
5937
 
 
5938
 
 
5939
static gchar** edsf_persona_real_get_writeable_properties (FolksPersona* base, int* result_length1) {
 
5940
        gchar** result;
 
5941
        EdsfPersona* self;
 
5942
        FolksPersonaStore* _tmp0_;
 
5943
        FolksPersonaStore* _tmp1_;
 
5944
        gchar** _tmp2_;
 
5945
        gint _tmp2__length1;
 
5946
        gchar** _tmp3_;
 
5947
        gint _tmp3__length1;
 
5948
        gchar** _tmp4_;
 
5949
        gint _tmp4__length1;
 
5950
        self = (EdsfPersona*) base;
 
5951
        _tmp0_ = folks_persona_get_store ((FolksPersona*) self);
 
5952
        _tmp1_ = _tmp0_;
 
5953
        _tmp2_ = folks_persona_store_get_always_writeable_properties (_tmp1_, &_tmp2__length1);
 
5954
        _tmp3_ = _tmp2_;
 
5955
        _tmp3__length1 = _tmp2__length1;
 
5956
        _tmp4_ = _tmp3_;
 
5957
        _tmp4__length1 = _tmp3__length1;
 
5958
        if (result_length1) {
 
5959
                *result_length1 = _tmp4__length1;
 
5960
        }
 
5961
        result = _tmp4_;
 
5962
        return result;
 
5963
}
 
5964
 
 
5965
 
 
5966
static GLoadableIcon* edsf_persona_real_get_avatar (FolksAvatarDetails* base) {
 
5967
        GLoadableIcon* result;
 
5968
        EdsfPersona* self;
 
5969
        GLoadableIcon* _tmp0_;
 
5970
        self = (EdsfPersona*) base;
 
5971
        _tmp0_ = self->priv->_avatar;
 
5972
        result = _tmp0_;
 
5973
        return result;
 
5974
}
 
5975
 
 
5976
 
 
5977
static void edsf_persona_real_set_avatar (FolksAvatarDetails* base, GLoadableIcon* value) {
 
5978
        EdsfPersona* self;
 
5979
        GLoadableIcon* _tmp0_;
 
5980
        self = (EdsfPersona*) base;
 
5981
        _tmp0_ = value;
 
5982
        folks_avatar_details_change_avatar ((FolksAvatarDetails*) self, _tmp0_, NULL, NULL);
 
5983
}
 
5984
 
 
5985
 
 
5986
static FolksStructuredName* edsf_persona_real_get_structured_name (FolksNameDetails* base) {
 
5987
        FolksStructuredName* result;
 
5988
        EdsfPersona* self;
 
5989
        FolksStructuredName* _tmp0_;
 
5990
        self = (EdsfPersona*) base;
 
5991
        _tmp0_ = self->priv->_structured_name;
 
5992
        result = _tmp0_;
 
5993
        return result;
 
5994
}
 
5995
 
 
5996
 
 
5997
static void edsf_persona_real_set_structured_name (FolksNameDetails* base, FolksStructuredName* value) {
 
5998
        EdsfPersona* self;
 
5999
        FolksStructuredName* _tmp0_;
 
6000
        self = (EdsfPersona*) base;
 
6001
        _tmp0_ = value;
 
6002
        folks_name_details_change_structured_name ((FolksNameDetails*) self, _tmp0_, NULL, NULL);
 
6003
}
 
6004
 
 
6005
 
 
6006
const gchar* edsf_persona_get_contact_id (EdsfPersona* self) {
 
6007
        const gchar* result;
 
6008
        const gchar* _tmp0_;
 
6009
        g_return_val_if_fail (self != NULL, NULL);
 
6010
        _tmp0_ = self->priv->_contact_id;
 
6011
        result = _tmp0_;
 
6012
        return result;
 
6013
}
 
6014
 
 
6015
 
 
6016
static void edsf_persona_set_contact_id (EdsfPersona* self, const gchar* value) {
 
6017
        const gchar* _tmp0_;
 
6018
        gchar* _tmp1_;
 
6019
        g_return_if_fail (self != NULL);
 
6020
        _tmp0_ = value;
 
6021
        _tmp1_ = g_strdup (_tmp0_);
 
6022
        _g_free0 (self->priv->_contact_id);
 
6023
        self->priv->_contact_id = _tmp1_;
 
6024
        g_object_notify ((GObject *) self, "contact-id");
 
6025
}
 
6026
 
 
6027
 
 
6028
static const gchar* edsf_persona_real_get_full_name (FolksNameDetails* base) {
 
6029
        const gchar* result;
 
6030
        EdsfPersona* self;
 
6031
        const gchar* _tmp0_;
 
6032
        self = (EdsfPersona*) base;
 
6033
        _tmp0_ = self->priv->_full_name;
 
6034
        result = _tmp0_;
 
6035
        return result;
 
6036
}
 
6037
 
 
6038
 
 
6039
static void edsf_persona_real_set_full_name (FolksNameDetails* base, const gchar* value) {
 
6040
        EdsfPersona* self;
 
6041
        const gchar* _tmp0_;
 
6042
        self = (EdsfPersona*) base;
 
6043
        _tmp0_ = value;
 
6044
        folks_name_details_change_full_name ((FolksNameDetails*) self, _tmp0_, NULL, NULL);
 
6045
}
 
6046
 
 
6047
 
 
6048
static const gchar* edsf_persona_real_get_nickname (FolksNameDetails* base) {
 
6049
        const gchar* result;
 
6050
        EdsfPersona* self;
 
6051
        const gchar* _tmp0_;
 
6052
        self = (EdsfPersona*) base;
 
6053
        _tmp0_ = self->priv->_nickname;
 
6054
        result = _tmp0_;
 
6055
        return result;
 
6056
}
 
6057
 
 
6058
 
 
6059
static void edsf_persona_real_set_nickname (FolksNameDetails* base, const gchar* value) {
 
6060
        EdsfPersona* self;
 
6061
        const gchar* _tmp0_;
 
6062
        self = (EdsfPersona*) base;
 
6063
        _tmp0_ = value;
 
6064
        folks_name_details_change_nickname ((FolksNameDetails*) self, _tmp0_, NULL, NULL);
 
6065
}
 
6066
 
 
6067
 
 
6068
static FolksGender edsf_persona_real_get_gender (FolksGenderDetails* base) {
 
6069
        FolksGender result;
 
6070
        EdsfPersona* self;
 
6071
        FolksGender _tmp0_;
 
6072
        self = (EdsfPersona*) base;
 
6073
        _tmp0_ = self->priv->_gender;
 
6074
        result = _tmp0_;
 
6075
        return result;
 
6076
}
 
6077
 
 
6078
 
 
6079
static void edsf_persona_real_set_gender (FolksGenderDetails* base, FolksGender value) {
 
6080
        EdsfPersona* self;
 
6081
        FolksGender _tmp0_;
 
6082
        self = (EdsfPersona*) base;
 
6083
        _tmp0_ = value;
 
6084
        folks_gender_details_change_gender ((FolksGenderDetails*) self, _tmp0_, NULL, NULL);
 
6085
}
 
6086
 
 
6087
 
 
6088
static GeeSet* edsf_persona_real_get_urls (FolksUrlDetails* base) {
 
6089
        GeeSet* result;
 
6090
        EdsfPersona* self;
 
6091
        GeeSet* _tmp0_;
 
6092
        self = (EdsfPersona*) base;
 
6093
        _tmp0_ = self->priv->_urls_ro;
 
6094
        result = _tmp0_;
 
6095
        return result;
 
6096
}
 
6097
 
 
6098
 
 
6099
static void edsf_persona_real_set_urls (FolksUrlDetails* base, GeeSet* value) {
 
6100
        EdsfPersona* self;
 
6101
        GeeSet* _tmp0_;
 
6102
        self = (EdsfPersona*) base;
 
6103
        _tmp0_ = value;
 
6104
        folks_url_details_change_urls ((FolksUrlDetails*) self, _tmp0_, NULL, NULL);
 
6105
}
 
6106
 
 
6107
 
 
6108
static GeeMultiMap* edsf_persona_real_get_im_addresses (FolksImDetails* base) {
 
6109
        GeeMultiMap* result;
 
6110
        EdsfPersona* self;
 
6111
        GeeHashMultiMap* _tmp0_;
 
6112
        self = (EdsfPersona*) base;
 
6113
        _tmp0_ = self->priv->_im_addresses;
 
6114
        result = (GeeMultiMap*) _tmp0_;
 
6115
        return result;
 
6116
}
 
6117
 
 
6118
 
 
6119
static void edsf_persona_real_set_im_addresses (FolksImDetails* base, GeeMultiMap* value) {
 
6120
        EdsfPersona* self;
 
6121
        GeeMultiMap* _tmp0_;
 
6122
        self = (EdsfPersona*) base;
 
6123
        _tmp0_ = value;
 
6124
        folks_im_details_change_im_addresses ((FolksImDetails*) self, _tmp0_, NULL, NULL);
 
6125
}
 
6126
 
 
6127
 
 
6128
static GeeSet* edsf_persona_real_get_groups (FolksGroupDetails* base) {
 
6129
        GeeSet* result;
 
6130
        EdsfPersona* self;
 
6131
        GeeSet* _tmp0_;
 
6132
        self = (EdsfPersona*) base;
 
6133
        _tmp0_ = self->priv->_groups_ro;
 
6134
        result = _tmp0_;
 
6135
        return result;
 
6136
}
 
6137
 
 
6138
 
 
6139
static void edsf_persona_real_set_groups (FolksGroupDetails* base, GeeSet* value) {
 
6140
        EdsfPersona* self;
 
6141
        GeeSet* _tmp0_;
 
6142
        self = (EdsfPersona*) base;
 
6143
        _tmp0_ = value;
 
6144
        folks_group_details_change_groups ((FolksGroupDetails*) self, _tmp0_, NULL, NULL);
 
6145
}
 
6146
 
 
6147
 
 
6148
static const gchar* edsf_persona_real_get_calendar_event_id (FolksBirthdayDetails* base) {
 
6149
        const gchar* result;
 
6150
        EdsfPersona* self;
 
6151
        self = (EdsfPersona*) base;
 
6152
        result = NULL;
 
6153
        return result;
 
6154
}
 
6155
 
 
6156
 
 
6157
static void edsf_persona_real_set_calendar_event_id (FolksBirthdayDetails* base, const gchar* value) {
 
6158
        EdsfPersona* self;
 
6159
        const gchar* _tmp0_;
 
6160
        self = (EdsfPersona*) base;
 
6161
        _tmp0_ = value;
 
6162
        folks_birthday_details_change_calendar_event_id ((FolksBirthdayDetails*) self, _tmp0_, NULL, NULL);
 
6163
}
 
6164
 
 
6165
 
 
6166
static GDateTime* edsf_persona_real_get_birthday (FolksBirthdayDetails* base) {
 
6167
        GDateTime* result;
 
6168
        EdsfPersona* self;
 
6169
        GDateTime* _tmp0_;
 
6170
        self = (EdsfPersona*) base;
 
6171
        _tmp0_ = self->priv->_birthday;
 
6172
        result = _tmp0_;
 
6173
        return result;
 
6174
}
 
6175
 
 
6176
 
 
6177
static void edsf_persona_real_set_birthday (FolksBirthdayDetails* base, GDateTime* value) {
 
6178
        EdsfPersona* self;
 
6179
        GDateTime* _tmp0_;
 
6180
        self = (EdsfPersona*) base;
 
6181
        _tmp0_ = value;
 
6182
        folks_birthday_details_change_birthday ((FolksBirthdayDetails*) self, _tmp0_, NULL, NULL);
 
6183
}
 
6184
 
 
6185
 
 
6186
static GeeSet* edsf_persona_real_get_roles (FolksRoleDetails* base) {
 
6187
        GeeSet* result;
 
6188
        EdsfPersona* self;
 
6189
        GeeSet* _tmp0_;
 
6190
        self = (EdsfPersona*) base;
 
6191
        _tmp0_ = self->priv->_roles_ro;
 
6192
        result = _tmp0_;
 
6193
        return result;
 
6194
}
 
6195
 
 
6196
 
 
6197
static void edsf_persona_real_set_roles (FolksRoleDetails* base, GeeSet* value) {
 
6198
        EdsfPersona* self;
 
6199
        GeeSet* _tmp0_;
 
6200
        self = (EdsfPersona*) base;
 
6201
        _tmp0_ = value;
 
6202
        folks_role_details_change_roles ((FolksRoleDetails*) self, _tmp0_, NULL, NULL);
 
6203
}
 
6204
 
 
6205
 
 
6206
static void edsf_persona_url_type_mapping_copy (const EdsfPersonaUrlTypeMapping* self, EdsfPersonaUrlTypeMapping* dest) {
 
6207
        const gchar* _tmp0_;
 
6208
        const gchar* _tmp1_;
 
6209
        const gchar* _tmp2_;
 
6210
        const gchar* _tmp3_;
 
6211
        _tmp0_ = (*self).vcard_field_name;
 
6212
        _tmp1_ = g_strdup (_tmp0_);
 
6213
        _g_free0 ((*dest).vcard_field_name);
 
6214
        (*dest).vcard_field_name = _tmp1_;
 
6215
        _tmp2_ = (*self).folks_type;
 
6216
        _tmp3_ = g_strdup (_tmp2_);
 
6217
        _g_free0 ((*dest).folks_type);
 
6218
        (*dest).folks_type = _tmp3_;
 
6219
}
 
6220
 
 
6221
 
 
6222
static void edsf_persona_url_type_mapping_destroy (EdsfPersonaUrlTypeMapping* self) {
 
6223
        _g_free0 ((*self).vcard_field_name);
 
6224
        _g_free0 ((*self).folks_type);
 
6225
}
 
6226
 
 
6227
 
 
6228
static EdsfPersonaUrlTypeMapping* edsf_persona_url_type_mapping_dup (const EdsfPersonaUrlTypeMapping* self) {
 
6229
        EdsfPersonaUrlTypeMapping* dup;
 
6230
        dup = g_new0 (EdsfPersonaUrlTypeMapping, 1);
 
6231
        edsf_persona_url_type_mapping_copy (self, dup);
 
6232
        return dup;
 
6233
}
 
6234
 
 
6235
 
 
6236
static void edsf_persona_url_type_mapping_free (EdsfPersonaUrlTypeMapping* self) {
 
6237
        edsf_persona_url_type_mapping_destroy (self);
 
6238
        g_free (self);
 
6239
}
 
6240
 
 
6241
 
 
6242
static GType edsf_persona_url_type_mapping_get_type (void) {
 
6243
        static volatile gsize edsf_persona_url_type_mapping_type_id__volatile = 0;
 
6244
        if (g_once_init_enter (&edsf_persona_url_type_mapping_type_id__volatile)) {
 
6245
                GType edsf_persona_url_type_mapping_type_id;
 
6246
                edsf_persona_url_type_mapping_type_id = g_boxed_type_register_static ("EdsfPersonaUrlTypeMapping", (GBoxedCopyFunc) edsf_persona_url_type_mapping_dup, (GBoxedFreeFunc) edsf_persona_url_type_mapping_free);
 
6247
                g_once_init_leave (&edsf_persona_url_type_mapping_type_id__volatile, edsf_persona_url_type_mapping_type_id);
 
6248
        }
 
6249
        return edsf_persona_url_type_mapping_type_id__volatile;
 
6250
}
 
6251
 
 
6252
 
 
6253
static void edsf_persona_class_init (EdsfPersonaClass * klass) {
 
6254
        GTimeZone* _tmp0_;
 
6255
        edsf_persona_parent_class = g_type_class_peek_parent (klass);
 
6256
        g_type_class_add_private (klass, sizeof (EdsfPersonaPrivate));
 
6257
        FOLKS_PERSONA_CLASS (klass)->linkable_property_to_links = edsf_persona_real_linkable_property_to_links;
 
6258
        FOLKS_PERSONA_CLASS (klass)->get_linkable_properties = edsf_persona_real_get_linkable_properties;
 
6259
        FOLKS_PERSONA_CLASS (klass)->get_writeable_properties = edsf_persona_real_get_writeable_properties;
 
6260
        G_OBJECT_CLASS (klass)->get_property = _vala_edsf_persona_get_property;
 
6261
        G_OBJECT_CLASS (klass)->set_property = _vala_edsf_persona_set_property;
 
6262
        G_OBJECT_CLASS (klass)->finalize = edsf_persona_finalize;
 
6263
        /**
 
6264
           * The e-d-s contact represented by this Persona
 
6265
           */
 
6266
        g_object_class_install_property (G_OBJECT_CLASS (klass), EDSF_PERSONA_CONTACT, g_param_spec_object ("contact", "contact", "contact", e_contact_get_type (), G_PARAM_STATIC_NAME | G_PARAM_STATIC_NICK | G_PARAM_STATIC_BLURB | G_PARAM_READABLE));
 
6267
        /**
 
6268
           * {@inheritDoc}
 
6269
           */
 
6270
        g_object_class_override_property (G_OBJECT_CLASS (klass), EDSF_PERSONA_WEB_SERVICE_ADDRESSES, "web-service-addresses");
 
6271
        /**
 
6272
           * IDs used to link {@link Edsf.Persona}s.
 
6273
           */
 
6274
        g_object_class_override_property (G_OBJECT_CLASS (klass), EDSF_PERSONA_LOCAL_IDS, "local-ids");
 
6275
        /**
 
6276
           * The postal addresses of the contact.
 
6277
           *
 
6278
           * A list of postal addresses associated to the contact.
 
6279
           *
 
6280
           * @since 0.6.0
 
6281
           */
 
6282
        g_object_class_override_property (G_OBJECT_CLASS (klass), EDSF_PERSONA_POSTAL_ADDRESSES, "postal-addresses");
 
6283
        /**
 
6284
           * {@inheritDoc}
 
6285
           *
 
6286
           * @since 0.6.0
 
6287
           */
 
6288
        g_object_class_override_property (G_OBJECT_CLASS (klass), EDSF_PERSONA_PHONE_NUMBERS, "phone-numbers");
 
6289
        /**
 
6290
           * {@inheritDoc}
 
6291
           *
 
6292
           * @since 0.6.0
 
6293
           */
 
6294
        g_object_class_override_property (G_OBJECT_CLASS (klass), EDSF_PERSONA_EMAIL_ADDRESSES, "email-addresses");
 
6295
        /**
 
6296
           * {@inheritDoc}
 
6297
           *
 
6298
           * @since 0.6.0
 
6299
           */
 
6300
        g_object_class_override_property (G_OBJECT_CLASS (klass), EDSF_PERSONA_NOTES, "notes");
 
6301
        /**
 
6302
           * {@inheritDoc}
 
6303
           *
 
6304
           * @since 0.6.0
 
6305
           */
 
6306
        g_object_class_override_property (G_OBJECT_CLASS (klass), EDSF_PERSONA_LINKABLE_PROPERTIES, "linkable-properties");
 
6307
        /**
 
6308
           * {@inheritDoc}
 
6309
           *
 
6310
           * @since 0.6.0
 
6311
           */
 
6312
        g_object_class_override_property (G_OBJECT_CLASS (klass), EDSF_PERSONA_WRITEABLE_PROPERTIES, "writeable-properties");
 
6313
        /**
 
6314
           * An avatar for the Persona.
 
6315
           *
 
6316
           * See {@link Folks.AvatarDetails.avatar}.
 
6317
           *
 
6318
           * @since 0.6.0
 
6319
           */
 
6320
        g_object_class_override_property (G_OBJECT_CLASS (klass), EDSF_PERSONA_AVATAR, "avatar");
 
6321
        /**
 
6322
           * {@inheritDoc}
 
6323
           *
 
6324
           * @since 0.6.0
 
6325
           */
 
6326
        g_object_class_override_property (G_OBJECT_CLASS (klass), EDSF_PERSONA_STRUCTURED_NAME, "structured-name");
 
6327
        /**
 
6328
           * The e-d-s contact uid
 
6329
           *
 
6330
           * @since 0.6.0
 
6331
           */
 
6332
        g_object_class_install_property (G_OBJECT_CLASS (klass), EDSF_PERSONA_CONTACT_ID, g_param_spec_string ("contact-id", "contact-id", "contact-id", NULL, G_PARAM_STATIC_NAME | G_PARAM_STATIC_NICK | G_PARAM_STATIC_BLURB | G_PARAM_READABLE));
 
6333
        /**
 
6334
           * {@inheritDoc}
 
6335
           *
 
6336
           * @since 0.6.0
 
6337
           */
 
6338
        g_object_class_override_property (G_OBJECT_CLASS (klass), EDSF_PERSONA_FULL_NAME, "full-name");
 
6339
        /**
 
6340
           * {@inheritDoc}
 
6341
           *
 
6342
           * @since 0.6.0
 
6343
           */
 
6344
        g_object_class_override_property (G_OBJECT_CLASS (klass), EDSF_PERSONA_NICKNAME, "nickname");
 
6345
        /**
 
6346
           * {@inheritDoc}
 
6347
           *
 
6348
           * @since 0.6.0
 
6349
           */
 
6350
        g_object_class_override_property (G_OBJECT_CLASS (klass), EDSF_PERSONA_GENDER, "gender");
 
6351
        /**
 
6352
           * {@inheritDoc}
 
6353
           *
 
6354
           * @since 0.6.0
 
6355
           */
 
6356
        g_object_class_override_property (G_OBJECT_CLASS (klass), EDSF_PERSONA_URLS, "urls");
 
6357
        /**
 
6358
           * {@inheritDoc}
 
6359
           *
 
6360
           * @since 0.6.0
 
6361
           */
 
6362
        g_object_class_override_property (G_OBJECT_CLASS (klass), EDSF_PERSONA_IM_ADDRESSES, "im-addresses");
 
6363
        /**
 
6364
           * {@inheritDoc}
 
6365
           *
 
6366
           * @since 0.6.0
 
6367
           */
 
6368
        g_object_class_override_property (G_OBJECT_CLASS (klass), EDSF_PERSONA_GROUPS, "groups");
 
6369
        /**
 
6370
           * {@inheritDoc}
 
6371
           *
 
6372
           * e-d-s has no equivalent field, so this is unsupported.
 
6373
           *
 
6374
           * @since 0.6.2
 
6375
           */
 
6376
        g_object_class_override_property (G_OBJECT_CLASS (klass), EDSF_PERSONA_CALENDAR_EVENT_ID, "calendar-event-id");
 
6377
        /**
 
6378
           * {@inheritDoc}
 
6379
           *
 
6380
           * @since 0.6.2
 
6381
           */
 
6382
        g_object_class_override_property (G_OBJECT_CLASS (klass), EDSF_PERSONA_BIRTHDAY, "birthday");
 
6383
        /**
 
6384
           * {@inheritDoc}
 
6385
           *
 
6386
           * @since 0.6.2
 
6387
           */
 
6388
        g_object_class_override_property (G_OBJECT_CLASS (klass), EDSF_PERSONA_ROLES, "roles");
 
6389
        g_static_rec_mutex_init (&__lock_edsf_persona__im_eds_map);
 
6390
        _tmp0_ = g_time_zone_new_local ();
 
6391
        edsf_persona__local_time_zone = _tmp0_;
 
6392
}
 
6393
 
 
6394
 
 
6395
static void edsf_persona_folks_avatar_details_interface_init (FolksAvatarDetailsIface * iface) {
 
6396
        edsf_persona_folks_avatar_details_parent_iface = g_type_interface_peek_parent (iface);
 
6397
        iface->change_avatar = (void (*)(FolksAvatarDetails*, GLoadableIcon*, GError**)) edsf_persona_real_change_avatar;
 
6398
        iface->change_avatar_finish = edsf_persona_real_change_avatar_finish;
 
6399
        iface->get_avatar = edsf_persona_real_get_avatar;
 
6400
        iface->set_avatar = edsf_persona_real_set_avatar;
 
6401
}
 
6402
 
 
6403
 
 
6404
static void edsf_persona_folks_birthday_details_interface_init (FolksBirthdayDetailsIface * iface) {
 
6405
        edsf_persona_folks_birthday_details_parent_iface = g_type_interface_peek_parent (iface);
 
6406
        iface->change_birthday = (void (*)(FolksBirthdayDetails*, GDateTime*, GError**)) edsf_persona_real_change_birthday;
 
6407
        iface->change_birthday_finish = edsf_persona_real_change_birthday_finish;
 
6408
        iface->get_calendar_event_id = edsf_persona_real_get_calendar_event_id;
 
6409
        iface->set_calendar_event_id = edsf_persona_real_set_calendar_event_id;
 
6410
        iface->get_birthday = edsf_persona_real_get_birthday;
 
6411
        iface->set_birthday = edsf_persona_real_set_birthday;
 
6412
}
 
6413
 
 
6414
 
 
6415
static void edsf_persona_folks_email_details_interface_init (FolksEmailDetailsIface * iface) {
 
6416
        edsf_persona_folks_email_details_parent_iface = g_type_interface_peek_parent (iface);
 
6417
        iface->change_email_addresses = (void (*)(FolksEmailDetails*, GeeSet*, GError**)) edsf_persona_real_change_email_addresses;
 
6418
        iface->change_email_addresses_finish = edsf_persona_real_change_email_addresses_finish;
 
6419
        iface->get_email_addresses = edsf_persona_real_get_email_addresses;
 
6420
        iface->set_email_addresses = edsf_persona_real_set_email_addresses;
 
6421
}
 
6422
 
 
6423
 
 
6424
static void edsf_persona_folks_gender_details_interface_init (FolksGenderDetailsIface * iface) {
 
6425
        edsf_persona_folks_gender_details_parent_iface = g_type_interface_peek_parent (iface);
 
6426
        iface->change_gender = (void (*)(FolksGenderDetails*, FolksGender, GError**)) edsf_persona_real_change_gender;
 
6427
        iface->change_gender_finish = edsf_persona_real_change_gender_finish;
 
6428
        iface->get_gender = edsf_persona_real_get_gender;
 
6429
        iface->set_gender = edsf_persona_real_set_gender;
 
6430
}
 
6431
 
 
6432
 
 
6433
static void edsf_persona_folks_group_details_interface_init (FolksGroupDetailsIface * iface) {
 
6434
        edsf_persona_folks_group_details_parent_iface = g_type_interface_peek_parent (iface);
 
6435
        iface->change_group = (void (*)(FolksGroupDetails*, const gchar*, gboolean, GError**)) edsf_persona_real_change_group;
 
6436
        iface->change_group_finish = edsf_persona_real_change_group_finish;
 
6437
        iface->change_groups = (void (*)(FolksGroupDetails*, GeeSet*, GError**)) edsf_persona_real_change_groups;
 
6438
        iface->change_groups_finish = edsf_persona_real_change_groups_finish;
 
6439
        iface->get_groups = edsf_persona_real_get_groups;
 
6440
        iface->set_groups = edsf_persona_real_set_groups;
 
6441
}
 
6442
 
 
6443
 
 
6444
static void edsf_persona_folks_im_details_interface_init (FolksImDetailsIface * iface) {
 
6445
        edsf_persona_folks_im_details_parent_iface = g_type_interface_peek_parent (iface);
 
6446
        iface->change_im_addresses = (void (*)(FolksImDetails*, GeeMultiMap*, GError**)) edsf_persona_real_change_im_addresses;
 
6447
        iface->change_im_addresses_finish = edsf_persona_real_change_im_addresses_finish;
 
6448
        iface->get_im_addresses = edsf_persona_real_get_im_addresses;
 
6449
        iface->set_im_addresses = edsf_persona_real_set_im_addresses;
 
6450
}
 
6451
 
 
6452
 
 
6453
static void edsf_persona_folks_local_id_details_interface_init (FolksLocalIdDetailsIface * iface) {
 
6454
        edsf_persona_folks_local_id_details_parent_iface = g_type_interface_peek_parent (iface);
 
6455
        iface->change_local_ids = (void (*)(FolksLocalIdDetails*, GeeSet*, GError**)) edsf_persona_real_change_local_ids;
 
6456
        iface->change_local_ids_finish = edsf_persona_real_change_local_ids_finish;
 
6457
        iface->get_local_ids = edsf_persona_real_get_local_ids;
 
6458
        iface->set_local_ids = edsf_persona_real_set_local_ids;
 
6459
}
 
6460
 
 
6461
 
 
6462
static void edsf_persona_folks_name_details_interface_init (FolksNameDetailsIface * iface) {
 
6463
        edsf_persona_folks_name_details_parent_iface = g_type_interface_peek_parent (iface);
 
6464
        iface->change_structured_name = (void (*)(FolksNameDetails*, FolksStructuredName*, GError**)) edsf_persona_real_change_structured_name;
 
6465
        iface->change_structured_name_finish = edsf_persona_real_change_structured_name_finish;
 
6466
        iface->change_full_name = (void (*)(FolksNameDetails*, const gchar*, GError**)) edsf_persona_real_change_full_name;
 
6467
        iface->change_full_name_finish = edsf_persona_real_change_full_name_finish;
 
6468
        iface->change_nickname = (void (*)(FolksNameDetails*, const gchar*, GError**)) edsf_persona_real_change_nickname;
 
6469
        iface->change_nickname_finish = edsf_persona_real_change_nickname_finish;
 
6470
        iface->get_structured_name = edsf_persona_real_get_structured_name;
 
6471
        iface->set_structured_name = edsf_persona_real_set_structured_name;
 
6472
        iface->get_full_name = edsf_persona_real_get_full_name;
 
6473
        iface->set_full_name = edsf_persona_real_set_full_name;
 
6474
        iface->get_nickname = edsf_persona_real_get_nickname;
 
6475
        iface->set_nickname = edsf_persona_real_set_nickname;
 
6476
}
 
6477
 
 
6478
 
 
6479
static void edsf_persona_folks_note_details_interface_init (FolksNoteDetailsIface * iface) {
 
6480
        edsf_persona_folks_note_details_parent_iface = g_type_interface_peek_parent (iface);
 
6481
        iface->change_notes = (void (*)(FolksNoteDetails*, GeeSet*, GError**)) edsf_persona_real_change_notes;
 
6482
        iface->change_notes_finish = edsf_persona_real_change_notes_finish;
 
6483
        iface->get_notes = edsf_persona_real_get_notes;
 
6484
        iface->set_notes = edsf_persona_real_set_notes;
 
6485
}
 
6486
 
 
6487
 
 
6488
static void edsf_persona_folks_phone_details_interface_init (FolksPhoneDetailsIface * iface) {
 
6489
        edsf_persona_folks_phone_details_parent_iface = g_type_interface_peek_parent (iface);
 
6490
        iface->change_phone_numbers = (void (*)(FolksPhoneDetails*, GeeSet*, GError**)) edsf_persona_real_change_phone_numbers;
 
6491
        iface->change_phone_numbers_finish = edsf_persona_real_change_phone_numbers_finish;
 
6492
        iface->get_phone_numbers = edsf_persona_real_get_phone_numbers;
 
6493
        iface->set_phone_numbers = edsf_persona_real_set_phone_numbers;
 
6494
}
 
6495
 
 
6496
 
 
6497
static void edsf_persona_folks_role_details_interface_init (FolksRoleDetailsIface * iface) {
 
6498
        edsf_persona_folks_role_details_parent_iface = g_type_interface_peek_parent (iface);
 
6499
        iface->change_roles = (void (*)(FolksRoleDetails*, GeeSet*, GError**)) edsf_persona_real_change_roles;
 
6500
        iface->change_roles_finish = edsf_persona_real_change_roles_finish;
 
6501
        iface->get_roles = edsf_persona_real_get_roles;
 
6502
        iface->set_roles = edsf_persona_real_set_roles;
 
6503
}
 
6504
 
 
6505
 
 
6506
static void edsf_persona_folks_url_details_interface_init (FolksUrlDetailsIface * iface) {
 
6507
        edsf_persona_folks_url_details_parent_iface = g_type_interface_peek_parent (iface);
 
6508
        iface->change_urls = (void (*)(FolksUrlDetails*, GeeSet*, GError**)) edsf_persona_real_change_urls;
 
6509
        iface->change_urls_finish = edsf_persona_real_change_urls_finish;
 
6510
        iface->get_urls = edsf_persona_real_get_urls;
 
6511
        iface->set_urls = edsf_persona_real_set_urls;
 
6512
}
 
6513
 
 
6514
 
 
6515
static void edsf_persona_folks_postal_address_details_interface_init (FolksPostalAddressDetailsIface * iface) {
 
6516
        edsf_persona_folks_postal_address_details_parent_iface = g_type_interface_peek_parent (iface);
 
6517
        iface->change_postal_addresses = (void (*)(FolksPostalAddressDetails*, GeeSet*, GError**)) edsf_persona_real_change_postal_addresses;
 
6518
        iface->change_postal_addresses_finish = edsf_persona_real_change_postal_addresses_finish;
 
6519
        iface->get_postal_addresses = edsf_persona_real_get_postal_addresses;
 
6520
        iface->set_postal_addresses = edsf_persona_real_set_postal_addresses;
 
6521
}
 
6522
 
 
6523
 
 
6524
static void edsf_persona_folks_web_service_details_interface_init (FolksWebServiceDetailsIface * iface) {
 
6525
        edsf_persona_folks_web_service_details_parent_iface = g_type_interface_peek_parent (iface);
 
6526
        iface->change_web_service_addresses = (void (*)(FolksWebServiceDetails*, GeeMultiMap*, GError**)) edsf_persona_real_change_web_service_addresses;
 
6527
        iface->change_web_service_addresses_finish = edsf_persona_real_change_web_service_addresses_finish;
 
6528
        iface->get_web_service_addresses = edsf_persona_real_get_web_service_addresses;
 
6529
        iface->set_web_service_addresses = edsf_persona_real_set_web_service_addresses;
 
6530
}
 
6531
 
 
6532
 
 
6533
static void edsf_persona_instance_init (EdsfPersona * self) {
 
6534
        gchar* _tmp0_;
 
6535
        gchar* _tmp1_;
 
6536
        GeeHashMultiMap* _tmp2_;
 
6537
        self->priv = EDSF_PERSONA_GET_PRIVATE (self);
 
6538
        self->priv->_avatar = NULL;
 
6539
        self->priv->_structured_name = NULL;
 
6540
        _tmp0_ = g_strdup ("");
 
6541
        self->priv->_full_name = _tmp0_;
 
6542
        _tmp1_ = g_strdup ("");
 
6543
        self->priv->_nickname = _tmp1_;
 
6544
        _tmp2_ = gee_hash_multi_map_new (G_TYPE_STRING, (GBoxedCopyFunc) g_strdup, g_free, FOLKS_TYPE_IM_FIELD_DETAILS, (GBoxedCopyFunc) g_object_ref, g_object_unref, NULL, NULL, (GHashFunc) folks_abstract_field_details_hash, (GEqualFunc) folks_abstract_field_details_equal);
 
6545
        self->priv->_im_addresses = _tmp2_;
 
6546
        self->priv->_birthday = NULL;
 
6547
}
 
6548
 
 
6549
 
 
6550
static void edsf_persona_finalize (GObject* obj) {
 
6551
        EdsfPersona * self;
 
6552
        const gchar* _tmp0_;
 
6553
        const gchar* _tmp1_;
 
6554
        self = EDSF_PERSONA (obj);
 
6555
        _tmp0_ = folks_persona_get_uid ((FolksPersona*) self);
 
6556
        _tmp1_ = _tmp0_;
 
6557
        g_debug ("edsf-persona.vala:769: Destroying Edsf.Persona '%s': %p", _tmp1_, self);
 
6558
        _g_object_unref0 (self->priv->_phone_numbers);
 
6559
        _g_object_unref0 (self->priv->_phone_numbers_ro);
 
6560
        _g_object_unref0 (self->priv->_email_addresses);
 
6561
        _g_object_unref0 (self->priv->_email_addresses_ro);
 
6562
        _g_object_unref0 (self->priv->_notes);
 
6563
        _g_object_unref0 (self->priv->_notes_ro);
 
6564
        _g_object_unref0 (self->priv->_postal_addresses);
 
6565
        _g_object_unref0 (self->priv->_postal_addresses_ro);
 
6566
        _g_object_unref0 (self->priv->_local_ids);
 
6567
        _g_object_unref0 (self->priv->_local_ids_ro);
 
6568
        _g_object_unref0 (self->priv->_web_service_addresses);
 
6569
        _g_object_unref0 (self->priv->_contact);
 
6570
        _g_object_unref0 (self->priv->_avatar);
 
6571
        _g_object_unref0 (self->priv->_structured_name);
 
6572
        _g_free0 (self->priv->_contact_id);
 
6573
        _g_free0 (self->priv->_full_name);
 
6574
        _g_free0 (self->priv->_nickname);
 
6575
        _g_object_unref0 (self->priv->_urls);
 
6576
        _g_object_unref0 (self->priv->_urls_ro);
 
6577
        _g_object_unref0 (self->priv->_im_addresses);
 
6578
        _g_object_unref0 (self->priv->_groups);
 
6579
        _g_object_unref0 (self->priv->_groups_ro);
 
6580
        _g_date_time_unref0 (self->priv->_birthday);
 
6581
        _g_object_unref0 (self->priv->_roles);
 
6582
        _g_object_unref0 (self->priv->_roles_ro);
 
6583
        G_OBJECT_CLASS (edsf_persona_parent_class)->finalize (obj);
 
6584
}
 
6585
 
 
6586
 
 
6587
/**
 
6588
 * A persona subclass which represents a single EDS contact.
 
6589
 */
 
6590
GType edsf_persona_get_type (void) {
 
6591
        static volatile gsize edsf_persona_type_id__volatile = 0;
 
6592
        if (g_once_init_enter (&edsf_persona_type_id__volatile)) {
 
6593
                static const GTypeInfo g_define_type_info = { sizeof (EdsfPersonaClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) edsf_persona_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (EdsfPersona), 0, (GInstanceInitFunc) edsf_persona_instance_init, NULL };
 
6594
                static const GInterfaceInfo folks_avatar_details_info = { (GInterfaceInitFunc) edsf_persona_folks_avatar_details_interface_init, (GInterfaceFinalizeFunc) NULL, NULL};
 
6595
                static const GInterfaceInfo folks_birthday_details_info = { (GInterfaceInitFunc) edsf_persona_folks_birthday_details_interface_init, (GInterfaceFinalizeFunc) NULL, NULL};
 
6596
                static const GInterfaceInfo folks_email_details_info = { (GInterfaceInitFunc) edsf_persona_folks_email_details_interface_init, (GInterfaceFinalizeFunc) NULL, NULL};
 
6597
                static const GInterfaceInfo folks_gender_details_info = { (GInterfaceInitFunc) edsf_persona_folks_gender_details_interface_init, (GInterfaceFinalizeFunc) NULL, NULL};
 
6598
                static const GInterfaceInfo folks_group_details_info = { (GInterfaceInitFunc) edsf_persona_folks_group_details_interface_init, (GInterfaceFinalizeFunc) NULL, NULL};
 
6599
                static const GInterfaceInfo folks_im_details_info = { (GInterfaceInitFunc) edsf_persona_folks_im_details_interface_init, (GInterfaceFinalizeFunc) NULL, NULL};
 
6600
                static const GInterfaceInfo folks_local_id_details_info = { (GInterfaceInitFunc) edsf_persona_folks_local_id_details_interface_init, (GInterfaceFinalizeFunc) NULL, NULL};
 
6601
                static const GInterfaceInfo folks_name_details_info = { (GInterfaceInitFunc) edsf_persona_folks_name_details_interface_init, (GInterfaceFinalizeFunc) NULL, NULL};
 
6602
                static const GInterfaceInfo folks_note_details_info = { (GInterfaceInitFunc) edsf_persona_folks_note_details_interface_init, (GInterfaceFinalizeFunc) NULL, NULL};
 
6603
                static const GInterfaceInfo folks_phone_details_info = { (GInterfaceInitFunc) edsf_persona_folks_phone_details_interface_init, (GInterfaceFinalizeFunc) NULL, NULL};
 
6604
                static const GInterfaceInfo folks_role_details_info = { (GInterfaceInitFunc) edsf_persona_folks_role_details_interface_init, (GInterfaceFinalizeFunc) NULL, NULL};
 
6605
                static const GInterfaceInfo folks_url_details_info = { (GInterfaceInitFunc) edsf_persona_folks_url_details_interface_init, (GInterfaceFinalizeFunc) NULL, NULL};
 
6606
                static const GInterfaceInfo folks_postal_address_details_info = { (GInterfaceInitFunc) edsf_persona_folks_postal_address_details_interface_init, (GInterfaceFinalizeFunc) NULL, NULL};
 
6607
                static const GInterfaceInfo folks_web_service_details_info = { (GInterfaceInitFunc) edsf_persona_folks_web_service_details_interface_init, (GInterfaceFinalizeFunc) NULL, NULL};
 
6608
                GType edsf_persona_type_id;
 
6609
                edsf_persona_type_id = g_type_register_static (FOLKS_TYPE_PERSONA, "EdsfPersona", &g_define_type_info, 0);
 
6610
                g_type_add_interface_static (edsf_persona_type_id, FOLKS_TYPE_AVATAR_DETAILS, &folks_avatar_details_info);
 
6611
                g_type_add_interface_static (edsf_persona_type_id, FOLKS_TYPE_BIRTHDAY_DETAILS, &folks_birthday_details_info);
 
6612
                g_type_add_interface_static (edsf_persona_type_id, FOLKS_TYPE_EMAIL_DETAILS, &folks_email_details_info);
 
6613
                g_type_add_interface_static (edsf_persona_type_id, FOLKS_TYPE_GENDER_DETAILS, &folks_gender_details_info);
 
6614
                g_type_add_interface_static (edsf_persona_type_id, FOLKS_TYPE_GROUP_DETAILS, &folks_group_details_info);
 
6615
                g_type_add_interface_static (edsf_persona_type_id, FOLKS_TYPE_IM_DETAILS, &folks_im_details_info);
 
6616
                g_type_add_interface_static (edsf_persona_type_id, FOLKS_TYPE_LOCAL_ID_DETAILS, &folks_local_id_details_info);
 
6617
                g_type_add_interface_static (edsf_persona_type_id, FOLKS_TYPE_NAME_DETAILS, &folks_name_details_info);
 
6618
                g_type_add_interface_static (edsf_persona_type_id, FOLKS_TYPE_NOTE_DETAILS, &folks_note_details_info);
 
6619
                g_type_add_interface_static (edsf_persona_type_id, FOLKS_TYPE_PHONE_DETAILS, &folks_phone_details_info);
 
6620
                g_type_add_interface_static (edsf_persona_type_id, FOLKS_TYPE_ROLE_DETAILS, &folks_role_details_info);
 
6621
                g_type_add_interface_static (edsf_persona_type_id, FOLKS_TYPE_URL_DETAILS, &folks_url_details_info);
 
6622
                g_type_add_interface_static (edsf_persona_type_id, FOLKS_TYPE_POSTAL_ADDRESS_DETAILS, &folks_postal_address_details_info);
 
6623
                g_type_add_interface_static (edsf_persona_type_id, FOLKS_TYPE_WEB_SERVICE_DETAILS, &folks_web_service_details_info);
 
6624
                g_once_init_leave (&edsf_persona_type_id__volatile, edsf_persona_type_id);
 
6625
        }
 
6626
        return edsf_persona_type_id__volatile;
 
6627
}
 
6628
 
 
6629
 
 
6630
static void _vala_edsf_persona_get_property (GObject * object, guint property_id, GValue * value, GParamSpec * pspec) {
 
6631
        EdsfPersona * self;
 
6632
        self = EDSF_PERSONA (object);
 
6633
        switch (property_id) {
 
6634
                case EDSF_PERSONA_CONTACT:
 
6635
                g_value_set_object (value, edsf_persona_get_contact (self));
 
6636
                break;
 
6637
                case EDSF_PERSONA_WEB_SERVICE_ADDRESSES:
 
6638
                g_value_set_object (value, folks_web_service_details_get_web_service_addresses ((FolksWebServiceDetails*) self));
 
6639
                break;
 
6640
                case EDSF_PERSONA_LOCAL_IDS:
 
6641
                g_value_set_object (value, folks_local_id_details_get_local_ids ((FolksLocalIdDetails*) self));
 
6642
                break;
 
6643
                case EDSF_PERSONA_POSTAL_ADDRESSES:
 
6644
                g_value_set_object (value, folks_postal_address_details_get_postal_addresses ((FolksPostalAddressDetails*) self));
 
6645
                break;
 
6646
                case EDSF_PERSONA_PHONE_NUMBERS:
 
6647
                g_value_set_object (value, folks_phone_details_get_phone_numbers ((FolksPhoneDetails*) self));
 
6648
                break;
 
6649
                case EDSF_PERSONA_EMAIL_ADDRESSES:
 
6650
                g_value_set_object (value, folks_email_details_get_email_addresses ((FolksEmailDetails*) self));
 
6651
                break;
 
6652
                case EDSF_PERSONA_NOTES:
 
6653
                g_value_set_object (value, folks_note_details_get_notes ((FolksNoteDetails*) self));
 
6654
                break;
 
6655
                case EDSF_PERSONA_LINKABLE_PROPERTIES:
 
6656
                {
 
6657
                        int length;
 
6658
                        g_value_set_boxed (value, folks_persona_get_linkable_properties ((FolksPersona*) self, &length));
 
6659
                }
 
6660
                break;
 
6661
                case EDSF_PERSONA_WRITEABLE_PROPERTIES:
 
6662
                {
 
6663
                        int length;
 
6664
                        g_value_set_boxed (value, folks_persona_get_writeable_properties ((FolksPersona*) self, &length));
 
6665
                }
 
6666
                break;
 
6667
                case EDSF_PERSONA_AVATAR:
 
6668
                g_value_set_object (value, folks_avatar_details_get_avatar ((FolksAvatarDetails*) self));
 
6669
                break;
 
6670
                case EDSF_PERSONA_STRUCTURED_NAME:
 
6671
                g_value_set_object (value, folks_name_details_get_structured_name ((FolksNameDetails*) self));
 
6672
                break;
 
6673
                case EDSF_PERSONA_CONTACT_ID:
 
6674
                g_value_set_string (value, edsf_persona_get_contact_id (self));
 
6675
                break;
 
6676
                case EDSF_PERSONA_FULL_NAME:
 
6677
                g_value_set_string (value, folks_name_details_get_full_name ((FolksNameDetails*) self));
 
6678
                break;
 
6679
                case EDSF_PERSONA_NICKNAME:
 
6680
                g_value_set_string (value, folks_name_details_get_nickname ((FolksNameDetails*) self));
 
6681
                break;
 
6682
                case EDSF_PERSONA_GENDER:
 
6683
                g_value_set_enum (value, folks_gender_details_get_gender ((FolksGenderDetails*) self));
 
6684
                break;
 
6685
                case EDSF_PERSONA_URLS:
 
6686
                g_value_set_object (value, folks_url_details_get_urls ((FolksUrlDetails*) self));
 
6687
                break;
 
6688
                case EDSF_PERSONA_IM_ADDRESSES:
 
6689
                g_value_set_object (value, folks_im_details_get_im_addresses ((FolksImDetails*) self));
 
6690
                break;
 
6691
                case EDSF_PERSONA_GROUPS:
 
6692
                g_value_set_object (value, folks_group_details_get_groups ((FolksGroupDetails*) self));
 
6693
                break;
 
6694
                case EDSF_PERSONA_CALENDAR_EVENT_ID:
 
6695
                g_value_set_string (value, folks_birthday_details_get_calendar_event_id ((FolksBirthdayDetails*) self));
 
6696
                break;
 
6697
                case EDSF_PERSONA_BIRTHDAY:
 
6698
                g_value_set_boxed (value, folks_birthday_details_get_birthday ((FolksBirthdayDetails*) self));
 
6699
                break;
 
6700
                case EDSF_PERSONA_ROLES:
 
6701
                g_value_set_object (value, folks_role_details_get_roles ((FolksRoleDetails*) self));
 
6702
                break;
 
6703
                default:
 
6704
                G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
 
6705
                break;
 
6706
        }
 
6707
}
 
6708
 
 
6709
 
 
6710
static void _vala_edsf_persona_set_property (GObject * object, guint property_id, const GValue * value, GParamSpec * pspec) {
 
6711
        EdsfPersona * self;
 
6712
        self = EDSF_PERSONA (object);
 
6713
        switch (property_id) {
 
6714
                case EDSF_PERSONA_CONTACT:
 
6715
                edsf_persona_set_contact (self, g_value_get_object (value));
 
6716
                break;
 
6717
                case EDSF_PERSONA_WEB_SERVICE_ADDRESSES:
 
6718
                folks_web_service_details_set_web_service_addresses ((FolksWebServiceDetails*) self, g_value_get_object (value));
 
6719
                break;
 
6720
                case EDSF_PERSONA_LOCAL_IDS:
 
6721
                folks_local_id_details_set_local_ids ((FolksLocalIdDetails*) self, g_value_get_object (value));
 
6722
                break;
 
6723
                case EDSF_PERSONA_POSTAL_ADDRESSES:
 
6724
                folks_postal_address_details_set_postal_addresses ((FolksPostalAddressDetails*) self, g_value_get_object (value));
 
6725
                break;
 
6726
                case EDSF_PERSONA_PHONE_NUMBERS:
 
6727
                folks_phone_details_set_phone_numbers ((FolksPhoneDetails*) self, g_value_get_object (value));
 
6728
                break;
 
6729
                case EDSF_PERSONA_EMAIL_ADDRESSES:
 
6730
                folks_email_details_set_email_addresses ((FolksEmailDetails*) self, g_value_get_object (value));
 
6731
                break;
 
6732
                case EDSF_PERSONA_NOTES:
 
6733
                folks_note_details_set_notes ((FolksNoteDetails*) self, g_value_get_object (value));
 
6734
                break;
 
6735
                case EDSF_PERSONA_AVATAR:
 
6736
                folks_avatar_details_set_avatar ((FolksAvatarDetails*) self, g_value_get_object (value));
 
6737
                break;
 
6738
                case EDSF_PERSONA_STRUCTURED_NAME:
 
6739
                folks_name_details_set_structured_name ((FolksNameDetails*) self, g_value_get_object (value));
 
6740
                break;
 
6741
                case EDSF_PERSONA_CONTACT_ID:
 
6742
                edsf_persona_set_contact_id (self, g_value_get_string (value));
 
6743
                break;
 
6744
                case EDSF_PERSONA_FULL_NAME:
 
6745
                folks_name_details_set_full_name ((FolksNameDetails*) self, g_value_get_string (value));
 
6746
                break;
 
6747
                case EDSF_PERSONA_NICKNAME:
 
6748
                folks_name_details_set_nickname ((FolksNameDetails*) self, g_value_get_string (value));
 
6749
                break;
 
6750
                case EDSF_PERSONA_GENDER:
 
6751
                folks_gender_details_set_gender ((FolksGenderDetails*) self, g_value_get_enum (value));
 
6752
                break;
 
6753
                case EDSF_PERSONA_URLS:
 
6754
                folks_url_details_set_urls ((FolksUrlDetails*) self, g_value_get_object (value));
 
6755
                break;
 
6756
                case EDSF_PERSONA_IM_ADDRESSES:
 
6757
                folks_im_details_set_im_addresses ((FolksImDetails*) self, g_value_get_object (value));
 
6758
                break;
 
6759
                case EDSF_PERSONA_GROUPS:
 
6760
                folks_group_details_set_groups ((FolksGroupDetails*) self, g_value_get_object (value));
 
6761
                break;
 
6762
                case EDSF_PERSONA_CALENDAR_EVENT_ID:
 
6763
                folks_birthday_details_set_calendar_event_id ((FolksBirthdayDetails*) self, g_value_get_string (value));
 
6764
                break;
 
6765
                case EDSF_PERSONA_BIRTHDAY:
 
6766
                folks_birthday_details_set_birthday ((FolksBirthdayDetails*) self, g_value_get_boxed (value));
 
6767
                break;
 
6768
                case EDSF_PERSONA_ROLES:
 
6769
                folks_role_details_set_roles ((FolksRoleDetails*) self, g_value_get_object (value));
 
6770
                break;
 
6771
                default:
 
6772
                G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
 
6773
                break;
 
6774
        }
 
6775
}
 
6776
 
 
6777
 
 
6778
static void _vala_array_destroy (gpointer array, gint array_length, GDestroyNotify destroy_func) {
 
6779
        if ((array != NULL) && (destroy_func != NULL)) {
 
6780
                int i;
 
6781
                for (i = 0; i < array_length; i = i + 1) {
 
6782
                        if (((gpointer*) array)[i] != NULL) {
 
6783
                                destroy_func (((gpointer*) array)[i]);
 
6784
                        }
 
6785
                }
 
6786
        }
 
6787
}
 
6788
 
 
6789
 
 
6790
static void _vala_array_free (gpointer array, gint array_length, GDestroyNotify destroy_func) {
 
6791
        _vala_array_destroy (array, array_length, destroy_func);
 
6792
        g_free (array);
 
6793
}
 
6794
 
 
6795
 
 
6796
static gint _vala_array_length (gpointer array) {
 
6797
        int length;
 
6798
        length = 0;
 
6799
        if (array) {
 
6800
                while (((gpointer*) array)[length]) {
 
6801
                        length++;
 
6802
                }
 
6803
        }
 
6804
        return length;
 
6805
}
 
6806
 
 
6807
 
 
6808