Recent contacts view on home screen

Hi guys, I've added some logic to create the recent contacts view. It took me a while and a lot of searching to create this functionality. With this branch, recent contacts are parsed in home.js, and listed out in descending order by the number of occurrence (the more common a name appears on screen, the higher it is on the list).
The number of contacts is limited to 5 and the user's own name is omitted from the list.

 However, there is still a part where I still don't understand (I know, I coded this up O_o). Particularly between line 124 to 134 of home.js. 
Hopefully y'all can shed some light on this and review the PR in the meantime!

Cheers! :smiley: 
Sure!  I'll prolly add to this over the next couple of days, but I can try to explain some now.  So, the comment prior to this on line 153 hopefully worked, and returned an array of unique names, `uniqueNames`.

With that, I think it should work to do (note, this is different than my earlier comment, I forgot some quote characters):
<pre>
uniqueNames.sort(function(a,b){
    return $("[data-id='" + a.dataset.id + "']").length - $("[data-id='" + b.dataset.id + "']").length;
});
</pre>
Hopefully, this should be able to sort the uniqueNames array, which you could use in the for loop on line 160.
So, when I said that "you could move the counting logic to here", I meant that you could replace the `userCount++`'s with the sort line, assuming that it works.

In order to get the span elements into the array, I thought that the `var uniqueNames = _.unique($('.name'), function(el){return el.dataset.id});` line from the earlier comment should have worked for this.  If it doesn't work, can you describe the output further?  In my mind, `$('.name')` should get an "array" of the span elements, and underscore should take care of uniqu-ify-ing them using the callback function.

I hope this made some sense haha, lemme know if it still doesn't.  :D The overall code I'm imagining is this:
<pre>
var uniqueNames = _.unique($('.name'), function(el){return el.dataset.id});
uniqueNames.sort(function(a,b){
    return $("[data-id='" + a.dataset.id + "']").length - $("[data-id='" + b.dataset.id + "']").length;
});
var $contactsContent = $('.contacts-content');
for (var i=0; i&lt;uniqueNames.length && i&lt;5; i++){
    $contactsContent.append(.......)
}
</pre>