After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 678156 - [new roster] People nearby group
[new roster] People nearby group
Status: RESOLVED FIXED
Product: empathy
Classification: Core
Component: Contact List
2.33.x
Other Linux
: Normal enhancement
: ---
Assigned To: empathy-maint
empathy-maint
Depends on:
Blocks:
 
 
Reported: 2012-06-15 11:06 UTC by Guillaume Desmottes
Modified: 2012-06-20 11:50 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
Create and use People Nearby group (2.43 KB, patch)
2012-06-19 14:21 UTC, Laurent Contzen
reviewed Details | Review
Create and use People Nearby group (2.46 KB, patch)
2012-06-20 09:14 UTC, Laurent Contzen
reviewed Details | Review
Create and use People Nearby group (2.47 KB, patch)
2012-06-20 11:03 UTC, Laurent Contzen
committed Details | Review

Description Guillaume Desmottes 2012-06-15 11:06:40 UTC
We should re-implement the 'People nearby' group.
Comment 1 Laurent Contzen 2012-06-19 14:21:37 UTC
Created attachment 216753 [details] [review]
Create and use People Nearby group
Comment 2 Guillaume Desmottes 2012-06-19 14:41:46 UTC
Review of attachment 216753 [details] [review]:

::: libempathy-gtk/empathy-roster-view.c
@@ +168,3 @@
 
+static gboolean
+is_xmpp_local_contact(FolksIndividual *individual)

missing space before '('; make check should catch this.

@@ +174,3 @@
+  const gchar *protocol_name = NULL;
+
+  contact = empathy_contact_dup_from_folks_individual (individual);

the contact is leaked. YOu should unref it once you're done with it.

@@ +175,3 @@
+
+  contact = empathy_contact_dup_from_folks_individual (individual);
+  EmpathyContact *contact;

you can early return if contact == NULL to reduce nesting.

@@ +244,3 @@
   if (!tp_strdiff (group, TOP_GROUP))
     roster_group = empathy_roster_group_new (group, "emblem-favorite-symbolic");
+  else if(!tp_strdiff (group, PEOPLE_NEARBY))

missing space.
Comment 3 Laurent Contzen 2012-06-20 09:14:32 UTC
Created attachment 216808 [details] [review]
Create and use People Nearby group
Comment 4 Guillaume Desmottes 2012-06-20 09:27:16 UTC
Review of attachment 216808 [details] [review]:

::: libempathy-gtk/empathy-roster-view.c
@@ +182,3 @@
+  g_object_unref (contact);
+
+  contact = empathy_contact_dup_from_folks_individual (individual);

You are using an object (connection) borrowed from another object (contact) you should unref. So, in theory, the connection could have been destroyed when you unrefed the contact. In pratice it works because the TpConnection is shared accross tp-glib but it's best to keep it safe.

you can do something like:

result = !tp_strdiff ();
g_object_unref (contact);
return result;
Comment 5 Laurent Contzen 2012-06-20 11:03:28 UTC
Created attachment 216816 [details] [review]
Create and use People Nearby group
Comment 6 Guillaume Desmottes 2012-06-20 11:49:36 UTC
Review of attachment 216816 [details] [review]:

Looks good, thanks!
Comment 7 Guillaume Desmottes 2012-06-20 11:50:17 UTC
Attachment 216816 [details] pushed as d3d7a1f - Create and use People Nearby group