mirror of
https://github.com/NodeBB/NodeBB.git
synced 2025-10-27 17:16:14 +01:00
showing guest handles in frontend UI #2569
This commit is contained in:
@@ -14,10 +14,10 @@ module.exports = function(Posts) {
|
||||
Posts.create = function(data, callback) {
|
||||
var uid = data.uid,
|
||||
tid = data.tid,
|
||||
handle = data.uid ? null : data.handle, // Only guests have handles!
|
||||
content = data.content,
|
||||
timestamp = data.timestamp || Date.now();
|
||||
|
||||
|
||||
if (!uid && parseInt(uid, 10) !== 0) {
|
||||
return callback(new Error('[[error:invalid-uid]]'));
|
||||
}
|
||||
@@ -51,6 +51,10 @@ module.exports = function(Posts) {
|
||||
postData.ip = data.ip;
|
||||
}
|
||||
|
||||
if (handle) {
|
||||
postData.handle = handle;
|
||||
}
|
||||
|
||||
plugins.fireHook('filter:post.save', postData, next);
|
||||
},
|
||||
function(postData, next) {
|
||||
|
||||
Reference in New Issue
Block a user