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 678083 - Find a better heuristic to compute contacts popularity
Find a better heuristic to compute contacts popularity
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:
 
 
Reported: 2012-06-14 09:38 UTC by Guillaume Desmottes
Modified: 2012-06-18 10:55 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
Add better heuristics for populating the top of the list (1.96 KB, patch)
2012-06-14 17:18 UTC, Seif Lotfy
reviewed Details | Review
Add better heuristics for populating the top of the list (5.03 KB, patch)
2012-06-16 18:27 UTC, Seif Lotfy
reviewed Details | Review
Add popular contacts to the Top Contacts (1.01 KB, patch)
2012-06-16 22:29 UTC, Seif Lotfy
committed Details | Review
Add better heuristics for populating the top of the list (3.22 KB, patch)
2012-06-18 10:48 UTC, Seif Lotfy
committed Details | Review

Description Guillaume Desmottes 2012-06-14 09:38:11 UTC
Atm the most popular contacts are just the ones having the higher IM interaction count. We should find a better heuristic using the last IM interaction property as well so one contact we use to talk a lot but are now talking to any more will progressively move out of the 'top contacts' list.
Comment 1 Guillaume Desmottes 2012-06-14 09:48:07 UTC
We also want to have the "top contacts" listbeing relatively stable. So we could do something like $LAST  being the epoch time of the last IM interaction rounded to the day (ignoring hours, minutes and seconds).

Seif suggested to use $LAST / $COUNT but that doesn't work because the more you chat with someone the more his popularity will be reduced; we actually want the opposite. With this formula, if you send one single message to someone and then stop talking to him, his popularity will stay pretty high as it will be equal to $LAST.
Comment 2 Seif Lotfy 2012-06-14 17:18:09 UTC
Created attachment 216436 [details] [review]
Add better heuristics for populating the top of the list
Comment 3 Guillaume Desmottes 2012-06-15 10:48:28 UTC
Review of attachment 216436 [details] [review]:

Looks like your patch is based on my WIP patch. This patch wasn't supposed to be merged (we don't want the debug g_print). You should drop it and base your patch on top of master.

::: libempathy/empathy-individual-manager.c
@@ +49,3 @@
 #define TOP_INDIVIDUALS_LEN 5
+#define INDIVIDUALS_COUNT_COMPRESS_FACTOR 50
+#define TIMEINTERVAL_UNIT_LENGTH 86400

Please add a comment explaining where this number is coming from.
Comment 4 Seif Lotfy 2012-06-16 18:27:39 UTC
Created attachment 216586 [details] [review]
Add better heuristics for populating the top of the list

This patch is based on master. It pushes the most contacted to the top of the list. A question though. Shouldn't they also appear under "Top Contacts"?
Comment 5 Seif Lotfy 2012-06-16 22:29:54 UTC
Created attachment 216594 [details] [review]
Add popular contacts to the Top Contacts

Complementary patch to the previous one to add the pop contacts to the Top Contacts group (alongside the favourited)
Comment 6 Guillaume Desmottes 2012-06-18 09:35:34 UTC
Review of attachment 216594 [details] [review]:

++
Comment 7 Guillaume Desmottes 2012-06-18 09:44:20 UTC
Review of attachment 216586 [details] [review]:

::: libempathy/empathy-individual-manager.c
@@ +50,3 @@
 
+/* The constant INDIVIDUALS_COUNT_COMPRESS_FACTOR represents the number of
+ *interactions needed to be considered as 1 interaction */

Missing space before 'interactions'.

@@ +90,2 @@
 static guint signals[LAST_SIGNAL] = { 0 };
+static guint global_interaction_counter = 0;

Why use a global variable instead of the private struct of the object?

@@ +151,3 @@
+    return 0;
+
+

Where are these 1000000 coming from? Please use a define and/or add a comment.

@@ -195,3 @@
-          FolksIndividual *individual = l->data;
-
-          DEBUG ("  %s (%u)",

Why did you remove these DEBUG? They can be pretty useful.

@@ +239,3 @@
+
+  /* Only check for top individuals after x interaction events happen, where
+   * x = INTERACTION_COUNT_COMPRESS_FACTOR */

Is that really what we want? That means we may have to wait 2 * INTERACTION_COUNT_COMPRESS_FACTOR before moving a contact to the top list.
Comment 8 Seif Lotfy 2012-06-18 10:48:02 UTC
Created attachment 216667 [details] [review]
Add better heuristics for populating the top of the list
Comment 9 Guillaume Desmottes 2012-06-18 10:53:24 UTC
Review of attachment 216667 [details] [review]:

Looks good, I'll merge.