You are using an outdated version of Vencord! Chances are, your issue is already fixed.
-
- Please first update using the Updater Page in Settings, or use the VencordInstaller (Update Vencord Button)
- to do so, in case you can't access the Updater page.
+
+ Please first update before asking for support!
+ You are using an externally updated Vencord version, which we do not provide support for!
+
+ Please either switch to an officially supported version of Vencord, or
+ contact your package maintainer for support instead.
+
+
+ You are using a fork of Vencord, which we do not provide support for!
+
+ Please either switch to an officially supported version of Vencord, or
+ contact your package maintainer for support instead.
+
+
,
+ onCloseCallback: () => setTimeout(() => NavigationRouter.back(), 50)
});
}
}
- }
+ },
+
+ ContributorDmWarningCard: ErrorBoundary.wrap(({ userId }) => {
+ if (!isPluginDev(userId)) return null;
+ if (RelationshipStore.isFriend(userId)) return null;
+
+ return (
+
+ Please do not private message Vencord plugin developers for support!
+
+ Instead, use the Vencord support channel: {Parser.parse("https://discord.com/channels/1015060230222131221/1026515880080842772")}
+ {!ChannelStore.getChannel(SUPPORT_CHANNEL_ID) && " (Click the link to join)"}
+
+ );
+ }, { noop: true })
});
diff --git a/src/plugins/messageLatency/README.md b/src/plugins/messageLatency/README.md
new file mode 100644
index 000000000..8d2a776cd
--- /dev/null
+++ b/src/plugins/messageLatency/README.md
@@ -0,0 +1,31 @@
+# MessageLatency
+
+Displays an indicator for messages that took ≥n seconds to send.
+
+> **NOTE**
+>
+> - This plugin only applies to messages received after opening the channel
+> - False positives can exist if the user's system clock has drifted.
+> - Grouped messages only display latency of the first message
+
+## Demo
+
+### Chat View
+
+![chat-view](https://github.com/Vendicated/Vencord/assets/82430093/69430881-60b3-422f-aa3d-c62953837566)
+
+### Clock -ve Drift
+
+![pissbot-on-top](https://github.com/Vendicated/Vencord/assets/82430093/d9248b66-e761-4872-8829-e8bf4fea6ec8)
+
+### Clock +ve Drift
+
+![dumb-ai](https://github.com/Vendicated/Vencord/assets/82430093/0e9783cf-51d5-4559-ae10-42399e7d4099)
+
+### Connection Delay
+
+![who-this](https://github.com/Vendicated/Vencord/assets/82430093/fd68873d-8630-42cc-a166-e9063d2718b2)
+
+### Icons
+
+![icons](https://github.com/Vendicated/Vencord/assets/82430093/17630bd9-44ee-4967-bcdf-3315eb6eca85)
diff --git a/src/plugins/messageLatency/index.tsx b/src/plugins/messageLatency/index.tsx
new file mode 100644
index 000000000..c43035e3d
--- /dev/null
+++ b/src/plugins/messageLatency/index.tsx
@@ -0,0 +1,147 @@
+/*
+ * Vencord, a Discord client mod
+ * Copyright (c) 2024 Vendicated and contributors
+ * SPDX-License-Identifier: GPL-3.0-or-later
+ */
+
+import { definePluginSettings } from "@api/Settings";
+import ErrorBoundary from "@components/ErrorBoundary";
+import { Devs } from "@utils/constants";
+import { isNonNullish } from "@utils/guards";
+import definePlugin, { OptionType } from "@utils/types";
+import { findExportedComponent } from "@webpack";
+import { SnowflakeUtils, Tooltip } from "@webpack/common";
+import { Message } from "discord-types/general";
+
+type FillValue = ("status-danger" | "status-warning" | "text-muted");
+type Fill = [FillValue, FillValue, FillValue];
+type DiffKey = keyof Diff;
+
+interface Diff {
+ days: number,
+ hours: number,
+ minutes: number,
+ seconds: number;
+}
+
+const HiddenVisually = findExportedComponent("HiddenVisually");
+
+export default definePlugin({
+ name: "MessageLatency",
+ description: "Displays an indicator for messages that took ≥n seconds to send",
+ authors: [Devs.arHSM],
+ settings: definePluginSettings({
+ latency: {
+ type: OptionType.NUMBER,
+ description: "Threshold in seconds for latency indicator",
+ default: 2
+ }
+ }),
+ patches: [
+ {
+ find: "showCommunicationDisabledStyles",
+ replacement: {
+ match: /(message:(\i),avatar:\i,username:\(0,\i.jsxs\)\(\i.Fragment,\{children:\[)(\i&&)/,
+ replace: "$1$self.Tooltip()({ message: $2 }),$3"
+ }
+ }
+ ],
+ stringDelta(delta: number) {
+ const diff: Diff = {
+ days: Math.round(delta / (60 * 60 * 24)),
+ hours: Math.round((delta / (60 * 60)) % 24),
+ minutes: Math.round((delta / (60)) % 60),
+ seconds: Math.round(delta % 60),
+ };
+
+ const str = (k: DiffKey) => diff[k] > 0 ? `${diff[k]} ${k}` : null;
+ const keys = Object.keys(diff) as DiffKey[];
+
+ return keys.map(str).filter(isNonNullish).join(" ") || "0 seconds";
+ },
+ latencyTooltipData(message: Message) {
+ const { id, nonce } = message;
+
+ // Message wasn't received through gateway
+ if (!isNonNullish(nonce)) return null;
+
+ const delta = Math.round((SnowflakeUtils.extractTimestamp(id) - SnowflakeUtils.extractTimestamp(nonce)) / 1000);
+
+ // Thanks dziurwa (I hate you)
+ // This is when the user's clock is ahead
+ // Can't do anything if the clock is behind
+ const abs = Math.abs(delta);
+ const ahead = abs !== delta;
+
+ const stringDelta = this.stringDelta(abs);
+
+ // Also thanks dziurwa
+ // 2 minutes
+ const TROLL_LIMIT = 2 * 60;
+ const { latency } = this.settings.store;
+
+ const fill: Fill = delta >= TROLL_LIMIT || ahead ? ["text-muted", "text-muted", "text-muted"] : delta >= (latency * 2) ? ["status-danger", "text-muted", "text-muted"] : ["status-warning", "status-warning", "text-muted"];
+
+ return abs >= latency ? { delta: stringDelta, ahead: abs !== delta, fill } : null;
+ },
+ Tooltip() {
+ return ErrorBoundary.wrap(({ message }: { message: Message; }) => {
+
+ const d = this.latencyTooltipData(message);
+
+ if (!isNonNullish(d)) return null;
+
+ return
+ {
+ props => <>
+ {}
+ {/* Time Out indicator uses this, I think this is for a11y */}
+ Delayed Message
+ >
+ }
+ ;
+ });
+ },
+ Icon({ delta, fill, props }: {
+ delta: string;
+ fill: Fill,
+ props: {
+ onClick(): void;
+ onMouseEnter(): void;
+ onMouseLeave(): void;
+ onContextMenu(): void;
+ onFocus(): void;
+ onBlur(): void;
+ "aria-label"?: string;
+ };
+ }) {
+ return ;
+ }
+});
diff --git a/src/plugins/webScreenShareFixes.web/index.ts b/src/plugins/webScreenShareFixes.web/index.ts
new file mode 100644
index 000000000..8d1ab5821
--- /dev/null
+++ b/src/plugins/webScreenShareFixes.web/index.ts
@@ -0,0 +1,30 @@
+/*
+ * Vencord, a Discord client mod
+ * Copyright (c) 2024 Vendicated and contributors
+ * SPDX-License-Identifier: GPL-3.0-or-later
+ */
+
+import { Devs } from "@utils/constants";
+import definePlugin from "@utils/types";
+
+export default definePlugin({
+ name: "WebScreenShareFixes",
+ authors: [Devs.Kaitlyn],
+ description: "Removes 2500kbps bitrate cap on chromium and vesktop clients.",
+ enabledByDefault: true,
+ patches: [
+ {
+ find: "x-google-max-bitrate",
+ replacement: [
+ {
+ match: /"x-google-max-bitrate=".concat\(\i\)/,
+ replace: '"x-google-max-bitrate=".concat("80_000")'
+ },
+ {
+ match: /;level-asymmetry-allowed=1/,
+ replace: ";b=AS:800000;level-asymmetry-allowed=1"
+ }
+ ]
+ }
+ ]
+});
diff --git a/src/utils/constants.ts b/src/utils/constants.ts
index cce276ef8..ab6c0bb70 100644
--- a/src/utils/constants.ts
+++ b/src/utils/constants.ts
@@ -266,6 +266,10 @@ export const Devs = /* #__PURE__*/ Object.freeze({
name: "Dziurwa",
id: 1001086404203389018n
},
+ arHSM: {
+ name: "arHSM",
+ id: 841509053422632990n
+ },
F53: {
name: "F53",
id: 280411966126948353n