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 663763 - Some contact/invidiual misc patches
Some contact/invidiual misc patches
Status: RESOLVED FIXED
Product: empathy
Classification: Core
Component: General
2.33.x
Other Linux
: Normal enhancement
: ---
Assigned To: empathy-maint
empathy-maint
Depends on:
Blocks: 663387
 
 
Reported: 2011-11-10 11:08 UTC by Guillaume Desmottes
Modified: 2011-11-16 14:50 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
details_update_show: skip empty field (943 bytes, patch)
2011-11-10 11:17 UTC, Guillaume Desmottes
accepted-commit_now Details | Review
update_weak_contact: use a greater or equal comparaison (1.49 KB, patch)
2011-11-10 11:17 UTC, Guillaume Desmottes
committed Details | Review
factor out empathy_contact_info_create_channel_list_label() (9.80 KB, patch)
2011-11-10 11:17 UTC, Guillaume Desmottes
reviewed Details | Review
individual-widget: factor out add_row() (2.80 KB, patch)
2011-11-10 11:17 UTC, Guillaume Desmottes
accepted-commit_now Details | Review
individual-widget: display channels list if available (1.65 KB, patch)
2011-11-10 11:17 UTC, Guillaume Desmottes
committed Details | Review
individual-store: use self->priv pattern (27.68 KB, patch)
2011-11-10 11:17 UTC, Guillaume Desmottes
accepted-commit_now Details | Review
individual-view: remove explicit boolean comparaisons (3.49 KB, patch)
2011-11-10 11:17 UTC, Guillaume Desmottes
accepted-commit_now Details | Review
individual-view: add an option to disable uninteresting filtering (5.88 KB, patch)
2011-11-10 11:17 UTC, Guillaume Desmottes
reviewed Details | Review
individual-view: don't display menu if empathy_folks_individual_contains_contact() fails (1.25 KB, patch)
2011-11-10 11:17 UTC, Guillaume Desmottes
committed Details | Review
empathy_individual_store_remove_individual: use EMPATHY_INDIVIDUAL_STORE_COL_NAME (1.11 KB, patch)
2011-11-10 11:17 UTC, Guillaume Desmottes
accepted-commit_now Details | Review
main-window: use the EmpathyIndividual flavor of some types (1.69 KB, patch)
2011-11-10 11:17 UTC, Guillaume Desmottes
accepted-commit_now Details | Review
update_weak_contact: use a greater or equal comparaison (1.20 KB, patch)
2011-11-14 09:50 UTC, Guillaume Desmottes
committed Details | Review
factor out empathy_contact_info_create_channel_list_label() (9.84 KB, patch)
2011-11-14 09:50 UTC, Guillaume Desmottes
reviewed Details | Review
individual-view: add an option to disable uninteresting filtering (6.51 KB, patch)
2011-11-14 09:51 UTC, Guillaume Desmottes
reviewed Details | Review
individual-view: don't display menu if empathy_folks_individual_contains_contact() fails (1.52 KB, patch)
2011-11-14 09:51 UTC, Guillaume Desmottes
committed Details | Review
factor out empathy_contact_info_create_channel_list_label() (9.64 KB, patch)
2011-11-16 10:32 UTC, Guillaume Desmottes
committed Details | Review
individual-view: add an option to disable uninteresting filtering (7.64 KB, patch)
2011-11-16 10:32 UTC, Guillaume Desmottes
committed Details | Review

Description Guillaume Desmottes 2011-11-10 11:08:43 UTC
This is the first part of bug #663387 containing the simple, uncontroverisal patches.
Comment 1 Guillaume Desmottes 2011-11-10 11:17:24 UTC
Created attachment 201130 [details] [review]
details_update_show: skip empty field
Comment 2 Guillaume Desmottes 2011-11-10 11:17:27 UTC
Created attachment 201131 [details] [review]
update_weak_contact: use a greater or equal comparaison

That way we'll pick at least one TpContact if there is only one contact in
the individual and he doesn't have any presence (IRC for example).
Comment 3 Guillaume Desmottes 2011-11-10 11:17:30 UTC
Created attachment 201132 [details] [review]
factor out empathy_contact_info_create_channel_list_label()

Move it to empathy-contactinfo-utils so we'll be able to re-use it in
empathy-individual-widget as well.
Comment 4 Guillaume Desmottes 2011-11-10 11:17:32 UTC
Created attachment 201133 [details] [review]
individual-widget: factor out add_row()
Comment 5 Guillaume Desmottes 2011-11-10 11:17:35 UTC
Created attachment 201134 [details] [review]
individual-widget: display channels list if available

This will be needed when using this widget in MUC.
Comment 6 Guillaume Desmottes 2011-11-10 11:17:38 UTC
Created attachment 201135 [details] [review]
individual-store: use self->priv pattern

https://bugzilla.gnome.org/show_bug.cgi?id=663387
Comment 7 Guillaume Desmottes 2011-11-10 11:17:40 UTC
Created attachment 201136 [details] [review]
individual-view: remove explicit boolean comparaisons

https://bugzilla.gnome.org/show_bug.cgi?id=663387
Comment 8 Guillaume Desmottes 2011-11-10 11:17:42 UTC
Created attachment 201137 [details] [review]
individual-view: add an option to disable uninteresting filtering

This is needed when being used in a muc.

https://bugzilla.gnome.org/show_bug.cgi?id=663387
Comment 9 Guillaume Desmottes 2011-11-10 11:17:45 UTC
Created attachment 201138 [details] [review]
individual-view: don't display menu if empathy_folks_individual_contains_contact() fails

The individual menu already asserts that's the case. And there is no point
displaying a menu anyway.

https://bugzilla.gnome.org/show_bug.cgi?id=663387
Comment 10 Guillaume Desmottes 2011-11-10 11:17:48 UTC
Created attachment 201139 [details] [review]
empathy_individual_store_remove_individual: use EMPATHY_INDIVIDUAL_STORE_COL_NAME

https://bugzilla.gnome.org/show_bug.cgi?id=663387
Comment 11 Guillaume Desmottes 2011-11-10 11:17:50 UTC
Created attachment 201140 [details] [review]
main-window: use the EmpathyIndividual flavor of some types

We switched to EmpathyIndividualView a while ago...

https://bugzilla.gnome.org/show_bug.cgi?id=663387
Comment 13 Philip Withnall 2011-11-11 16:22:51 UTC
Review of attachment 201130 [details] [review]:

Looks good to me.
Comment 14 Philip Withnall 2011-11-11 16:26:14 UTC
Review of attachment 201131 [details] [review]:

::: libempathy-gtk/empathy-individual-widget.c
@@ +195,2 @@
               if (folks_presence_details_typecmp (
+                    presence_type_cur, presence_type) >= 0)

Wouldn't it be a bit clearer to instead do:
    if (tp_contact == NULL || folks_presence_details_typecmp (presence_type_cur, presence_type) > 0)
and drop the comment?

This would also ensure we don't change the current behaviour of the code for non-IRC cases.
Comment 15 Philip Withnall 2011-11-11 16:32:57 UTC
Review of attachment 201132 [details] [review]:

::: libempathy-gtk/empathy-contactinfo-utils.c
@@ +313,3 @@
+       * ensure it's actually a valid URI.  g_string_append_uri_escaped()
+       * escapes way more than we actually need to; so we're just using
+       * g_markup_escape_text directly.

g_string_append_uri_escaped() is definitely wrong to use here, since it's for escaping URI parameters to be appended to a URI, rather than HTML to be appended to a markup string.

@@ +324,3 @@
+      g_free (escaped);
+    }
+

Looks like channels is not getting unreffed after the loop.
Comment 16 Philip Withnall 2011-11-11 16:33:32 UTC
Review of attachment 201133 [details] [review]:

Looks good to me.
Comment 17 Philip Withnall 2011-11-11 16:35:23 UTC
Review of attachment 201134 [details] [review]:

Also looks good to me.
Comment 18 Philip Withnall 2011-11-11 16:40:42 UTC
Review of attachment 201135 [details] [review]:

Looks good to me.
Comment 19 Philip Withnall 2011-11-11 16:44:07 UTC
Review of attachment 201136 [details] [review]:

Eww. I guess this is in the Telepathy code style though. :-(
Comment 20 Philip Withnall 2011-11-11 16:47:50 UTC
Review of attachment 201137 [details] [review]:

This looks OK, but what about the call to empathy_folks_persona_is_interesting() in got_avatar()?

::: libempathy-gtk/empathy-individual-view.c
@@ +2216,3 @@
+      PROP_SHOW_UNINTERESTING,
+      g_param_spec_boolean ("show-uninteresting",
+          "Show Unteresting Individuals",

s/Unteresting/Uninteresting/

@@ +2217,3 @@
+      g_param_spec_boolean ("show-uninteresting",
+          "Show Unteresting Individuals",
+          "Whether the view should filter out individuals using "

s/should/should not/?
Comment 21 Philip Withnall 2011-11-11 16:49:06 UTC
Review of attachment 201138 [details] [review]:

::: libempathy-gtk/empathy-individual-view.c
@@ +2619,3 @@
 
+  if (!empathy_folks_individual_contains_contact (individual))
+    return NULL;

Looks like individual should be unreffed before returning.
Comment 22 Philip Withnall 2011-11-11 16:49:40 UTC
Review of attachment 201139 [details] [review]:

Good catch!
Comment 23 Philip Withnall 2011-11-11 16:51:46 UTC
Review of attachment 201140 [details] [review]:

Looks good to me.
Comment 24 Guillaume Desmottes 2011-11-14 09:33:43 UTC
Attachment 201130 [details] pushed as e6e284c - details_update_show: skip empty field
Attachment 201133 [details] pushed as 0a04322 - individual-widget: factor out add_row()
Attachment 201135 [details] pushed as 8a831cc - individual-store: use self->priv pattern
Attachment 201136 [details] pushed as c85a456 - individual-view: remove explicit boolean comparaisons
Attachment 201139 [details] pushed as bd386d1 - empathy_individual_store_remove_individual: use EMPATHY_INDIVIDUAL_STORE_COL_NAME
Attachment 201140 [details] pushed as 65d16f7 - main-window: use the EmpathyIndividual flavor of some types
Comment 25 Guillaume Desmottes 2011-11-14 09:39:52 UTC
Review of attachment 201131 [details] [review]:

::: libempathy-gtk/empathy-individual-widget.c
@@ +195,2 @@
               if (folks_presence_details_typecmp (
+                    presence_type_cur, presence_type) >= 0)

You're totally right. Changed.
Comment 26 Guillaume Desmottes 2011-11-14 09:42:48 UTC
Review of attachment 201132 [details] [review]:

::: libempathy-gtk/empathy-contactinfo-utils.c
@@ +313,3 @@
+       * ensure it's actually a valid URI.  g_string_append_uri_escaped()
+       * escapes way more than we actually need to; so we're just using
+  /* Is there channels? */

I didn't change this code, but it actually uses g_markup_escape_text().

@@ +324,3 @@
+      g_free (escaped);
+    }
+

Good point; fixed.
Comment 27 Guillaume Desmottes 2011-11-14 09:47:07 UTC
Review of attachment 201137 [details] [review]:

I added the check to got_avatar() as well.

::: libempathy-gtk/empathy-individual-view.c
@@ +2216,3 @@
+      PROP_SHOW_UNINTERESTING,
+      g_param_spec_boolean ("show-uninteresting",
+          "Show Unteresting Individuals",

fixed.

@@ +2217,3 @@
+      g_param_spec_boolean ("show-uninteresting",
+          "Show Unteresting Individuals",
+          "Whether the view should filter out individuals using "

fixed.
Comment 28 Guillaume Desmottes 2011-11-14 09:50:18 UTC
Review of attachment 201138 [details] [review]:

::: libempathy-gtk/empathy-individual-view.c
@@ +2619,3 @@
 
+  if (!empathy_folks_individual_contains_contact (individual))
+    return NULL;

fixed.
Comment 29 Guillaume Desmottes 2011-11-14 09:50:49 UTC
Created attachment 201350 [details] [review]
update_weak_contact: use a greater or equal comparaison

That way we'll pick at least one TpContact if there is only one contact in
the individual and he doesn't have any presence (IRC for example).
Comment 30 Guillaume Desmottes 2011-11-14 09:50:58 UTC
Created attachment 201351 [details] [review]
factor out empathy_contact_info_create_channel_list_label()

Move it to empathy-contactinfo-utils so we'll be able to re-use it in
empathy-individual-widget as well.
Comment 31 Guillaume Desmottes 2011-11-14 09:51:08 UTC
Created attachment 201352 [details] [review]
individual-view: add an option to disable uninteresting filtering

This is needed when being used in a muc.

https://bugzilla.gnome.org/show_bug.cgi?id=663387
Comment 32 Guillaume Desmottes 2011-11-14 09:51:16 UTC
Created attachment 201353 [details] [review]
individual-view: don't display menu if empathy_folks_individual_contains_contact() fails

The individual menu already asserts that's the case. And there is no point
displaying a menu anyway.

https://bugzilla.gnome.org/show_bug.cgi?id=663387
Comment 33 Philip Withnall 2011-11-14 13:56:25 UTC
Review of attachment 201350 [details] [review]:

Great.
Comment 34 Philip Withnall 2011-11-14 13:59:49 UTC
Review of attachment 201351 [details] [review]:

::: libempathy-gtk/empathy-contactinfo-utils.c
@@ +303,3 @@
+    {
+      g_ptr_array_unref (channels);
+      return NULL;

Just noticed that label_markup isn't freed in this case.

@@ +314,3 @@
+       * escapes way more than we actually need to; so we're just using
+       * g_markup_escape_text directly.
+       */

My point here was that the comment is wrong to suggest that g_string_append_uri_escaped() would ever be correct to use here.
Comment 35 Philip Withnall 2011-11-14 14:05:01 UTC
Review of attachment 201352 [details] [review]:

::: libempathy-gtk/empathy-individual-view.c
@@ +2510,3 @@
 
+      if (!priv->show_uninteresting &&
+          empathy_folks_persona_is_interesting (persona))

Shouldn't this be (priv->show_uninteresting || empathy_folks_persona_is_interesting (persona))? If we're showing uninteresting personas, we want to consider all of them when counting how many personas are in the individual.

In fact, in the case that (priv->show_uninteresting == TRUE), you could just skip doing that entire loop, and set persona_count = gee_collection_get_size (personas); instead.
Comment 36 Philip Withnall 2011-11-14 14:05:41 UTC
Review of attachment 201353 [details] [review]:

Looks good to me.
Comment 37 Guillaume Desmottes 2011-11-16 10:24:53 UTC
Review of attachment 201351 [details] [review]:

::: libempathy-gtk/empathy-contactinfo-utils.c
@@ +303,3 @@
+    {
+      g_ptr_array_unref (channels);
+  GString *label_markup = g_string_new ("");

Good catch; fixed.

@@ +314,3 @@
+       * escapes way more than we actually need to; so we're just using
+       * g_markup_escape_text directly.
+  channels = g_ptr_array_new ();

Ahh ok. I removed that part of the comment then.
Comment 38 Guillaume Desmottes 2011-11-16 10:32:09 UTC
Created attachment 201517 [details] [review]
factor out empathy_contact_info_create_channel_list_label()

Move it to empathy-contactinfo-utils so we'll be able to re-use it in
empathy-individual-widget as well.
Comment 39 Guillaume Desmottes 2011-11-16 10:32:38 UTC
Review of attachment 201352 [details] [review]:

::: libempathy-gtk/empathy-individual-view.c
@@ +2510,3 @@
 
+      if (!priv->show_uninteresting &&
+          empathy_folks_persona_is_interesting (persona))

Good point. Fixed.
Comment 40 Guillaume Desmottes 2011-11-16 10:32:46 UTC
Created attachment 201518 [details] [review]
individual-view: add an option to disable uninteresting filtering

This is needed when being used in a muc.
Comment 41 Philip Withnall 2011-11-16 14:09:10 UTC
Review of attachment 201517 [details] [review]:

Make it so!
Comment 42 Philip Withnall 2011-11-16 14:10:47 UTC
Review of attachment 201518 [details] [review]:

Looks good to me.
Comment 43 Guillaume Desmottes 2011-11-16 14:12:28 UTC
Attachment 201131 [details] pushed as 7c3389c - update_weak_contact: use a greater or equal comparaison
Attachment 201134 [details] pushed as 0366e51 - individual-widget: display channels list if available
Attachment 201138 [details] pushed as 20772a7 - individual-view: don't display menu if empathy_folks_individual_contains_contact() fails
Attachment 201350 [details] pushed as 7c3389c - update_weak_contact: use a greater or equal comparaison
Attachment 201353 [details] pushed as 20772a7 - individual-view: don't display menu if empathy_folks_individual_contains_contact() fails
Attachment 201517 [details] pushed as caae76c - factor out empathy_contact_info_create_channel_list_label()
Attachment 201518 [details] pushed as 9882c0f - individual-view: add an option to disable uninteresting filtering
Comment 44 Guillaume Desmottes 2011-11-16 14:15:37 UTC
All merged; thanks!
Comment 45 Guillaume Desmottes 2011-11-16 14:50:49 UTC
This problem has been fixed in the development version. The fix will be available in the next major software release. Thank you for your bug report.