mirror of
https://github.com/NodeBB/NodeBB.git
synced 2025-10-26 16:46:12 +01:00
refactor: style, no need to convert length to string
This commit is contained in:
@@ -23,7 +23,7 @@ module.exports = function (Messaging) {
|
|||||||
|
|
||||||
const maximumChatMessageLength = meta.config.maximumChatMessageLength || 1000;
|
const maximumChatMessageLength = meta.config.maximumChatMessageLength || 1000;
|
||||||
content = String(content).trim();
|
content = String(content).trim();
|
||||||
let length = String(content.length).trim();
|
let { length } = content;
|
||||||
({ content, length } = await plugins.hooks.fire('filter:messaging.checkContent', { content, length }));
|
({ content, length } = await plugins.hooks.fire('filter:messaging.checkContent', { content, length }));
|
||||||
if (!content) {
|
if (!content) {
|
||||||
throw new Error('[[error:invalid-chat-message]]');
|
throw new Error('[[error:invalid-chat-message]]');
|
||||||
|
|||||||
@@ -19,7 +19,8 @@ function _handleArgs(middleware, middlewares, controller) {
|
|||||||
middleware.registrationComplete,
|
middleware.registrationComplete,
|
||||||
middleware.authenticateRequest,
|
middleware.authenticateRequest,
|
||||||
middleware.pluginHooks,
|
middleware.pluginHooks,
|
||||||
...middlewares];
|
...middlewares,
|
||||||
|
];
|
||||||
|
|
||||||
return { middlewares, controller };
|
return { middlewares, controller };
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user