mirror of
https://github.com/NodeBB/NodeBB.git
synced 2026-07-07 17:12:05 +02:00
fixing #1587 properly for profile views
This commit is contained in:
@@ -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);
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user