fixing #1587 properly for profile views

v1.18.x
psychobunny 11 years ago
parent 74097be2e4
commit 0334a487b5

@ -36,6 +36,11 @@ define(['forum/account/header'], function(header) {
socket.on('user.isOnline', handleUserOnline);
socket.emit('user.isOnline', theirid, handleUserOnline);
console.log('test', yourid, theirid);
if (yourid !== theirid) {
socket.emit('user.increaseViewCount', theirid);
}
};
function processPage() {

@ -159,10 +159,6 @@ accountsController.getAccount = function(req, res, next) {
userData.profileviews = 1;
}
if (callerUID !== parseInt(userData.uid, 10) && callerUID && !req.query.prefetched) {
user.incrementUserFieldBy(userData.uid, 'profileviews', 1);
}
postTools.parse(userData.signature, function (err, signature) {
userData.signature = signature;

@ -24,6 +24,14 @@ SocketUser.emailExists = function(socket, data, callback) {
}
};
SocketUser.increaseViewCount = function(socket, uid, callback) {
if (uid) {
if (socket.uid !== parseInt(uid, 10)) {
user.incrementUserFieldBy(uid, 'profileviews', 1);
}
}
};
SocketUser.search = function(socket, username, callback) {
user.search(username, callback);
};

Loading…
Cancel
Save