restricting posting by anons, redirects to login page and saves post to localstorage

This commit is contained in:
Julian Lam
2013-05-14 17:19:22 -04:00
parent 073b87982b
commit 3eff46bb52
3 changed files with 45 additions and 1 deletions

View File

@@ -146,6 +146,16 @@ marked.setOptions({
Posts.reply = function(socket, tid, uid, content) {
if (uid < 1) {
socket.emit('event:alert', {
title: 'Reply Unsuccessful',
message: 'You don&apos;t seem to be logged in, so you cannot reply.',
type: 'error',
timeout: 2000
});
return;
}
Posts.create(uid, tid, content, function(pid) {
if (pid > 0) {
RDB.rpush('tid:' + tid + ':posts', pid);