diff --git a/js/public/app.js b/js/public/app.js
index 3ce3aca..766a219 100644
--- a/js/public/app.js
+++ b/js/public/app.js
@@ -127,7 +127,7 @@ var checkNewMessages = function() {
peerLabel = fn;
}
- if (inArray(peerLabel, bufferedContacts)) {
+ if (!inArray(peerLabel, bufferedContacts)) {
$("li[peer-label='" + peerLabel + "']").remove();
peerListBuf = '
' + peerLabel + ' (' + val + ')';
+
$('#app-mailbox-peers ul').prepend(peerListBuf);
bufferedContacts.push(peerLabel);
@@ -330,7 +331,7 @@ function fetchInitialPeerList(jsondata) {
fn = jsondata['contacts'][id];
peerLabel = fn;
}
- if (inArray(peerLabel, bufferedContacts)) {
+ if (!inArray(peerLabel, bufferedContacts)) {
aScope.addContact({'label': peerLabel, 'nav': idxVal2, 'avatar': jsondata['photos'][peerLabel]});
bufferedContacts.push(peerLabel);
}