Skip to content

Node.js based forum software built for the modern web

added post.buildFooter and post.parseSignature hooks

Julian Lam77d5ecc82a84
diff --git a/src/postTools.js b/src/postTools.js
index 401847a28b..0da088ddd2 100644
--- a/src/postTools.js
+++ b/src/postTools.js
@@ -225,10 +225,26 @@ var RDB = require('./redis'),
PostTools.parse = function(raw, callback) {
raw = raw || '';
- plugins.fireHook('filter:post.parse', raw, function(err, parsed) {
+ async.waterfall([
+ function(next) {
+ console.log('parsing');
+ plugins.fireHook('filter:post.parse', raw, next);
+ },
+ function(parsed, next) {
+ console.log('footering');
+ plugins.fireHook('filter:post.buildFooter', parsed, next);
+ }
+ ], function(err, parsed) {
+ console.log('doneing');
callback(null, !err ? parsed : raw);
});
}
+ PostTools.parseSignature = function(raw, callback) {
+ raw = raw || '';
+ plugins.fireHook('filter:post.parseSignature', raw, function(err, parsedSignature) {
+ callback(null, !err ? parsedSignature : raw);
+ });
+ }
}(exports));
\ No newline at end of file