mirror of
https://github.com/NodeBB/NodeBB.git
synced 2026-02-02 20:59:56 +01:00
restricting posting by anons, redirects to login page and saves post to localstorage
This commit is contained in:
10
src/posts.js
10
src/posts.js
@@ -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'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);
|
||||
|
||||
Reference in New Issue
Block a user