mirror of
https://github.com/Vendicated/Vencord.git
synced 2025-02-24 07:25:10 +00:00
Fix hiding messages automatically that doesn't contain media
This commit is contained in:
parent
303512ef92
commit
d51b2888e0
1 changed files with 9 additions and 0 deletions
|
@ -64,6 +64,10 @@ const toggleHide = async (channelId: string, messageId: string): Promise<void> =
|
|||
* @returns {boolean}
|
||||
*/
|
||||
const shouldHideByUserIdFilter = (payload: IMessage, userFilters: string[]): boolean => {
|
||||
if (!payload.attachments.length && !payload.embeds.length) {
|
||||
return false;
|
||||
}
|
||||
|
||||
for (const id of userFilters) {
|
||||
if (payload.author.id === id) {
|
||||
return true;
|
||||
|
@ -73,6 +77,11 @@ const shouldHideByUserIdFilter = (payload: IMessage, userFilters: string[]): boo
|
|||
return false;
|
||||
};
|
||||
|
||||
/**
|
||||
* Checks if the embed should be hidden
|
||||
* @param {Embed[]} embeds List of embeds
|
||||
* @param {string[]} domainList List of domains
|
||||
*/
|
||||
const shouldHideEmbed = (embeds: Embed[], domainList: string[]): boolean => {
|
||||
for (const embed of embeds) {
|
||||
if (!embed.url) {
|
||||
|
|
Loading…
Add table
Reference in a new issue