|
|
@ -78,19 +78,19 @@ SocketUser.reset = {};
|
|
|
|
|
|
|
|
|
|
|
|
SocketUser.reset.send = function(socket, email, callback) {
|
|
|
|
SocketUser.reset.send = function(socket, email, callback) {
|
|
|
|
if (email) {
|
|
|
|
if (email) {
|
|
|
|
user.reset.send(socket, email, callback);
|
|
|
|
user.reset.send(email, callback);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
};
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
SocketUser.reset.valid = function(socket, code, callback) {
|
|
|
|
SocketUser.reset.valid = function(socket, code, callback) {
|
|
|
|
if (code) {
|
|
|
|
if (code) {
|
|
|
|
user.reset.validate(socket, code, callback);
|
|
|
|
user.reset.validate(code, callback);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
};
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
SocketUser.reset.commit = function(socket, data, callback) {
|
|
|
|
SocketUser.reset.commit = function(socket, data, callback) {
|
|
|
|
if(data && data.code && data.password) {
|
|
|
|
if(data && data.code && data.password) {
|
|
|
|
user.reset.commit(socket, data.code, data.password, callback);
|
|
|
|
user.reset.commit(data.code, data.password, callback);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
};
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
@ -112,12 +112,16 @@ SocketUser.checkStatus = function(socket, uid, callback) {
|
|
|
|
};
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
SocketUser.changePassword = function(socket, data, callback) {
|
|
|
|
SocketUser.changePassword = function(socket, data, callback) {
|
|
|
|
if(data) {
|
|
|
|
if (data && socket.uid) {
|
|
|
|
user.changePassword(socket.uid, data, callback);
|
|
|
|
user.changePassword(socket.uid, data, callback);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
};
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
SocketUser.updateProfile = function(socket, data, callback) {
|
|
|
|
SocketUser.updateProfile = function(socket, data, callback) {
|
|
|
|
|
|
|
|
if (!socket.uid) {
|
|
|
|
|
|
|
|
return callback('[[error:invalid-uid]]');
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
if (!data || !data.uid) {
|
|
|
|
if (!data || !data.uid) {
|
|
|
|
return callback(new Error('[[error:invalid-data]]'));
|
|
|
|
return callback(new Error('[[error:invalid-data]]'));
|
|
|
|
}
|
|
|
|
}
|
|
|
@ -140,6 +144,10 @@ SocketUser.updateProfile = function(socket, data, callback) {
|
|
|
|
};
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
SocketUser.changePicture = function(socket, data, callback) {
|
|
|
|
SocketUser.changePicture = function(socket, data, callback) {
|
|
|
|
|
|
|
|
if (!socket.uid) {
|
|
|
|
|
|
|
|
return callback('[[error:invalid-uid]]');
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
if (!data) {
|
|
|
|
if (!data) {
|
|
|
|
return callback(new Error('[[error:invalid-data]]'));
|
|
|
|
return callback(new Error('[[error:invalid-data]]'));
|
|
|
|
}
|
|
|
|
}
|
|
|
@ -305,10 +313,16 @@ SocketUser.getOnlineAnonCount = function(socket, data, callback) {
|
|
|
|
};
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
SocketUser.getUnreadCount = function(socket, data, callback) {
|
|
|
|
SocketUser.getUnreadCount = function(socket, data, callback) {
|
|
|
|
|
|
|
|
if (!socket.uid) {
|
|
|
|
|
|
|
|
return callback(null, 0);
|
|
|
|
|
|
|
|
}
|
|
|
|
topics.getTotalUnread(socket.uid, callback);
|
|
|
|
topics.getTotalUnread(socket.uid, callback);
|
|
|
|
};
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
SocketUser.getUnreadChatCount = function(socket, data, callback) {
|
|
|
|
SocketUser.getUnreadChatCount = function(socket, data, callback) {
|
|
|
|
|
|
|
|
if (!socket.uid) {
|
|
|
|
|
|
|
|
return callback(null, 0);
|
|
|
|
|
|
|
|
}
|
|
|
|
messaging.getUnreadCount(socket.uid, callback);
|
|
|
|
messaging.getUnreadCount(socket.uid, callback);
|
|
|
|
};
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|