GNOME Bugzilla – Bug 678083
Find a better heuristic to compute contacts popularity
Last modified: 2012-06-18 10:55: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.
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.
Created attachment 216436 [details] [review] Add better heuristics for populating the top of the list
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.
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"?
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)
Review of attachment 216594 [details] [review]: ++
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.
Created attachment 216667 [details] [review] Add better heuristics for populating the top of the list
Review of attachment 216667 [details] [review]: Looks good, I'll merge.