mirror of
https://github.com/Equicord/Equicord.git
synced 2025-03-04 00:10:05 -05:00
Merge remote-tracking branch 'upstream/dev' into dev
This commit is contained in:
commit
f3923ec6ed
2 changed files with 12 additions and 2 deletions
|
@ -26,6 +26,12 @@ import { Message } from "discord-types/general";
|
||||||
|
|
||||||
const RelationshipStore = findByPropsLazy("getRelationships", "isBlocked");
|
const RelationshipStore = findByPropsLazy("getRelationships", "isBlocked");
|
||||||
|
|
||||||
|
interface MessageDeleteProps {
|
||||||
|
collapsedReason: {
|
||||||
|
message: string;
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
export default definePlugin({
|
export default definePlugin({
|
||||||
name: "NoBlockedMessages",
|
name: "NoBlockedMessages",
|
||||||
description: "Hides all blocked messages from chat completely.",
|
description: "Hides all blocked messages from chat completely.",
|
||||||
|
@ -36,7 +42,7 @@ export default definePlugin({
|
||||||
replacement: [
|
replacement: [
|
||||||
{
|
{
|
||||||
match: /let\{[^}]*collapsedReason[^}]*\}/,
|
match: /let\{[^}]*collapsedReason[^}]*\}/,
|
||||||
replace: "return null;$&"
|
replace: "if($self.shouldHide(arguments[0]))return null;$&"
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
|
@ -93,5 +99,9 @@ export default definePlugin({
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
new Logger("NoBlockedMessages").error("Failed to check if user is blocked:", e);
|
new Logger("NoBlockedMessages").error("Failed to check if user is blocked:", e);
|
||||||
}
|
}
|
||||||
|
},
|
||||||
|
|
||||||
|
shouldHide(props: MessageDeleteProps) {
|
||||||
|
return !props?.collapsedReason?.message.includes("deleted");
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
|
@ -172,7 +172,7 @@ export default definePlugin({
|
||||||
{
|
{
|
||||||
find: ".VIEW_ALL_ROLES,",
|
find: ".VIEW_ALL_ROLES,",
|
||||||
replacement: {
|
replacement: {
|
||||||
match: /\.collapseButton,.+?}\)}\),/,
|
match: /\.expandButton,.+?null,/,
|
||||||
replace: "$&$self.ViewPermissionsButton(arguments[0]),"
|
replace: "$&$self.ViewPermissionsButton(arguments[0]),"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Reference in a new issue