mirror of
https://github.com/twisterarmy/twister-html.git
synced 2025-01-13 16:37:52 +00:00
fix checks of post.userpost.rt.msg and restyling of properties in willBeHidden()
This commit is contained in:
parent
6eec8088cf
commit
121dc72e6f
@ -353,28 +353,25 @@ function willBeHidden(post) {
|
|||||||
|| typeof post.userpost.rt.msg !== 'string' || post.userpost.rt.msg === ''))
|
|| typeof post.userpost.rt.msg !== 'string' || post.userpost.rt.msg === ''))
|
||||||
return true;
|
return true;
|
||||||
|
|
||||||
if (post['userpost']['n'] === defaultScreenName)
|
if (post.userpost.n === defaultScreenName)
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
// currently we don't need to filter promoted posts anyhow
|
// currently we don't need to filter promoted posts anyhow
|
||||||
if (typeof(post['userpost']['lastk']) === 'undefined' )
|
if (typeof post.userpost.lastk === 'undefined')
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
if (typeof(post['userpost']['rt']) !== 'undefined') {
|
if (post.userpost.rt && typeof post.userpost.rt.msg === 'string' && post.userpost.rt.msg !== '') {
|
||||||
// hope it is not too egocentric to overcome hideCloseRtsHour this way
|
// hope it is not too egocentric to overcome hideCloseRtsHour this way
|
||||||
if (post['userpost']['rt']['n'] === defaultScreenName)
|
if (post.userpost.rt.n === defaultScreenName)
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
if ($.Options.hideCloseRTs.val !== 'disable' &&
|
if ($.Options.hideCloseRTs.val !== 'disable' && followingUsers.indexOf(post.userpost.rt.n) > -1
|
||||||
followingUsers.indexOf(post['userpost']['rt']['n']) > -1 &&
|
&& parseInt(post.userpost.time) - parseInt(post.userpost.rt.time) < $.Options.hideCloseRtsHour.val * 3600)
|
||||||
parseInt(post['userpost']['time']) - parseInt(post['userpost']['rt']['time']) < $.Options.hideCloseRtsHour.val * 3600)
|
|
||||||
{
|
|
||||||
return true;
|
return true;
|
||||||
}
|
|
||||||
|
|
||||||
var msg = post['userpost']['rt']['msg'];
|
var msg = post.userpost.rt.msg;
|
||||||
} else {
|
} else {
|
||||||
var msg = post['userpost']['msg'];
|
var msg = post.userpost.msg;
|
||||||
|
|
||||||
if ($.Options.hideReplies.val !== 'disable' && /^\@/.test(msg) &&
|
if ($.Options.hideReplies.val !== 'disable' && /^\@/.test(msg) &&
|
||||||
!(new RegExp('@' + defaultScreenName + '( |,|;|\\.|:|\\/|\\?|\\!|\\\\|\'|"|\\n|\\t|$)').test(msg)))
|
!(new RegExp('@' + defaultScreenName + '( |,|;|\\.|:|\\/|\\?|\\!|\\\\|\'|"|\\n|\\t|$)').test(msg)))
|
||||||
@ -389,8 +386,8 @@ function willBeHidden(post) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
if ($.Options.filterLang.val !== 'disable' && $.Options.filterLangForPostboard.val) {
|
if ($.Options.filterLang.val !== 'disable' && $.Options.filterLangForPostboard.val) {
|
||||||
post['langFilter'] = filterLang(msg);
|
post.langFilter = filterLang(msg);
|
||||||
if (!post['langFilter']['pass'] && !$.Options.filterLangSimulate.val) {
|
if (!post.langFilter.pass && !$.Options.filterLangSimulate.val) {
|
||||||
// TODO maybe we need a counter of posts blocked by language filter and even caching of them and button to show?
|
// TODO maybe we need a counter of posts blocked by language filter and even caching of them and button to show?
|
||||||
//console.log('post by @'+post['userpost']['n']+' was hidden because it didn\'t passed by language filter:');
|
//console.log('post by @'+post['userpost']['n']+' was hidden because it didn\'t passed by language filter:');
|
||||||
return true;
|
return true;
|
||||||
|
Loading…
Reference in New Issue
Block a user