@ -23,7 +23,7 @@ module.exports = function (Messaging) {
const maximumChatMessageLength = meta.config.maximumChatMessageLength || 1000;
content = String(content).trim();
let length = String(content.length).trim();
let { length } = content;
({ content, length } = await plugins.hooks.fire('filter:messaging.checkContent', { content, length }));
if (!content) {
throw new Error('[[error:invalid-chat-message]]');
@ -19,7 +19,8 @@ function _handleArgs(middleware, middlewares, controller) {
middleware.registrationComplete,
middleware.authenticateRequest,
middleware.pluginHooks,
...middlewares];
...middlewares,
];
return { middlewares, controller };
}