Skip to content

Commit

Permalink
NoUnblockToJump: Also allow jump for ignored users (#3110)
Browse files Browse the repository at this point in the history
  • Loading branch information
sadan4 authored Dec 30, 2024
1 parent 0e813e7 commit 0fd76ab
Show file tree
Hide file tree
Showing 2 changed files with 38 additions and 12 deletions.
5 changes: 5 additions & 0 deletions src/plugins/noUnblockToJump/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
# No Unblock To Jump

Removes the popup preventing you to jump to a message from a blocked/ignored user (eg: in search results)

![A modal popup telling you to unblock a user to jump their message](https://github.com/user-attachments/assets/0e4b859d-f3b3-4101-9a83-829afb473d1e)
45 changes: 33 additions & 12 deletions src/plugins/noUnblockToJump/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -26,25 +26,46 @@ export default definePlugin({
authors: [Devs.dzshn],
patches: [
{
// Clicking on search results to jump
find: '.id,"Search Results"',
replacement: {
match: /if\(.{1,10}\)(.{1,10}\.show\({.{1,50}#{intl::UNBLOCK_TO_JUMP_TITLE})/,
replace: "if(false)$1"
}
replacement: [
{
match: /if\(.{1,10}\)(.{1,10}\.show\({.{1,50}#{intl::UNBLOCK_TO_JUMP_TITLE})/,
replace: "if(false)$1"
},
{
match: /if\(.{1,10}\)(.{1,10}\.show\({.{1,50}#{intl::UNIGNORE_TO_JUMP_TITLE})/,
replace: "if(false)$1"
},
]
},
{
// Jump buttton in top right corner of messages
find: "renderJumpButton()",
replacement: {
match: /if\(.{1,10}\)(.{1,10}\.show\({.{1,50}#{intl::UNBLOCK_TO_JUMP_TITLE})/,
replace: "if(false)$1"
}
replacement: [
{
match: /if\(.{1,10}\)(.{1,10}\.show\({.{1,50}#{intl::UNBLOCK_TO_JUMP_TITLE})/,
replace: "if(false)$1"
},
{
match: /if\(.{1,10}\)(.{1,10}\.show\({.{1,50}#{intl::UNIGNORE_TO_JUMP_TITLE})/,
replace: "if(false)$1"
},
]
},
{
// Clicking on replied messages to jump
find: "flash:!0,returnMessageId",
replacement: {
match: /.\?(.{1,10}\.show\({.{1,50}#{intl::UNBLOCK_TO_JUMP_TITLE})/,
replace: "false?$1"
}
replacement: [
{
match: /.\?(.{1,10}\.show\({.{1,50}#{intl::UNBLOCK_TO_JUMP_TITLE})/,
replace: "false?$1"
},
{
match: /.\?(.{1,10}\.show\({.{1,50}#{intl::UNIGNORE_TO_JUMP_TITLE})/,
replace: "false?$1"
},
]
}
]
});

0 comments on commit 0fd76ab

Please sign in to comment.