mirror of
https://github.com/Vendicated/Vencord.git
synced 2024-09-20 06:30:35 +00:00
Compare commits
No commits in common. "43cdb335c968df15dd7692793df338eae26083fb" and "225c673fb97cf5c55f89fd977f9ea45c6e4ebd97" have entirely different histories.
43cdb335c9
...
225c673fb9
18 changed files with 132 additions and 109 deletions
|
@ -40,7 +40,7 @@
|
|||
"@vap/shiki": "0.10.5",
|
||||
"fflate": "^0.8.2",
|
||||
"gifenc": "github:mattdesl/gifenc#64842fca317b112a8590f8fef2bf3825da8f6fe3",
|
||||
"monaco-editor": "^0.52.0",
|
||||
"monaco-editor": "^0.51.0",
|
||||
"nanoid": "^5.0.7"
|
||||
},
|
||||
"devDependencies": {
|
||||
|
|
|
@ -129,6 +129,10 @@ export default {
|
|||
return constructor && Object.getPrototypeOf(constructor);
|
||||
},
|
||||
includeOptional: true,
|
||||
ignoredRemovals: {
|
||||
// Seems to have been removed
|
||||
fields: ["voiceBackgroundDisplay"],
|
||||
},
|
||||
},
|
||||
ForumLayout: {
|
||||
type: "enum",
|
||||
|
@ -167,6 +171,12 @@ export default {
|
|||
VideoQualityMode: {
|
||||
type: "enum",
|
||||
},
|
||||
/*
|
||||
// This seems to have been removed
|
||||
VoiceCallBackgroundType: {
|
||||
type: "enum",
|
||||
},
|
||||
*/
|
||||
},
|
||||
"./general/channels/ForumChannelRecord.ts": {
|
||||
ForumChannelRecord: {
|
||||
|
|
|
@ -37,6 +37,7 @@ export declare abstract class ChannelRecordBase extends ChannelRecordProperties
|
|||
isAnnouncementThread(): this is ThreadChannelRecord<ChannelType.ANNOUNCEMENT_THREAD>;
|
||||
isArchivedLockedThread(): boolean;
|
||||
isArchivedThread(): boolean;
|
||||
isBroadcastChannel(): boolean;
|
||||
isCategory(): this is GuildCategoryChannelRecord;
|
||||
isDirectory(): this is GuildDirectoryChannelRecord;
|
||||
isDM(): this is DMChannelRecord;
|
||||
|
@ -133,6 +134,10 @@ export declare abstract class ChannelRecordProperties {
|
|||
userLimit_?: number | undefined;
|
||||
version?: number | undefined;
|
||||
videoQualityMode?: VideoQualityMode | undefined;
|
||||
/** @todo This seems to have been removed. */
|
||||
voiceBackgroundDisplay?: { type: VoiceCallBackgroundType.EMPTY; }
|
||||
| { resourceId: string; type: VoiceCallBackgroundType.GRADIENT; }
|
||||
| Nullish;
|
||||
}
|
||||
|
||||
export interface ForumTag {
|
||||
|
@ -253,3 +258,10 @@ export enum VideoQualityMode {
|
|||
AUTO = 1,
|
||||
FULL = 2,
|
||||
}
|
||||
|
||||
// Original name: VoiceCallBackgroundTypes
|
||||
/** @todo This seems to have been removed. */
|
||||
export enum VoiceCallBackgroundType {
|
||||
EMPTY = 0,
|
||||
GRADIENT = 1,
|
||||
}
|
||||
|
|
|
@ -36,6 +36,8 @@ export declare class ForumChannelRecord<ChannelType extends ForumChannelType = F
|
|||
isMessageRequest?: undefined;
|
||||
isMessageRequestTimestamp?: undefined;
|
||||
isSpam?: undefined;
|
||||
lastMessageId: ChannelRecordBase["lastMessageId"];
|
||||
lastPinTimestamp: ChannelRecordBase["lastPinTimestamp"];
|
||||
linkedLobby?: undefined;
|
||||
member?: undefined;
|
||||
memberCount?: undefined;
|
||||
|
@ -65,4 +67,5 @@ export declare class ForumChannelRecord<ChannelType extends ForumChannelType = F
|
|||
userLimit_?: undefined;
|
||||
version: ChannelRecordBase["version"];
|
||||
videoQualityMode?: undefined;
|
||||
voiceBackgroundDisplay?: undefined;
|
||||
}
|
||||
|
|
|
@ -44,6 +44,8 @@ export declare abstract class GuildTextualChannelRecordBase extends ChannelRecor
|
|||
isMessageRequest?: undefined;
|
||||
isMessageRequestTimestamp?: undefined;
|
||||
isSpam?: undefined;
|
||||
lastMessageId: ChannelRecordBase["lastMessageId"];
|
||||
lastPinTimestamp: ChannelRecordBase["lastPinTimestamp"];
|
||||
/** @todo May only be nullish. */
|
||||
linkedLobby: ChannelRecordBase["linkedLobby"];
|
||||
member?: undefined;
|
||||
|
@ -74,6 +76,7 @@ export declare abstract class GuildTextualChannelRecordBase extends ChannelRecor
|
|||
userLimit_?: undefined;
|
||||
version: ChannelRecordBase["version"];
|
||||
videoQualityMode?: undefined;
|
||||
voiceBackgroundDisplay?: undefined;
|
||||
}
|
||||
|
||||
export type GuildTextChannelProperties = Optional<PartialOnUndefined<OmitOptional<ChannelRecordOwnProperties<GuildTextChannelRecord>>>, Nullish, "guild_id" | "name" | "permissionOverwrites_" | "type">;
|
||||
|
|
|
@ -41,6 +41,7 @@ export declare abstract class GuildVocalChannelRecordBase extends ChannelRecordB
|
|||
isMessageRequest?: undefined;
|
||||
isMessageRequestTimestamp?: undefined;
|
||||
isSpam?: undefined;
|
||||
lastMessageId: ChannelRecordBase["lastMessageId"];
|
||||
lastPinTimestamp: undefined;
|
||||
linkedLobby?: undefined;
|
||||
member?: undefined;
|
||||
|
@ -72,6 +73,7 @@ export declare abstract class GuildVocalChannelRecordBase extends ChannelRecordB
|
|||
userLimit_: Defined<ChannelRecordBase["userLimit_"]>;
|
||||
version: ChannelRecordBase["version"];
|
||||
videoQualityMode: ChannelRecordBase["videoQualityMode"];
|
||||
voiceBackgroundDisplay: Defined<ChannelRecordBase["voiceBackgroundDisplay"]>;
|
||||
}
|
||||
|
||||
export type GuildVoiceChannelProperties = Optional<PartialOnUndefined<OmitOptional<ChannelRecordOwnProperties<GuildVoiceChannelRecord>>>, Nullish, "guild_id" | "name" | "permissionOverwrites_">;
|
||||
|
|
|
@ -47,6 +47,8 @@ export declare abstract class PrivateChannelRecordBase extends ChannelRecordBase
|
|||
isMessageRequest: ChannelRecordBase["isMessageRequest"];
|
||||
isMessageRequestTimestamp: ChannelRecordBase["isMessageRequestTimestamp"];
|
||||
isSpam: Defined<ChannelRecordBase["isSpam"]>;
|
||||
lastMessageId: ChannelRecordBase["lastMessageId"];
|
||||
lastPinTimestamp: ChannelRecordBase["lastPinTimestamp"];
|
||||
linkedLobby?: undefined;
|
||||
member?: undefined;
|
||||
memberCount?: undefined;
|
||||
|
@ -75,6 +77,7 @@ export declare abstract class PrivateChannelRecordBase extends ChannelRecordBase
|
|||
userLimit_?: undefined;
|
||||
version?: undefined;
|
||||
videoQualityMode?: undefined;
|
||||
voiceBackgroundDisplay?: undefined;
|
||||
}
|
||||
|
||||
export type DMChannelProperties = Omit<Optional<PartialOnUndefined<OmitOptional<ChannelRecordOwnProperties<DMChannelRecord>>>, Nullish, "guild_id" | "name" | "safetyWarnings">, "rawRecipients" | "recipients">
|
||||
|
|
|
@ -36,6 +36,8 @@ export declare class ThreadChannelRecord<ChannelType extends ThreadChannelType =
|
|||
isMessageRequest?: undefined;
|
||||
isMessageRequestTimestamp?: undefined;
|
||||
isSpam?: undefined;
|
||||
lastMessageId: ChannelRecordBase["lastMessageId"];
|
||||
lastPinTimestamp: ChannelRecordBase["lastMessageId"];
|
||||
linkedLobby?: undefined;
|
||||
member: ChannelRecordBase["member"];
|
||||
memberCount: Defined<ChannelRecordBase["memberCount"]>;
|
||||
|
@ -64,4 +66,5 @@ export declare class ThreadChannelRecord<ChannelType extends ThreadChannelType =
|
|||
userLimit_: undefined;
|
||||
version?: undefined;
|
||||
videoQualityMode: undefined;
|
||||
voiceBackgroundDisplay?: undefined;
|
||||
}
|
||||
|
|
|
@ -34,6 +34,8 @@ export declare class UnknownChannelRecord extends ChannelRecordBase {
|
|||
isMessageRequest: ChannelRecordBase["isMessageRequest"];
|
||||
isMessageRequestTimestamp: ChannelRecordBase["isMessageRequestTimestamp"];
|
||||
isSpam: ChannelRecordBase["isSpam"];
|
||||
lastMessageId: ChannelRecordBase["lastMessageId"];
|
||||
lastPinTimestamp: ChannelRecordBase["lastPinTimestamp"];
|
||||
linkedLobby: ChannelRecordBase["linkedLobby"];
|
||||
member: ChannelRecordBase["member"];
|
||||
memberCount: ChannelRecordBase["memberCount"];
|
||||
|
|
File diff suppressed because one or more lines are too long
|
@ -63,8 +63,8 @@ importers:
|
|||
specifier: github:mattdesl/gifenc#64842fca317b112a8590f8fef2bf3825da8f6fe3
|
||||
version: https://codeload.github.com/mattdesl/gifenc/tar.gz/64842fca317b112a8590f8fef2bf3825da8f6fe3
|
||||
monaco-editor:
|
||||
specifier: ^0.52.0
|
||||
version: 0.52.0
|
||||
specifier: ^0.51.0
|
||||
version: 0.51.0
|
||||
nanoid:
|
||||
specifier: ^5.0.7
|
||||
version: 5.0.7
|
||||
|
@ -1756,8 +1756,8 @@ packages:
|
|||
moment@2.29.4:
|
||||
resolution: {integrity: sha512-5LC9SOxjSc2HF6vO2CyuTDNivEdoz2IvyJJGj6X8DJ0eFyfszE0QiEd+iXmBvUP3WHxSjFH/vIsA0EN00cgr8w==}
|
||||
|
||||
monaco-editor@0.52.0:
|
||||
resolution: {integrity: sha512-OeWhNpABLCeTqubfqLMXGsqf6OmPU6pHM85kF3dhy6kq5hnhuVS1p3VrEW/XhWHc71P2tHyS5JFySD8mgs1crw==}
|
||||
monaco-editor@0.51.0:
|
||||
resolution: {integrity: sha512-xaGwVV1fq343cM7aOYB6lVE4Ugf0UyimdD/x5PWcWBMKENwectaEu77FAN7c5sFiyumqeJdX1RPTh1ocioyDjw==}
|
||||
|
||||
ms@2.0.0:
|
||||
resolution: {integrity: sha512-Tpp60P6IUJDTuOq/5Z8cdskzJujfwqfOTkrwIwj7IRISpnkJnT6SyJ4PCPnGMoFjC9ddhal5KVIYtAt97ix05A==}
|
||||
|
@ -3879,7 +3879,7 @@ snapshots:
|
|||
|
||||
moment@2.29.4: {}
|
||||
|
||||
monaco-editor@0.52.0: {}
|
||||
monaco-editor@0.51.0: {}
|
||||
|
||||
ms@2.0.0: {}
|
||||
|
||||
|
|
|
@ -1,5 +0,0 @@
|
|||
# FullSearchContext
|
||||
|
||||
Makes the message context menu in message search results have all options you'd expect.
|
||||
|
||||
![](https://github.com/user-attachments/assets/472d1327-3935-44c7-b7c4-0978b5348550)
|
|
@ -1,85 +0,0 @@
|
|||
/*
|
||||
* 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 <https://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
import { migratePluginSettings } from "@api/Settings";
|
||||
import { Devs } from "@utils/constants";
|
||||
import definePlugin from "@utils/types";
|
||||
import type { ChannelRecord, MessageRecord } from "@vencord/discord-types";
|
||||
import { findByPropsLazy } from "@webpack";
|
||||
import { ChannelStore, ContextMenuApi, i18n, UserStore } from "@webpack/common";
|
||||
import type { MouseEvent } from "react";
|
||||
|
||||
const { useMessageMenu } = findByPropsLazy("useMessageMenu");
|
||||
|
||||
function MessageMenu({ message, channel, onHeightUpdate }: {
|
||||
message: MessageRecord;
|
||||
channel: ChannelRecord;
|
||||
onHeightUpdate: any;
|
||||
}) {
|
||||
const canReport = message.author.id !== UserStore.getCurrentUser()!.id && !message.author.system;
|
||||
|
||||
return useMessageMenu({
|
||||
navId: "message-actions",
|
||||
ariaLabel: i18n.Messages.MESSAGE_UTILITIES_A11Y_LABEL,
|
||||
|
||||
message,
|
||||
channel,
|
||||
canReport,
|
||||
onHeightUpdate,
|
||||
onClose: () => { ContextMenuApi.closeContextMenu(); },
|
||||
|
||||
textSelection: "",
|
||||
favoriteableType: null,
|
||||
favoriteableId: null,
|
||||
favoriteableName: null,
|
||||
itemHref: undefined,
|
||||
itemSrc: undefined,
|
||||
itemSafeSrc: undefined,
|
||||
itemTextContent: undefined,
|
||||
});
|
||||
}
|
||||
|
||||
migratePluginSettings("FullSearchContext", "SearchReply");
|
||||
export default definePlugin({
|
||||
name: "FullSearchContext",
|
||||
description: "Makes the message context menu in message search results have all options you'd expect",
|
||||
authors: [Devs.Ven, Devs.Aria],
|
||||
|
||||
patches: [{
|
||||
find: "onClick:this.handleMessageClick,",
|
||||
replacement: {
|
||||
match: /this(?=\.handleContextMenu\(\i,\i\))/,
|
||||
replace: "$self"
|
||||
}
|
||||
}],
|
||||
|
||||
handleContextMenu(event: MouseEvent, message: MessageRecord) {
|
||||
const channel = ChannelStore.getChannel(message.channel_id);
|
||||
if (!channel) return;
|
||||
|
||||
event.stopPropagation();
|
||||
|
||||
ContextMenuApi.openContextMenu(event, contextMenuProps => (
|
||||
<MessageMenu
|
||||
message={message}
|
||||
channel={channel}
|
||||
onHeightUpdate={contextMenuProps.onHeightUpdate}
|
||||
/>
|
||||
));
|
||||
}
|
||||
});
|
6
src/plugins/searchReply/README.md
Normal file
6
src/plugins/searchReply/README.md
Normal file
|
@ -0,0 +1,6 @@
|
|||
# SearchReply
|
||||
|
||||
Adds a reply button to search results.
|
||||
|
||||
![the plugin in action](https://github.com/Vendicated/Vencord/assets/45497981/07e741d3-0f97-4e5c-82b0-80712ecf2cbb)
|
||||
|
74
src/plugins/searchReply/index.tsx
Normal file
74
src/plugins/searchReply/index.tsx
Normal file
|
@ -0,0 +1,74 @@
|
|||
/*
|
||||
* 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 <https://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
import { findGroupChildrenByChildId, type NavContextMenuPatchCallback } from "@api/ContextMenu";
|
||||
import { ReplyIcon } from "@components/Icons";
|
||||
import { Devs } from "@utils/constants";
|
||||
import definePlugin from "@utils/types";
|
||||
import type { MessageRecord } from "@vencord/discord-types";
|
||||
import { findByCodeLazy } from "@webpack";
|
||||
import { ChannelStore, i18n, Menu, Permissions, PermissionStore, SelectedChannelStore } from "@webpack/common";
|
||||
|
||||
const replyToMessage = findByCodeLazy(".TEXTAREA_FOCUS)", "showMentionToggle:");
|
||||
|
||||
const messageContextMenuPatch = ((children, { message }: { message: MessageRecord; }) => {
|
||||
// make sure the message is in the selected channel
|
||||
if (SelectedChannelStore.getChannelId() !== message.channel_id) return;
|
||||
const channel = ChannelStore.getChannel(message.channel_id);
|
||||
if (!channel) return;
|
||||
if (!channel.isPrivate() && !PermissionStore.can(Permissions.SEND_MESSAGES, channel)) return;
|
||||
|
||||
// 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");
|
||||
dmGroup.splice(pinIndex + 1, 0, (
|
||||
<Menu.MenuItem
|
||||
id="reply"
|
||||
label={i18n.Messages.MESSAGE_ACTION_REPLY}
|
||||
icon={ReplyIcon}
|
||||
action={e => { replyToMessage(channel, message, e); }}
|
||||
/>
|
||||
));
|
||||
return;
|
||||
}
|
||||
|
||||
// servers
|
||||
const serverGroup = findGroupChildrenByChildId("mark-unread", children);
|
||||
if (serverGroup && !serverGroup.some(child => child?.props?.id === "reply")) {
|
||||
serverGroup.unshift((
|
||||
<Menu.MenuItem
|
||||
id="reply"
|
||||
label={i18n.Messages.MESSAGE_ACTION_REPLY}
|
||||
icon={ReplyIcon}
|
||||
action={e => { replyToMessage(channel, message, e); }}
|
||||
/>
|
||||
));
|
||||
return;
|
||||
}
|
||||
}) satisfies NavContextMenuPatchCallback;
|
||||
|
||||
|
||||
export default definePlugin({
|
||||
name: "SearchReply",
|
||||
description: "Adds a reply button to search results",
|
||||
authors: [Devs.Aria],
|
||||
contextMenus: {
|
||||
"message": messageContextMenuPatch
|
||||
}
|
||||
});
|
|
@ -105,7 +105,7 @@ function VoiceChannelTooltip({ channel }: VoiceChannelTooltipProps) {
|
|||
<UserSummaryItem
|
||||
users={users}
|
||||
renderIcon={false}
|
||||
max={14}
|
||||
max={7}
|
||||
size={18}
|
||||
/>
|
||||
</div>
|
||||
|
@ -170,7 +170,6 @@ export const VoiceChannelIndicator = ErrorBoundary.wrap(({ userId }: VoiceChanne
|
|||
<Tooltip
|
||||
text={<VoiceChannelTooltip channel={channel} />}
|
||||
tooltipClassName={cl("tooltip-container")}
|
||||
tooltipContentClassName={cl("tooltip-content")}
|
||||
>
|
||||
{props =>
|
||||
isLocked ?
|
||||
|
|
|
@ -32,7 +32,7 @@ const settings = definePluginSettings({
|
|||
default: true,
|
||||
restartNeeded: true
|
||||
},
|
||||
showInMemberList: {
|
||||
showInVoiceMemberList: {
|
||||
type: OptionType.BOOLEAN,
|
||||
description: "Show a user's Voice Channel indicator in the member and DMs list",
|
||||
default: true,
|
||||
|
@ -82,12 +82,12 @@ export default definePlugin({
|
|||
match: /\.subtext,children:.+?}\)\]}\)(?=])/,
|
||||
replace: "$&,$self.VoiceChannelIndicator({userId:arguments[0]?.user?.id})"
|
||||
},
|
||||
predicate: () => settings.store.showInMemberList
|
||||
predicate: () => settings.store.showInVoiceMemberList
|
||||
}
|
||||
],
|
||||
|
||||
start() {
|
||||
if (settings.store.showInMemberList) {
|
||||
if (settings.store.showInVoiceMemberList) {
|
||||
// eslint-disable-next-line @typescript-eslint/no-unnecessary-condition
|
||||
addDecorator("UserVoiceShow", ({ user }) => user == null ? null : <VoiceChannelIndicator userId={user.id} />);
|
||||
}
|
||||
|
|
|
@ -15,13 +15,7 @@
|
|||
}
|
||||
|
||||
.vc-uvs-tooltip-container {
|
||||
max-width: 300px;
|
||||
}
|
||||
|
||||
.vc-uvs-tooltip-content {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
gap: 6px;
|
||||
max-width: 200px;
|
||||
}
|
||||
|
||||
.vc-uvs-guild-name {
|
||||
|
@ -37,5 +31,7 @@
|
|||
|
||||
.vc-uvs-vc-members {
|
||||
display: flex;
|
||||
margin: 8px 0;
|
||||
flex-direction: row;
|
||||
gap: 6px;
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue