Notify clients only once of empty buddy-list

This commit is contained in:
Robin Linus 2015-12-28 23:02:29 +01:00
parent 3b7298a330
commit b66340e1dd

View file

@ -126,7 +126,15 @@ exports.create = function(server) {
isSystemEvent: true,
type: 'buddies'
};
client.socket.send(msg);
if (buddies.length) {
client.socket.send(msg);
client.notifiedEmpty = false;
return;
}
if (!client.notifiedEmpty) {
client.notifiedEmpty = true;
client.socket.send(msg);
}
});
});
}