send less data when leaving rooms

This commit is contained in:
barisusakli
2015-10-20 17:53:44 -04:00
parent 36e89ae15a
commit d146bff2a1
3 changed files with 34 additions and 17 deletions

View File

@@ -143,14 +143,25 @@ app.cacheBuster = null;
status: app.user.status
}, function(err) {
if (err) {
app.alertError(err.message);
return;
return app.alertError(err.message);
}
app.currentRoom = room;
});
}
};
app.leaveCurrentRoom = function() {
if (!socket) {
return;
}
socket.emit('meta.rooms.leaveCurrent', function(err) {
if (err) {
return app.alertError(err.message);
}
app.currentRoom = '';
});
}
function highlightNavigationLink() {
var path = window.location.pathname;
$('#main-nav li').removeClass('active');