mirror of
				https://github.com/NodeBB/NodeBB.git
				synced 2025-10-30 10:35:55 +01:00 
			
		
		
		
	closes #4877
This commit is contained in:
		| @@ -49,8 +49,8 @@ module.exports = function(SocketPosts) { | |||||||
| 					type: 'topic-rename', | 					type: 'topic-rename', | ||||||
| 					uid: socket.uid, | 					uid: socket.uid, | ||||||
| 					ip: socket.ip, | 					ip: socket.ip, | ||||||
| 					oldTitle: result.topic.oldTitle, | 					oldTitle: validator.escape(String(result.topic.oldTitle)), | ||||||
| 					newTitle: result.topic.title | 					newTitle: validator.escape(String(result.topic.title)) | ||||||
| 				}); | 				}); | ||||||
| 			} | 			} | ||||||
|  |  | ||||||
|   | |||||||
| @@ -1,8 +1,11 @@ | |||||||
| 'use strict'; | 'use strict'; | ||||||
|  |  | ||||||
| var async = require('async'); | var async = require('async'); | ||||||
|  | var winston = require('winston'); | ||||||
|  | var validator = require('validator'); | ||||||
|  |  | ||||||
| var posts = require('../../posts'); | var posts = require('../../posts'); | ||||||
|  | var topics = require('../../topics'); | ||||||
| var events = require('../../events'); | var events = require('../../events'); | ||||||
| var websockets = require('../index'); | var websockets = require('../index'); | ||||||
| var socketTopics = require('../topics'); | var socketTopics = require('../topics'); | ||||||
| @@ -106,11 +109,17 @@ module.exports = function(SocketPosts) { | |||||||
|  |  | ||||||
| 				websockets.in('topic_' + data.tid).emit('event:post_purged', data.pid); | 				websockets.in('topic_' + data.tid).emit('event:post_purged', data.pid); | ||||||
|  |  | ||||||
|  | 				topics.getTopicField(data.tid, 'title', function(err, title) { | ||||||
|  | 					if (err) { | ||||||
|  | 						return winston.error(err); | ||||||
|  | 					} | ||||||
| 					events.log({ | 					events.log({ | ||||||
| 						type: 'post-purge', | 						type: 'post-purge', | ||||||
| 						uid: socket.uid, | 						uid: socket.uid, | ||||||
| 						pid: data.pid, | 						pid: data.pid, | ||||||
| 					ip: socket.ip | 						ip: socket.ip, | ||||||
|  | 						title: validator.escape(String(title)) | ||||||
|  | 					}); | ||||||
| 				}); | 				}); | ||||||
|  |  | ||||||
| 				callback(); | 				callback(); | ||||||
|   | |||||||
| @@ -1,6 +1,9 @@ | |||||||
| 'use strict'; | 'use strict'; | ||||||
|  |  | ||||||
| var async = require('async'); | var async = require('async'); | ||||||
|  | var winston = require('winston'); | ||||||
|  | var validator = require('validator'); | ||||||
|  |  | ||||||
| var topics = require('../../topics'); | var topics = require('../../topics'); | ||||||
| var events = require('../../events'); | var events = require('../../events'); | ||||||
| var privileges = require('../../privileges'); | var privileges = require('../../privileges'); | ||||||
| @@ -94,11 +97,17 @@ module.exports = function(SocketTopics) { | |||||||
| 				socketHelpers.emitToTopicAndCategory(event, data); | 				socketHelpers.emitToTopicAndCategory(event, data); | ||||||
|  |  | ||||||
| 				if (action === 'delete' || action === 'restore' || action === 'purge') { | 				if (action === 'delete' || action === 'restore' || action === 'purge') { | ||||||
|  | 					topics.getTopicField(tid, 'title', function(err, title) { | ||||||
|  | 						if (err) { | ||||||
|  | 							return winston.error(err); | ||||||
|  | 						} | ||||||
| 						events.log({ | 						events.log({ | ||||||
| 							type: 'topic-' + action, | 							type: 'topic-' + action, | ||||||
| 							uid: socket.uid, | 							uid: socket.uid, | ||||||
| 							ip: socket.ip, | 							ip: socket.ip, | ||||||
| 						tid: tid | 							tid: tid, | ||||||
|  | 							title: validator.escape(String(title)) | ||||||
|  | 						}); | ||||||
| 					}); | 					}); | ||||||
| 				} | 				} | ||||||
|  |  | ||||||
|   | |||||||
		Reference in New Issue
	
	Block a user