+
{
{
!Settings.plugins.ReviewDB.hideTimestamps && (
-
- )
+
+ {dateFormat.format(review.timestamp * 1000)}
+ )
}
{review.comment}
diff --git a/src/plugins/reviewDB/components/ReviewsView.tsx b/src/plugins/reviewDB/components/ReviewsView.tsx
index f4bd248..ff46cca 100644
--- a/src/plugins/reviewDB/components/ReviewsView.tsx
+++ b/src/plugins/reviewDB/components/ReviewsView.tsx
@@ -19,7 +19,7 @@
import { Settings } from "@api/Settings";
import { classes } from "@utils/misc";
import { useAwaiter } from "@utils/react";
-import { findLazy } from "@webpack";
+import { findByPropsLazy } from "@webpack";
import { Forms, React, Text, UserStore } from "@webpack/common";
import type { KeyboardEvent } from "react";
@@ -27,7 +27,7 @@ import { addReview, getReviews } from "../Utils/ReviewDBAPI";
import { authorize, showToast } from "../Utils/Utils";
import ReviewComponent from "./ReviewComponent";
-const Classes = findLazy(m => typeof m.textarea === "string");
+const Classes = findByPropsLazy("inputDefault", "editable");
export default function ReviewsView({ userId }: { userId: string; }) {
const { token } = Settings.plugins.ReviewDB;
@@ -65,7 +65,7 @@ export default function ReviewsView({ userId }: { userId: string; }) {
tag="h2"
variant="eyebrow"
style={{
- marginBottom: "12px",
+ marginBottom: "8px",
color: "var(--header-primary)"
}}
>
@@ -79,13 +79,17 @@ export default function ReviewsView({ userId }: { userId: string; }) {
/>
)}
{reviews?.length === 0 && (
-
+
Looks like nobody reviewed this user yet. You could be the first!
)}
diff --git a/src/plugins/reviewDB/entities/User.ts b/src/plugins/reviewDB/entities/User.ts
index 4a3be0e..2c59992 100644
--- a/src/plugins/reviewDB/entities/User.ts
+++ b/src/plugins/reviewDB/entities/User.ts
@@ -22,7 +22,23 @@ export const enum UserType {
Admin = 1
}
-export interface ReviewDBUser {
- lastReviewID: number,
- type: UserType;
+export interface BanInfo {
+ id: string;
+ discordID: string;
+ reviewID: number;
+ reviewContent: string;
+ banEndDate: string;
+}
+
+export interface ReviewDBUser {
+ ID: number
+ discordID: string
+ username: string
+ profilePhoto: string
+ clientMod: string
+ warningCount: number
+ badges: any[]
+ banInfo: BanInfo | null
+ lastReviewID: number
+ type: UserType
}
diff --git a/src/plugins/reviewDB/index.tsx b/src/plugins/reviewDB/index.tsx
index 0495c77..52ddb3b 100644
--- a/src/plugins/reviewDB/index.tsx
+++ b/src/plugins/reviewDB/index.tsx
@@ -22,10 +22,11 @@ import { Settings } from "@api/Settings";
import ErrorBoundary from "@components/ErrorBoundary";
import { Devs } from "@utils/constants";
import definePlugin, { OptionType } from "@utils/types";
-import { Button } from "@webpack/common";
+import { Alerts, Button } from "@webpack/common";
import { User } from "discord-types/general";
import ReviewsView from "./components/ReviewsView";
+import { UserType } from "./entities/User";
import { getCurrentUserInfo } from "./Utils/ReviewDBAPI";
import { authorize, showToast } from "./Utils/Utils";
@@ -47,10 +48,10 @@ export default definePlugin({
options: {
authorize: {
type: OptionType.COMPONENT,
- description: "Authorise with ReviewDB",
+ description: "Authorize with ReviewDB",
component: () => (
)
},
@@ -68,7 +69,29 @@ export default definePlugin({
type: OptionType.BOOLEAN,
description: "Hide timestamps on reviews",
default: false,
- }
+ },
+ website: {
+ type: OptionType.COMPONENT,
+ description: "ReviewDB website",
+ component: () => (
+
+ )
+ },
+ supportServer: {
+ type: OptionType.COMPONENT,
+ description: "ReviewDB Support Server",
+ component: () => (
+
+ )
+ },
},
async start() {
@@ -82,7 +105,34 @@ export default definePlugin({
if (user.lastReviewID !== 0)
showToast("You have new reviews on your profile!");
}
- settings.userType = user.type;
+
+ if (user.banInfo) {
+ const endDate = new Date(user.banInfo.banEndDate);
+ if (endDate > new Date() && (settings.user?.banInfo?.banEndDate ?? 0) < endDate) {
+
+ Alerts.show({
+ title: "You have been banned from ReviewDB",
+ body: <>
+
+ You are banned from ReviewDB {(user.type === UserType.Banned) ? "permanently" : "until " + endDate.toLocaleString()}
+
+
+ Offending Review: {user.banInfo.reviewContent}
+
+
+ Continued offenses will result in a permanent ban.
+
+ >,
+ cancelText: "Appeal",
+ confirmText: "Ok",
+ onCancel: () => {
+ window.open("https://forms.gle/Thj3rDYaMdKoMMuq6");
+ }
+ });
+ }
+ }
+
+ settings.user = user;
}, 4000);
},
diff --git a/src/plugins/searchReply.tsx b/src/plugins/searchReply.tsx
index fe6348b..9e53436 100644
--- a/src/plugins/searchReply.tsx
+++ b/src/plugins/searchReply.tsx
@@ -38,7 +38,7 @@ const messageContextMenuPatch: NavContextMenuPatchCallback = (children, { messag
// dms and group chats
const dmGroup = findGroupChildrenByChildId("pin", children);
if (dmGroup && !dmGroup.some(child => child?.props?.id === "reply")) {
- const pinIndex = dmGroup.findIndex(c => c.props.id === "pin");
+ const pinIndex = dmGroup.findIndex(c => c?.props.id === "pin");
return dmGroup.splice(pinIndex + 1, 0, (
require("../components/VencordSettings").default);
-
export default definePlugin({
name: "Settings",
description: "Adds Settings UI and debug info",
@@ -95,37 +91,37 @@ export default definePlugin({
{
section: "VencordSettings",
label: "Vencord",
- element: () =>
+ element: require("@components/VencordSettings/VencordTab").default
},
{
section: "VencordPlugins",
label: "Plugins",
- element: () => ,
+ element: require("@components/VencordSettings/PluginsTab").default,
},
{
section: "VencordThemes",
label: "Themes",
- element: () => ,
+ element: require("@components/VencordSettings/ThemesTab").default,
},
!IS_WEB && {
section: "VencordUpdater",
label: "Updater",
- element: () => ,
+ element: require("@components/VencordSettings/UpdaterTab").default,
},
{
section: "VencordCloud",
label: "Cloud",
- element: () => ,
+ element: require("@components/VencordSettings/CloudTab").default,
},
{
section: "VencordSettingsSync",
label: "Backup & Restore",
- element: () => ,
+ element: require("@components/VencordSettings/BackupAndRestoreTab").default,
},
IS_DEV && {
section: "VencordPatchHelper",
label: "Patch Helper",
- element: PatchHelper!,
+ element: require("@components/VencordSettings/PatchHelperTab").default,
},
IS_VENCORD_DESKTOP && {
section: "VencordDesktop",
diff --git a/src/plugins/showConnections/VerifiedIcon.tsx b/src/plugins/showConnections/VerifiedIcon.tsx
new file mode 100644
index 0000000..79e27c4
--- /dev/null
+++ b/src/plugins/showConnections/VerifiedIcon.tsx
@@ -0,0 +1,38 @@
+/*
+ * Vencord, a modification for Discord's desktop app
+ * Copyright (c) 2023 Vendicated and contributors
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see .
+*/
+
+import { LazyComponent } from "@utils/react";
+import { findByCode, findLazy } from "@webpack";
+import { i18n, useToken } from "@webpack/common";
+
+const ColorMap = findLazy(m => m.colors?.INTERACTIVE_MUTED?.css);
+const VerifiedIconComponent = LazyComponent(() => findByCode(".CONNECTIONS_ROLE_OFFICIAL_ICON_TOOLTIP"));
+
+export function VerifiedIcon() {
+ const color = useToken(ColorMap.colors.INTERACTIVE_MUTED).hex();
+ const forcedIconColor = useToken(ColorMap.colors.INTERACTIVE_ACTIVE).hex();
+
+ return (
+
+ );
+}
diff --git a/src/plugins/showConnections/index.tsx b/src/plugins/showConnections/index.tsx
index e2afc5b..50fcfe1 100644
--- a/src/plugins/showConnections/index.tsx
+++ b/src/plugins/showConnections/index.tsx
@@ -20,6 +20,8 @@ import "./styles.css";
import { definePluginSettings } from "@api/Settings";
import ErrorBoundary from "@components/ErrorBoundary";
+import { Flex } from "@components/Flex";
+import { CopyIcon, LinkIcon } from "@components/Icons";
import { Devs } from "@utils/constants";
import { copyWithToast } from "@utils/misc";
import { LazyComponent } from "@utils/react";
@@ -28,6 +30,8 @@ import { findByCode, findByCodeLazy, findByPropsLazy, findStoreLazy } from "@web
import { Text, Tooltip } from "@webpack/common";
import { User } from "discord-types/general";
+import { VerifiedIcon } from "./VerifiedIcon";
+
const Section = LazyComponent(() => findByCode("().lastSection"));
const UserProfileStore = findStoreLazy("UserProfileStore");
const ThemeStore = findStoreLazy("ThemeStore");
@@ -97,7 +101,13 @@ function ConnectionsComponent({ id, theme }: { id: string, theme: string; }) {
>
Connections
- {connections.map(connection => )}
+
+ {connections.map(connection => )}
+
);
}
@@ -111,17 +121,23 @@ function CompactConnectionComponent({ connection, theme }: { connection: Connect
aria-label={connection.name}
src={theme === "light" ? platform.icon.lightSVG : platform.icon.darkSVG}
style={{
- marginTop: getSpacingPx(settings.store.iconSpacing),
- marginRight: getSpacingPx(settings.store.iconSpacing),
width: settings.store.iconSize,
height: settings.store.iconSize
}}
/>
);
+ const TooltipIcon = url ? LinkIcon : CopyIcon;
+
return (
+ {connection.name}
+ {connection.verified && }
+
+
+ }
key={connection.id}
>
{tooltipProps =>
diff --git a/src/plugins/showConnections/styles.css b/src/plugins/showConnections/styles.css
index 71a835b..383593c 100644
--- a/src/plugins/showConnections/styles.css
+++ b/src/plugins/showConnections/styles.css
@@ -3,3 +3,9 @@
display: inline-block;
cursor: pointer;
}
+
+.vc-sc-tooltip {
+ display: inline-flex;
+ gap: 0.25em;
+ align-items: center;
+}
diff --git a/src/plugins/showHiddenChannels/components/HiddenChannelLockScreen.tsx b/src/plugins/showHiddenChannels/components/HiddenChannelLockScreen.tsx
index dc670bf..d01efec 100644
--- a/src/plugins/showHiddenChannels/components/HiddenChannelLockScreen.tsx
+++ b/src/plugins/showHiddenChannels/components/HiddenChannelLockScreen.tsx
@@ -16,15 +16,18 @@
* along with this program. If not, see .
*/
+import { Settings } from "@api/Settings";
import ErrorBoundary from "@components/ErrorBoundary";
import { LazyComponent } from "@utils/react";
import { formatDuration } from "@utils/text";
-import { find, findByPropsLazy, findStoreLazy } from "@webpack";
-import { FluxDispatcher, GuildMemberStore, GuildStore, moment, Parser, PermissionStore, SnowflakeUtils, Text, Timestamp, Tooltip } from "@webpack/common";
+import { find, findByPropsLazy } from "@webpack";
+import { EmojiStore, FluxDispatcher, GuildMemberStore, GuildStore, moment, Parser, PermissionStore, SnowflakeUtils, Text, Timestamp, Tooltip, useEffect, useState } from "@webpack/common";
import type { Channel } from "discord-types/general";
import type { ComponentType } from "react";
-import { VIEW_CHANNEL } from "..";
+import openRolesAndUsersPermissionsModal, { PermissionType, RoleOrUserPermission } from "../../permissionsViewer/components/RolesAndUsersPermissions";
+import { sortPermissionOverwrites } from "../../permissionsViewer/utils";
+import { settings, VIEW_CHANNEL } from "..";
enum SortOrderTypes {
LATEST_ACTIVITY = 0,
@@ -92,7 +95,6 @@ const TagComponent = LazyComponent(() => find(m => {
return code.includes(".Messages.FORUM_TAG_A11Y_FILTER_BY_TAG") && !code.includes("increasedActivityPill");
}));
-const EmojiStore = findStoreLazy("EmojiStore");
const EmojiParser = findByPropsLazy("convertSurrogateToName");
const EmojiUtils = findByPropsLazy("getURL", "buildEmojiReactionColorsPlatformed");
@@ -124,6 +126,9 @@ const VideoQualityModesToNames = {
const HiddenChannelLogo = "/assets/433e3ec4319a9d11b0cbe39342614982.svg";
function HiddenChannelLockScreen({ channel }: { channel: ExtendedChannel; }) {
+ const [viewAllowedUsersAndRoles, setViewAllowedUsersAndRoles] = useState(settings.store.defaultAllowedUsersAndRolesDropdownState);
+ const [permissions, setPermissions] = useState([]);
+
const {
type,
topic,
@@ -140,27 +145,39 @@ function HiddenChannelLockScreen({ channel }: { channel: ExtendedChannel; }) {
bitrate,
rtcRegion,
videoQualityMode,
- permissionOverwrites
+ permissionOverwrites,
+ guild_id
} = channel;
- const membersToFetch: Array = [];
+ useEffect(() => {
+ const membersToFetch: Array = [];
- const guildOwnerId = GuildStore.getGuild(channel.guild_id).ownerId;
- if (!GuildMemberStore.getMember(channel.guild_id, guildOwnerId)) membersToFetch.push(guildOwnerId);
+ const guildOwnerId = GuildStore.getGuild(guild_id).ownerId;
+ if (!GuildMemberStore.getMember(guild_id, guildOwnerId)) membersToFetch.push(guildOwnerId);
- Object.values(permissionOverwrites).forEach(({ type, id: userId }) => {
- if (type === 1) {
- if (!GuildMemberStore.getMember(channel.guild_id, userId)) membersToFetch.push(userId);
- }
- });
-
- if (membersToFetch.length > 0) {
- FluxDispatcher.dispatch({
- type: "GUILD_MEMBERS_REQUEST",
- guildIds: [channel.guild_id],
- userIds: membersToFetch
+ Object.values(permissionOverwrites).forEach(({ type, id: userId }) => {
+ if (type === 1 && !GuildMemberStore.getMember(guild_id, userId)) {
+ membersToFetch.push(userId);
+ }
});
- }
+
+ if (membersToFetch.length > 0) {
+ FluxDispatcher.dispatch({
+ type: "GUILD_MEMBERS_REQUEST",
+ guildIds: [guild_id],
+ userIds: membersToFetch
+ });
+ }
+
+ if (Settings.plugins.PermissionsViewer.enabled) {
+ setPermissions(sortPermissionOverwrites(Object.values(permissionOverwrites).map(overwrite => ({
+ type: overwrite.type as PermissionType,
+ id: overwrite.id,
+ overwriteAllow: overwrite.allow,
+ overwriteDeny: overwrite.deny
+ })), guild_id));
+ }
+ }, [channelId]);
return (
@@ -182,7 +199,7 @@ function HiddenChannelLockScreen({ channel }: { channel: ExtendedChannel; }) {
aria-hidden={true}
role="img"
>
-
+
)}
@@ -192,7 +209,7 @@ function HiddenChannelLockScreen({ channel }: { channel: ExtendedChannel; }) {
{(!channel.isGuildVoice() && !channel.isGuildStageVoice()) && (
You can not see the {channel.isForumChannel() ? "posts" : "messages"} of this channel.
- {channel.isForumChannel() && topic && topic.length > 0 && "However you may see its guidelines:"}
+ {channel.isForumChannel() && topic && topic.length > 0 && " However you may see its guidelines:"}
)}
@@ -268,8 +285,49 @@ function HiddenChannelLockScreen({ channel }: { channel: ExtendedChannel; }) {
}
-
Allowed users and roles:
-
+
+ {Settings.plugins.PermissionsViewer.enabled && (
+
+ {({ onMouseLeave, onMouseEnter }) => (
+
+ )}
+
+ )}
+
Allowed users and roles:
+
+ {({ onMouseLeave, onMouseEnter }) => (
+
+ )}
+
+
+ {viewAllowedUsersAndRoles &&
}