Skip to content

Commit

Permalink
chatTweaks: finish the blocked features
Browse files Browse the repository at this point in the history
  • Loading branch information
Cynosphere committed Jan 6, 2025
1 parent 181766d commit 66a28d2
Showing 1 changed file with 20 additions and 0 deletions.
20 changes: 20 additions & 0 deletions src/chatTweaks/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -50,5 +50,25 @@ export const patches: Patch[] = [
`${orig}(arguments[0].user?.bot&&arguments[0].message?.webhookId&&arguments[0].user?.isNonUserBot?.()&&(${type}=99)),`
},
prerequisite: webhookTag
},

// jump to blocked/ignored
{
find: '("interactionAvatarProfile",',
replace: {
match: /&&\(.\?.\.Z.show\({.+?:(.)\.Z.jumpToMessage/,
replacement: (_, mod) => `&&(${mod}.Z.jumpToMessage`
},
prerequisite: () => moonlight.getConfigOption<boolean>("chatTweaks", "jumpToBlocked") ?? true
},

// hide blocked/ignored
{
find: 'key:"pending-upload-".concat(',
replace: {
match: /if\((.)\.type===(.\..{1,3})\.MESSAGE_GROUP_BLOCKED\|\|/,
replacement: (orig, message, types) =>
`if(${message}.type===${types}.MESSAGE_GROUP_BLOCKED&&(moonlight.getConfigOption("chatTweaks","hideBlocked")??false))return;if(${message}.type===${types}.MESSAGE_GROUP_IGNORED&&(moonlight.getConfigOption("chatTweaks","hideIgnored")??false))return;${orig}`
}
}
];

0 comments on commit 66a28d2

Please sign in to comment.