fixing bug where an anonymous user could follow a topic... yikes

This commit is contained in:
Julian Lam
2013-06-10 16:00:08 -04:00
parent a01a5bbd64
commit 2914496799
2 changed files with 20 additions and 4 deletions

View File

@@ -189,7 +189,16 @@
set_follow_state(state, true);
});
socket.on('api:topic.follow', function(data) {
set_follow_state(data.follow);
if (data.status && data.status === 'ok') set_follow_state(data.follow);
else {
app.alert({
type: 'error',
alert_id: 'topic_follow',
title: 'Please Log In',
message: 'Please register or log in in order to subscribe to this topic',
timeout: 5000
});
}
});
socket.emit('api:topic.followCheck', tid);
followEl[0].addEventListener('click', function() {