From a9c8f71ab080e39a33389954770f63f0ef23308d Mon Sep 17 00:00:00 2001 From: Simon Grim Date: Fri, 25 Mar 2016 21:31:25 +0500 Subject: [PATCH] fix wrong checks of twist data userpost.msg property that leads to applying of language filtering by userpost.rt.msg --- js/twister_actions.js | 2 +- js/twister_timeline.js | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/js/twister_actions.js b/js/twister_actions.js index 60d9638..83ec131 100644 --- a/js/twister_actions.js +++ b/js/twister_actions.js @@ -445,7 +445,7 @@ function processQuery(req) { continue; if ($.Options.filterLang.val !== 'disable' && $.Options.filterLangForSearching.val) { - if (userpost.msg !== '') + if (typeof userpost.msg === 'string' && userpost.msg !== '') langFilterData = filterLang(userpost.msg); else langFilterData = filterLang(userpost.rt.msg); diff --git a/js/twister_timeline.js b/js/twister_timeline.js index 4f37ddc..09c4010 100644 --- a/js/twister_timeline.js +++ b/js/twister_timeline.js @@ -360,7 +360,7 @@ function willBeHidden(post) { if (typeof post.userpost.lastk === 'undefined') return false; - if (post.userpost.rt && typeof post.userpost.rt.msg === 'string' && post.userpost.rt.msg !== '') { + if (typeof post.userpost.msg !== 'string' || post.userpost.msg === '') { // hope it is not too egocentric to overcome hideCloseRtsHour this way if (post.userpost.rt.n === defaultScreenName) return false;