diff options
author | fawn <fawn@envs.net> | 2023-03-19 08:13:17 +0000 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-03-19 05:13:17 -0300 |
commit | 17c3496542adc9ddfe46e3bc73c0fe7776c30f78 (patch) | |
tree | 888c20ae5837a2d9ec17140f8a4af6737a14e0fc /src/plugins | |
parent | 0fb79b763d797d70d2eb6d847b0bf711c9927337 (diff) | |
download | Vencord-17c3496542adc9ddfe46e3bc73c0fe7776c30f78.tar.gz Vencord-17c3496542adc9ddfe46e3bc73c0fe7776c30f78.tar.bz2 Vencord-17c3496542adc9ddfe46e3bc73c0fe7776c30f78.zip |
feat(typingIndicator): Option to not show indicator for blocked users (#513)
Diffstat (limited to 'src/plugins')
-rw-r--r-- | src/plugins/typingIndicator.tsx | 13 |
1 files changed, 9 insertions, 4 deletions
diff --git a/src/plugins/typingIndicator.tsx b/src/plugins/typingIndicator.tsx index 9af09bc..4b0d162 100644 --- a/src/plugins/typingIndicator.tsx +++ b/src/plugins/typingIndicator.tsx @@ -22,7 +22,7 @@ import { Devs } from "@utils/constants"; import { LazyComponent } from "@utils/misc"; import definePlugin, { OptionType } from "@utils/types"; import { find, findLazy, findStoreLazy } from "@webpack"; -import { ChannelStore, GuildMemberStore, Tooltip, UserStore, useStateFromStores } from "@webpack/common"; +import { ChannelStore, GuildMemberStore, RelationshipStore, Tooltip, UserStore, useStateFromStores } from "@webpack/common"; import { buildSeveralUsers } from "./typingTweaks"; @@ -57,9 +57,9 @@ function TypingIndicator({ channelId }: { channelId: string; }) { if (isChannelMuted) return null; } - delete typingUsers[UserStore.getCurrentUser().id]; + const myId = UserStore.getCurrentUser().id; - const typingUsersArray = Object.keys(typingUsers); + const typingUsersArray = Object.keys(typingUsers).filter(id => id !== myId && !(RelationshipStore.isBlocked(id) && !settings.store.includeBlockedUsers)); let tooltipText: string; switch (typingUsersArray.length) { @@ -108,13 +108,18 @@ const settings = definePluginSettings({ type: OptionType.BOOLEAN, description: "Whether to show the typing indicator for muted channels.", default: false + }, + includeBlockedUsers: { + type: OptionType.BOOLEAN, + description: "Whether to show the typing indicator for blocked users.", + default: false } }); export default definePlugin({ name: "TypingIndicator", description: "Adds an indicator if someone is typing on a channel.", - authors: [Devs.Nuckyz], + authors: [Devs.Nuckyz, Devs.obscurity], settings, patches: [ |