1
From c6371ec63c928c848cbb5474cb005af5cc414230 Mon Sep 17 00:00:00 2001
2
From: Philip Withnall <philip.withnall@collabora.co.uk>
3
Date: Sun, 12 Dec 2010 18:51:07 +0000
4
Subject: Bug 637097 — Port to latest folks API changes
5
Note: This patch has been updated to apply to empathy 2.32
7
Catch up with three interface renamings which have happened in folks master.
8
This bumps Empathy's folks dependency to 0.3.3. Closes: bgo#637097
10
Index: empathy-2.32.2/configure.ac
11
===================================================================
12
--- empathy-2.32.2.orig/configure.ac 2011-01-06 14:06:24.000000000 +1100
13
+++ empathy-2.32.2/configure.ac 2011-01-06 14:06:30.886667000 +1100
15
# Minimal version required
23
Index: empathy-2.32.2/libempathy-gtk/empathy-contact-widget.c
24
===================================================================
25
--- empathy-2.32.2.orig/libempathy-gtk/empathy-contact-widget.c 2011-01-06 14:06:24.000000000 +1100
26
+++ empathy-2.32.2/libempathy-gtk/empathy-contact-widget.c 2011-01-06 14:06:30.886667000 +1100
27
@@ -1284,10 +1284,10 @@
28
FolksPersona *persona = empathy_contact_get_persona (
29
information->contact);
31
- if (persona != NULL && FOLKS_IS_FAVOURITE (persona))
32
+ if (persona != NULL && FOLKS_IS_FAVOURITABLE (persona))
34
- gboolean is_favourite = folks_favourite_get_is_favourite (
35
- FOLKS_FAVOURITE (persona));
36
+ gboolean is_favourite = folks_favouritable_get_is_favourite (
37
+ FOLKS_FAVOURITABLE (persona));
38
contact_widget_favourites_changed_cb (information->manager,
39
information->contact, is_favourite, information);
41
@@ -1418,10 +1418,10 @@
43
FolksPersona *persona = empathy_contact_get_persona (information->contact);
45
- if (persona != NULL && FOLKS_IS_FAVOURITE (persona))
46
+ if (persona != NULL && FOLKS_IS_FAVOURITABLE (persona))
48
gboolean active = gtk_toggle_button_get_active (button);
49
- folks_favourite_set_is_favourite (FOLKS_FAVOURITE (persona), active);
50
+ folks_favouritable_set_is_favourite (FOLKS_FAVOURITABLE (persona), active);
54
Index: empathy-2.32.2/libempathy-gtk/empathy-individual-menu.c
55
===================================================================
56
--- empathy-2.32.2.orig/libempathy-gtk/empathy-individual-menu.c 2010-11-19 01:25:30.000000000 +1100
57
+++ empathy-2.32.2/libempathy-gtk/empathy-individual-menu.c 2011-01-06 14:06:30.886667000 +1100
59
favourite_menu_item_toggled_cb (GtkCheckMenuItem *item,
60
FolksIndividual *individual)
62
- folks_favourite_set_is_favourite (FOLKS_FAVOURITE (individual),
63
+ folks_favouritable_set_is_favourite (FOLKS_FAVOURITABLE (individual),
64
gtk_check_menu_item_get_active (item));
68
item = gtk_check_menu_item_new_with_label (_("Favorite"));
70
gtk_check_menu_item_set_active (GTK_CHECK_MENU_ITEM (item),
71
- folks_favourite_get_is_favourite (FOLKS_FAVOURITE (individual)));
72
+ folks_favouritable_get_is_favourite (FOLKS_FAVOURITABLE (individual)));
74
g_signal_connect (item, "toggled",
75
G_CALLBACK (favourite_menu_item_toggled_cb), individual);
76
Index: empathy-2.32.2/libempathy-gtk/empathy-individual-store.c
77
===================================================================
78
--- empathy-2.32.2.orig/libempathy-gtk/empathy-individual-store.c 2011-01-06 14:06:27.000000000 +1100
79
+++ empathy-2.32.2/libempathy-gtk/empathy-individual-store.c 2011-01-06 14:08:52.356667001 +1100
83
if (priv->show_groups &&
84
- folks_favourite_get_is_favourite (FOLKS_FAVOURITE (individual)))
85
+ folks_favouritable_get_is_favourite (FOLKS_FAVOURITABLE (individual)))
87
/* Add contact to the fake 'Favorites' group */
88
GtkTreeIter iter_group;
92
/* Get online state now. */
93
- now_online = folks_presence_is_online (FOLKS_PRESENCE (individual));
94
+ now_online = folks_has_presence_is_online (FOLKS_HAS_PRESENCE (individual));
99
EMPATHY_INDIVIDUAL_STORE_COL_NAME,
100
folks_aliasable_get_alias (FOLKS_ALIASABLE (individual)),
101
EMPATHY_INDIVIDUAL_STORE_COL_PRESENCE_TYPE,
102
- folks_presence_get_presence_type (FOLKS_PRESENCE (individual)),
103
+ folks_has_presence_get_presence_type (FOLKS_HAS_PRESENCE (individual)),
104
EMPATHY_INDIVIDUAL_STORE_COL_STATUS,
105
- folks_presence_get_presence_message (FOLKS_PRESENCE (individual)),
106
+ folks_has_presence_get_presence_message (FOLKS_HAS_PRESENCE (individual)),
107
EMPATHY_INDIVIDUAL_STORE_COL_COMPACT, priv->is_compact,
108
EMPATHY_INDIVIDUAL_STORE_COL_IS_GROUP, FALSE,
109
EMPATHY_INDIVIDUAL_STORE_COL_IS_ONLINE, now_online,
110
@@ -1422,9 +1422,9 @@
113
folks_presence_type_a =
114
- folks_presence_get_presence_type (FOLKS_PRESENCE (individual_a));
115
+ folks_has_presence_get_presence_type (FOLKS_HAS_PRESENCE (individual_a));
116
folks_presence_type_b =
117
- folks_presence_get_presence_type (FOLKS_PRESENCE (individual_b));
118
+ folks_has_presence_get_presence_type (FOLKS_HAS_PRESENCE (individual_b));
119
tp_presence_a = empathy_folks_presence_type_to_tp (folks_presence_type_a);
120
tp_presence_b = empathy_folks_presence_type_to_tp (folks_presence_type_b);
122
Index: empathy-2.32.2/libempathy-gtk/empathy-individual-view.c
123
===================================================================
124
--- empathy-2.32.2.orig/libempathy-gtk/empathy-individual-view.c 2011-01-06 14:06:27.000000000 +1100
125
+++ empathy-2.32.2/libempathy-gtk/empathy-individual-view.c 2011-01-06 14:07:57.406667001 +1100
126
@@ -370,14 +370,14 @@
127
if (!tp_strdiff (new_group, EMPATHY_INDIVIDUAL_STORE_FAVORITE))
129
/* Mark contact as favourite */
130
- folks_favourite_set_is_favourite (FOLKS_FAVOURITE (individual), TRUE);
131
+ folks_favouritable_set_is_favourite (FOLKS_FAVOURITABLE (individual), TRUE);
135
if (!tp_strdiff (old_group, EMPATHY_INDIVIDUAL_STORE_FAVORITE))
137
/* Remove contact as favourite */
138
- folks_favourite_set_is_favourite (FOLKS_FAVOURITE (individual), FALSE);
139
+ folks_favouritable_set_is_favourite (FOLKS_FAVOURITABLE (individual), FALSE);
141
/* Don't try to remove it */
146
if (individual != NULL &&
147
- folks_presence_is_online (FOLKS_PRESENCE (individual)) &&
148
+ folks_has_presence_is_online (FOLKS_HAS_PRESENCE (individual)) &&
149
(caps & EMPATHY_CAPABILITIES_FT))
151
gdk_drag_status (context, GDK_ACTION_COPY, time_);
152
Index: empathy-2.32.2/libempathy-gtk/empathy-individual-widget.c
153
===================================================================
154
--- empathy-2.32.2.orig/libempathy-gtk/empathy-individual-widget.c 2011-01-06 14:06:24.000000000 +1100
155
+++ empathy-2.32.2/libempathy-gtk/empathy-individual-widget.c 2011-01-06 14:06:30.886667000 +1100
158
/* FIXME: We just choose the first Persona which has an avatar, and save that.
159
* The avatar handling in EmpathyContact needs to be moved into libfolks as
160
- * much as possible, and this code rewritten to use FolksAvatar.
161
+ * much as possible, and this code rewritten to use FolksHasAvatar.
163
personas = folks_individual_get_personas (individual);
164
for (l = personas; l != NULL; l = l->next)
165
@@ -1070,8 +1070,8 @@
166
EmpathyIndividualWidget *self)
168
gboolean active = gtk_toggle_button_get_active (button);
169
- folks_favourite_set_is_favourite (
170
- FOLKS_FAVOURITE (GET_PRIV (self)->individual), active);
171
+ folks_favouritable_set_is_favourite (
172
+ FOLKS_FAVOURITABLE (GET_PRIV (self)->individual), active);
176
@@ -1167,11 +1167,13 @@
177
state_image = g_object_get_data (table, "state-image");
179
/* FIXME: Default messages should be moved into libfolks (bgo#627403) */
180
- message = folks_presence_get_presence_message (FOLKS_PRESENCE (folks_object));
181
+ message = folks_has_presence_get_presence_message (
182
+ FOLKS_HAS_PRESENCE (folks_object));
183
if (EMP_STR_EMPTY (message))
185
message = empathy_presence_get_default_message (
186
- folks_presence_get_presence_type (FOLKS_PRESENCE (folks_object)));
187
+ folks_has_presence_get_presence_type (
188
+ FOLKS_HAS_PRESENCE (folks_object)));
192
@@ -1181,7 +1183,8 @@
194
gtk_image_set_from_icon_name (GTK_IMAGE (state_image),
195
empathy_icon_name_for_presence (
196
- folks_presence_get_presence_type (FOLKS_PRESENCE (folks_object))),
197
+ folks_has_presence_get_presence_type (
198
+ FOLKS_HAS_PRESENCE (folks_object))),
199
GTK_ICON_SIZE_BUTTON);
200
gtk_widget_show (state_image);
202
@@ -1210,7 +1213,8 @@
203
if (GTK_IS_TOGGLE_BUTTON (favourite_widget))
205
gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (favourite_widget),
206
- folks_favourite_get_is_favourite (FOLKS_FAVOURITE (folks_object)));
207
+ folks_favouritable_get_is_favourite (
208
+ FOLKS_FAVOURITABLE (folks_object)));
212
Index: empathy-2.32.2/libempathy-gtk/empathy-persona-store.c
213
===================================================================
214
--- empathy-2.32.2.orig/libempathy-gtk/empathy-persona-store.c 2011-01-06 14:06:24.000000000 +1100
215
+++ empathy-2.32.2/libempathy-gtk/empathy-persona-store.c 2011-01-06 14:06:30.886667000 +1100
217
gtk_tree_path_free (path);
219
/* Get online state now. */
220
- now_online = folks_presence_is_online (FOLKS_PRESENCE (persona));
221
+ now_online = folks_has_presence_is_online (FOLKS_HAS_PRESENCE (persona));
223
/* Get online state before. */
224
gtk_tree_model_get (GTK_TREE_MODEL (self), &iter,
226
EMPATHY_PERSONA_STORE_COL_DISPLAY_ID,
227
folks_persona_get_display_id (persona),
228
EMPATHY_PERSONA_STORE_COL_PRESENCE_TYPE,
229
- folks_presence_get_presence_type (FOLKS_PRESENCE (persona)),
230
+ folks_has_presence_get_presence_type (
231
+ FOLKS_HAS_PRESENCE (persona)),
232
EMPATHY_PERSONA_STORE_COL_STATUS,
233
- folks_presence_get_presence_message (FOLKS_PRESENCE (persona)),
234
+ folks_has_presence_get_presence_message (
235
+ FOLKS_HAS_PRESENCE (persona)),
236
EMPATHY_PERSONA_STORE_COL_IS_ONLINE, now_online,
237
EMPATHY_PERSONA_STORE_COL_CAN_AUDIO_CALL,
238
empathy_contact_get_capabilities (contact) &
242
ret_val = -tp_connection_presence_type_cmp_availability (
243
- folks_presence_get_presence_type (FOLKS_PRESENCE (persona_a)),
244
- folks_presence_get_presence_type (FOLKS_PRESENCE (persona_b)));
245
+ folks_has_presence_get_presence_type (FOLKS_HAS_PRESENCE (persona_a)),
246
+ folks_has_presence_get_presence_type (FOLKS_HAS_PRESENCE (persona_b)));
249
/* Fallback: compare by name et al. */
250
Index: empathy-2.32.2/libempathy-gtk/empathy-ui-utils.c
251
===================================================================
252
--- empathy-2.32.2.orig/libempathy-gtk/empathy-ui-utils.c 2011-01-06 14:06:27.000000000 +1100
253
+++ empathy-2.32.2/libempathy-gtk/empathy-ui-utils.c 2011-01-06 14:07:25.716667000 +1100
255
FolksPresenceType folks_presence;
256
TpConnectionPresenceType presence;
259
- folks_presence_get_presence_type (FOLKS_PRESENCE (individual));
260
+ folks_presence = folks_has_presence_get_presence_type (FOLKS_HAS_PRESENCE (individual));
261
presence = empathy_folks_presence_type_to_tp (folks_presence);
263
return empathy_icon_name_for_presence (presence);
266
empathy_pixbuf_avatar_from_individual_scaled_async);
268
- avatar_file = folks_avatar_get_avatar (FOLKS_AVATAR (individual));
270
+ folks_has_avatar_get_avatar (FOLKS_HAS_AVATAR (individual));
271
if (avatar_file == NULL)
274
Index: empathy-2.32.2/libempathy/empathy-contact.c
275
===================================================================
276
--- empathy-2.32.2.orig/libempathy/empathy-contact.c 2011-01-06 14:06:24.000000000 +1100
277
+++ empathy-2.32.2/libempathy/empathy-contact.c 2011-01-06 14:06:30.896667000 +1100
280
if (priv->persona != NULL)
282
- folks_presence_set_presence_message (FOLKS_PRESENCE (priv->persona),
284
+ folks_has_presence_set_presence_message (
285
+ FOLKS_HAS_PRESENCE (priv->persona), message);
290
priv = GET_PRIV (contact);
292
if (priv->persona != NULL)
293
- return folks_presence_get_presence_message (FOLKS_PRESENCE (priv->persona));
295
+ return folks_has_presence_get_presence_message (
296
+ FOLKS_HAS_PRESENCE (priv->persona));
301
@@ -1740,15 +1743,16 @@
302
presence_cmp_func (EmpathyContact *a,
305
- FolksPresence *presence_a, *presence_b;
306
+ FolksHasPresence *presence_a, *presence_b;
308
- presence_a = FOLKS_PRESENCE (empathy_contact_get_persona (a));
309
- presence_b = FOLKS_PRESENCE (empathy_contact_get_persona (b));
310
+ presence_a = FOLKS_HAS_PRESENCE (empathy_contact_get_persona (a));
311
+ presence_b = FOLKS_HAS_PRESENCE (empathy_contact_get_persona (b));
313
/* We negate the result because we're sorting in reverse order (i.e. such that
314
* the Personas with the highest presence are at the beginning of the list. */
315
- return -folks_presence_typecmp (folks_presence_get_presence_type (presence_a),
316
- folks_presence_get_presence_type (presence_b));
317
+ return -folks_has_presence_typecmp (
318
+ folks_has_presence_get_presence_type (presence_a),
319
+ folks_has_presence_get_presence_type (presence_b));
323
Index: empathy-2.32.2/libempathy/empathy-individual-manager.c
324
===================================================================
325
--- empathy-2.32.2.orig/libempathy/empathy-individual-manager.c 2011-01-06 14:06:27.000000000 +1100
326
+++ empathy-2.32.2/libempathy/empathy-individual-manager.c 2011-01-06 14:06:30.896667000 +1100
329
EmpathyIndividualManager *self)
331
- gboolean is_favourite = folks_favourite_get_is_favourite (
332
- FOLKS_FAVOURITE (individual));
333
+ gboolean is_favourite = folks_favouritable_get_is_favourite (
334
+ FOLKS_FAVOURITABLE (individual));
335
g_signal_emit (self, signals[FAVOURITES_CHANGED], 0, individual,