fix: 只转已关注功能失效

This commit is contained in:
shanmite 2021-12-10 14:50:41 +08:00
parent 12847d7cfc
commit dd994263b9

View File

@ -316,8 +316,8 @@ class Monitor extends Searcher {
const const
[m_uid, ori_uid] = uids, [m_uid, ori_uid] = uids,
mIsFollowed = m_uid && (new RegExp(m_uid)).test(attentionList), mIsFollowed = !m_uid || (new RegExp(m_uid)).test(attentionList),
oriIsFollowed = ori_uid && (new RegExp(ori_uid)).test(attentionList), oriIsFollowed = !ori_uid || (new RegExp(ori_uid)).test(attentionList),
/**判断是转发源动态还是现动态 实际发奖人*/ /**判断是转发源动态还是现动态 实际发奖人*/
[real_uid, realIsFollowed] = lottery_info_type === 'uid' [real_uid, realIsFollowed] = lottery_info_type === 'uid'
? [ori_uid, oriIsFollowed] ? [ori_uid, oriIsFollowed]
@ -346,7 +346,9 @@ class Monitor extends Searcher {
} }
/**若勾选只转已关注 */ /**若勾选只转已关注 */
if (only_followed && !mIsFollowed && !oriIsFollowed) { if (only_followed
&& (!mIsFollowed || !oriIsFollowed)
) {
log.info("筛选动态", `只转已关注(https://t.bilibili.com/${dyid})`) log.info("筛选动态", `只转已关注(https://t.bilibili.com/${dyid})`)
return false return false
} }
@ -408,7 +410,7 @@ class Monitor extends Searcher {
} }
/* 是否是转发的动态 */ /* 是否是转发的动态 */
if (isRelayDynamic && real_uid) { if (isRelayDynamic) {
/* 转发内容长度+'//'+'@'+用户名+':'+源内容 */ /* 转发内容长度+'//'+'@'+用户名+':'+源内容 */
const addlength = RandomStr.length + 2 + uname.length + 1 + 1; const addlength = RandomStr.length + 2 + uname.length + 1 + 1;
onelotteryinfo.relay_chat = RandomStr + `//@${uname}:` + des; onelotteryinfo.relay_chat = RandomStr + `//@${uname}:` + des;