mirror of
https://github.com/KevinMidboe/zoff.git
synced 2025-10-29 18:00:23 +00:00
Improved how naming works on join
- XXXX changed name to YYYY doesn't happen if the user already is signed in - Signs automatically in on frontpage join
This commit is contained in:
@@ -754,7 +754,7 @@ function getNextSong(coll, socket, callback) {
|
||||
function left_channel(coll, guid, short_id, in_list, socket, change) {
|
||||
if(!coll) {
|
||||
if(!change) {
|
||||
Functions.remove_name_from_db(guid, name);
|
||||
Functions.remove_name_from_db(guid);
|
||||
}
|
||||
return;
|
||||
}
|
||||
@@ -772,7 +772,7 @@ function left_channel(coll, guid, short_id, in_list, socket, change) {
|
||||
io.to(coll).emit("viewers", new_doc[0].users.length);
|
||||
socket.leave(coll);
|
||||
if(!change) {
|
||||
Functions.remove_name_from_db(guid, name);
|
||||
Functions.remove_name_from_db(guid);
|
||||
}
|
||||
});
|
||||
});
|
||||
@@ -782,7 +782,7 @@ function left_channel(coll, guid, short_id, in_list, socket, change) {
|
||||
//if(updated.nModified > 0) {
|
||||
db.collection("connected_users").update({"_id": "total_users"}, {$pull: {total_users: guid + coll}}, function(err, updated){});
|
||||
if(!change) {
|
||||
Functions.remove_name_from_db(guid, name);
|
||||
Functions.remove_name_from_db(guid);
|
||||
}
|
||||
//}
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user