diff --git a/lib/utils/filter.js b/lib/utils/filter.js index 8157ef7..a538614 100644 --- a/lib/utils/filter.js +++ b/lib/utils/filter.js @@ -8,13 +8,13 @@ let cachedFilters = {}; /** * 检测用户是否被封禁 */ -let checkUserIsBlocked = _.curry((room, blockUsers, hash) => { +let checkUserIsBlocked = _.curry((blockUsers, hash) => { return (blockUsers.indexOf(hash)) > -1; }); /** * 检测文字是否和谐 */ -let validateText = _.curry((room, ignoreRegEx, checkRegEx, str) => { +let validateText = _.curry((ignoreRegEx, checkRegEx, str) => { checkRegEx.lastIndex = 0; let testStr = str.replace(ignoreRegEx, ""); return !checkRegEx.test(testStr); @@ -22,7 +22,7 @@ let validateText = _.curry((room, ignoreRegEx, checkRegEx, str) => { /** * 替换关键字 */ -let replaceKeyword = _.curry((room, regex, str) => { +let replaceKeyword = _.curry((regex, str) => { return str.replace(regex, "***"); }); @@ -37,9 +37,9 @@ function initialize(roomName, forceUpdate) { throw "Init RegExp Error"; } let ret = { - checkUserIsBlocked: checkUserIsBlocked(roomName)(room.blockusers), - validateText: validateText(roomName)(room.keyword.ignore)(room.keyword.block), - replaceKeyword: replaceKeyword(roomName)(room.keyword.replacement), + checkUserIsBlocked: checkUserIsBlocked(room.blockusers), + validateText: validateText(room.keyword.ignore)(room.keyword.block), + replaceKeyword: replaceKeyword(room.keyword.replacement), }; cachedFilters[roomName] = null; // Release Memory cachedFilters[roomName] = ret; diff --git a/package.json b/package.json index d0103b2..edf2486 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "danmu-server", - "version": "1.0.6-pre", + "version": "1.0.6", "license": "MIT", "scripts": { "start": "node app.js",