mirror of
				https://github.com/NodeBB/NodeBB.git
				synced 2025-10-31 11:05:54 +01:00 
			
		
		
		
	call posts.relativeToAbsolute when needed
This commit is contained in:
		| @@ -31,7 +31,6 @@ module.exports = function(Posts) { | ||||
| 			} | ||||
|  | ||||
| 			data.postData.content = translator.escape(data.postData.content); | ||||
| 			data.postData.content = Posts.relativeToAbsolute(data.postData.content); | ||||
|  | ||||
| 			if (global.env === 'production' && data.postData.pid) { | ||||
| 				cache.set(data.postData.pid, data.postData.content); | ||||
|   | ||||
| @@ -8,6 +8,7 @@ var winston = require('winston'); | ||||
|  | ||||
| var db = require('../database'); | ||||
| var user = require('../user'); | ||||
| var posts = require('../posts'); | ||||
| var notifications = require('../notifications'); | ||||
| var privileges = require('../privileges'); | ||||
| var meta = require('../meta'); | ||||
| @@ -194,6 +195,8 @@ module.exports = function(Topics) { | ||||
| 					titleEscaped = title.replace(/%/g, '%').replace(/,/g, ','); | ||||
| 				} | ||||
|  | ||||
| 				postData.content = posts.relativeToAbsolute(postData.content); | ||||
|  | ||||
| 				notifications.create({ | ||||
| 					bodyShort: '[[notifications:user_posted_to, ' + postData.user.username + ', ' + titleEscaped + ']]', | ||||
| 					bodyLong: postData.content, | ||||
| @@ -223,6 +226,7 @@ module.exports = function(Topics) { | ||||
| 						if (err) { | ||||
| 							return next(err); | ||||
| 						} | ||||
|  | ||||
| 						if (data.userSettings.sendPostNotifications) { | ||||
| 							emailer.send('notif_post', toUid, { | ||||
| 								pid: postData.pid, | ||||
|   | ||||
		Reference in New Issue
	
	Block a user