From ae01e88e1340027a848cbcf2d230f3395e94011c Mon Sep 17 00:00:00 2001 From: byron <47872200+byeoon@users.noreply.github.com> Date: Mon, 8 Apr 2024 20:33:18 -0400 Subject: [PATCH 1/3] EmoteCloner: fix low quality; don't count managed emojis (#2321) Co-authored-by: Nam Anh Co-authored-by: ryan-0324 <77452312+ryan-0324@users.noreply.github.com> Co-authored-by: V --- src/plugins/emoteCloner/index.tsx | 7 ++++--- src/utils/constants.ts | 4 ++++ 2 files changed, 8 insertions(+), 3 deletions(-) diff --git a/src/plugins/emoteCloner/index.tsx b/src/plugins/emoteCloner/index.tsx index 4c0fe94ad..cd9890a80 100644 --- a/src/plugins/emoteCloner/index.tsx +++ b/src/plugins/emoteCloner/index.tsx @@ -54,9 +54,9 @@ const StickerExt = [, "png", "png", "json", "gif"] as const; function getUrl(data: Data) { if (data.t === "Emoji") - return `${location.protocol}//${window.GLOBAL_ENV.CDN_HOST}/emojis/${data.id}.${data.isAnimated ? "gif" : "png"}`; + return `${location.protocol}//${window.GLOBAL_ENV.CDN_HOST}/emojis/${data.id}.${data.isAnimated ? "gif" : "png"}?size=4096&lossless=true`; - return `${window.GLOBAL_ENV.MEDIA_PROXY_ENDPOINT}/stickers/${data.id}.${StickerExt[data.format_type]}`; + return `${window.GLOBAL_ENV.MEDIA_PROXY_ENDPOINT}/stickers/${data.id}.${StickerExt[data.format_type]}?size=4096&lossless=true`; } async function fetchSticker(id: string) { @@ -130,7 +130,8 @@ function getGuildCandidates(data: Data) { let count = 0; for (const emoji of emojis) - if (emoji.animated === isAnimated) count++; + if (emoji.animated === isAnimated && !emoji.managed) + count++; return count < emojiSlots; }).sort((a, b) => a.name.localeCompare(b.name)); } diff --git a/src/utils/constants.ts b/src/utils/constants.ts index 53f9934b1..3bad423d5 100644 --- a/src/utils/constants.ts +++ b/src/utils/constants.ts @@ -425,6 +425,10 @@ export const Devs = /* #__PURE__*/ Object.freeze({ newwares: { name: "newwares", id: 421405303951851520n + }, + Byron: { + name: "byeoon", + id: 1167275288036655133n } } satisfies Record); From 26f3618c2cb60d26b3d7cd1734f39d36186fcee7 Mon Sep 17 00:00:00 2001 From: Sqaaakoi Date: Tue, 9 Apr 2024 12:41:48 +1200 Subject: [PATCH 2/3] TypingIndicator: Add an option to show user avatars (#2319) Co-authored-by: Vendicated --- src/plugins/typingIndicator/index.tsx | 44 ++++++++++++++++++++++----- src/plugins/typingIndicator/style.css | 18 +++++++++++ src/utils/constants.ts | 4 +++ 3 files changed, 59 insertions(+), 7 deletions(-) create mode 100644 src/plugins/typingIndicator/style.css diff --git a/src/plugins/typingIndicator/index.tsx b/src/plugins/typingIndicator/index.tsx index 8bae2f53c..6df3f4b80 100644 --- a/src/plugins/typingIndicator/index.tsx +++ b/src/plugins/typingIndicator/index.tsx @@ -16,20 +16,28 @@ * along with this program. If not, see . */ +import "./style.css"; + import { definePluginSettings, Settings } from "@api/Settings"; import ErrorBoundary from "@components/ErrorBoundary"; import { Devs } from "@utils/constants"; import definePlugin, { OptionType } from "@utils/types"; -import { findExportedComponentLazy, findStoreLazy } from "@webpack"; +import { findComponentByCodeLazy, findExportedComponentLazy, findStoreLazy } from "@webpack"; import { ChannelStore, GuildMemberStore, i18n, RelationshipStore, SelectedChannelStore, Tooltip, UserStore, useStateFromStores } from "@webpack/common"; import { buildSeveralUsers } from "../typingTweaks"; const ThreeDots = findExportedComponentLazy("Dots", "AnimatedDots"); +const UserSummaryItem = findComponentByCodeLazy("defaultRenderUser", "showDefaultAvatarsForNullUsers"); const TypingStore = findStoreLazy("TypingStore"); const UserGuildSettingsStore = findStoreLazy("UserGuildSettingsStore"); +const enum IndicatorMode { + Dots = 1 << 0, + Avatars = 1 << 1 +} + function getDisplayName(guildId: string, userId: string) { const user = UserStore.getUser(userId); return GuildMemberStore.getNick(guildId, userId) ?? (user as any).globalName ?? user.username; @@ -90,11 +98,24 @@ function TypingIndicator({ channelId }: { channelId: string; }) { return ( {props => ( -
- +
+ {((settings.store.indicatorMode & IndicatorMode.Avatars) === IndicatorMode.Avatars) && ( + UserStore.getUser(id))} + guildId={guildId} + renderIcon={false} + max={3} + showDefaultAvatarsForNullUsers + showUserPopout + size={16} + className="vc-typing-indicator-avatars" + /> + )} + {((settings.store.indicatorMode & IndicatorMode.Dots) === IndicatorMode.Dots) && ( +
+ +
+ )}
)} @@ -119,13 +140,22 @@ const settings = definePluginSettings({ type: OptionType.BOOLEAN, description: "Whether to show the typing indicator for blocked users.", default: false + }, + indicatorMode: { + type: OptionType.SELECT, + description: "How should the indicator be displayed?", + options: [ + { label: "Avatars and animated dots", value: IndicatorMode.Dots | IndicatorMode.Avatars, default: true }, + { label: "Animated dots", value: IndicatorMode.Dots }, + { label: "Avatars", value: IndicatorMode.Avatars }, + ], } }); export default definePlugin({ name: "TypingIndicator", description: "Adds an indicator if someone is typing on a channel.", - authors: [Devs.Nuckyz, Devs.fawn], + authors: [Devs.Nuckyz, Devs.fawn, Devs.Sqaaakoi], settings, patches: [ diff --git a/src/plugins/typingIndicator/style.css b/src/plugins/typingIndicator/style.css new file mode 100644 index 000000000..d92ef0f1e --- /dev/null +++ b/src/plugins/typingIndicator/style.css @@ -0,0 +1,18 @@ +.vc-typing-indicator { + display: flex; + align-items: center; + height: 20px; +} + +.vc-typing-indicator-avatars { + margin-left: 6px; +} + +.vc-typing-indicator-dots { + margin-left: 6px; + height: 16px; + display: flex; + align-items: center; + z-index: 0; + cursor: pointer; +} diff --git a/src/utils/constants.ts b/src/utils/constants.ts index 3bad423d5..04a4f6778 100644 --- a/src/utils/constants.ts +++ b/src/utils/constants.ts @@ -426,6 +426,10 @@ export const Devs = /* #__PURE__*/ Object.freeze({ name: "newwares", id: 421405303951851520n }, + Sqaaakoi: { + name: "Sqaaakoi", + id: 259558259491340288n + }, Byron: { name: "byeoon", id: 1167275288036655133n From 38ffdd7d9457858c6a79a5705f4c7746047f7561 Mon Sep 17 00:00:00 2001 From: Vendicated Date: Tue, 9 Apr 2024 02:52:21 +0200 Subject: [PATCH 3/3] FriendsSince: Add icon to be consistent with "member since" Co-authored-by: Trey <47907719+trwy7@users.noreply.github.com> --- src/plugins/friendsSince/index.tsx | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/src/plugins/friendsSince/index.tsx b/src/plugins/friendsSince/index.tsx index ab3320dfe..dd37137a4 100644 --- a/src/plugins/friendsSince/index.tsx +++ b/src/plugins/friendsSince/index.tsx @@ -6,6 +6,7 @@ import ErrorBoundary from "@components/ErrorBoundary"; import { Devs } from "@utils/constants"; +import { getCurrentChannel } from "@utils/discord"; import definePlugin from "@utils/types"; import { findByPropsLazy } from "@webpack"; import { React, RelationshipStore } from "@webpack/common"; @@ -49,6 +50,18 @@ export default definePlugin({
+ {!!getCurrentChannel()?.guild_id && ( + + )} {getCreatedAtDate(friendsSince, locale.getLocale())}