more fixes

This commit is contained in:
Baris Soner Usakli
2014-01-16 17:15:00 -05:00
parent 1ec21c2bfd
commit e5c8caf5ff
3 changed files with 22 additions and 15 deletions

View File

@@ -38,13 +38,19 @@ SocketMeta.buildTitle = function(socket, text, callback) {
SocketMeta.updateHeader = function(socket, data, callback) {
if (socket.uid) {
user.getUserFields(socket.uid, data.fields, function(err, fields) {
if (!err && fields) {
if(err) {
return callback(err);
}
if (fields) {
fields.uid = socket.uid;
callback(fields);
callback(null, fields);
} else {
callback([]);
}
});
} else {
callback({
callback(null, {
uid: 0,
username: "Anonymous User",
email: '',