mirror of
				https://github.com/NodeBB/NodeBB.git
				synced 2025-10-31 11:05:54 +01:00 
			
		
		
		
	feat: #11897, show guest handles in post queue and after using POST /compose
This commit is contained in:
		| @@ -46,6 +46,7 @@ exports.post = async function (req, res) { | |||||||
| 		req: req, | 		req: req, | ||||||
| 		timestamp: Date.now(), | 		timestamp: Date.now(), | ||||||
| 		content: body.content, | 		content: body.content, | ||||||
|  | 		handle: body.handle, | ||||||
| 		fromQueue: false, | 		fromQueue: false, | ||||||
| 	}; | 	}; | ||||||
| 	req.body.noscript = 'true'; | 	req.body.noscript = 'true'; | ||||||
|   | |||||||
| @@ -38,6 +38,11 @@ module.exports = function (Posts) { | |||||||
| 			postData.forEach((postData, index) => { | 			postData.forEach((postData, index) => { | ||||||
| 				if (postData) { | 				if (postData) { | ||||||
| 					postData.user = userData[index]; | 					postData.user = userData[index]; | ||||||
|  | 					if (postData.user.uid === 0 && postData.data.handle) { | ||||||
|  | 						postData.user.username = validator.escape(String(postData.data.handle)); | ||||||
|  | 						postData.user.displayname = postData.user.username; | ||||||
|  | 						postData.user.fullname = postData.user.username; | ||||||
|  | 					} | ||||||
| 					postData.data.rawContent = validator.escape(String(postData.data.content)); | 					postData.data.rawContent = validator.escape(String(postData.data.content)); | ||||||
| 					postData.data.title = validator.escape(String(postData.data.title || '')); | 					postData.data.title = validator.escape(String(postData.data.title || '')); | ||||||
| 				} | 				} | ||||||
|   | |||||||
		Reference in New Issue
	
	Block a user