Skip to content

Node.js based forum software built for the modern web

new hook action:topic.reply

Barış Soner Uşaklı8234e4cc0758
diff --git a/src/topics/create.js b/src/topics/create.js
index 1e9336fedc..36a73948d7 100644
--- a/src/topics/create.js
+++ b/src/topics/create.js
@@ -166,6 +166,7 @@ module.exports = function(Topics) {
data.topicData = data.topicData[0];
data.topicData.unreplied = 1;
+ data.topicData.mainPost = data.postData;
plugins.fireHook('action:topic.post', data.topicData);
@@ -280,6 +281,10 @@ module.exports = function(Topics) {
Topics.notifyFollowers(postData, uid);
}
+ if (postData.index > 0) {
+ plugins.fireHook('action:topic.reply', postData);
+ }
+
postData.topic.title = validator.escape(postData.topic.title);
next(null, postData);
}