mirror of
https://github.com/Equicord/Equicord.git
synced 2025-06-07 21:53:04 -04:00
parent
d1f9476faa
commit
2db000c4ce
6 changed files with 20 additions and 20 deletions
|
@ -4,15 +4,28 @@
|
||||||
* SPDX-License-Identifier: GPL-3.0-or-later
|
* SPDX-License-Identifier: GPL-3.0-or-later
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
import { definePluginSettings } from "@api/Settings";
|
||||||
import { EquicordDevs } from "@utils/constants";
|
import { EquicordDevs } from "@utils/constants";
|
||||||
import { sendMessage } from "@utils/discord";
|
import { sendMessage } from "@utils/discord";
|
||||||
import definePlugin from "@utils/types";
|
import definePlugin, { OptionType } from "@utils/types";
|
||||||
import { Message } from "discord-types/general";
|
import { Message } from "discord-types/general";
|
||||||
|
|
||||||
|
const settings = definePluginSettings({
|
||||||
|
textHeader: {
|
||||||
|
description: "What header to preface text with",
|
||||||
|
type: OptionType.SELECT,
|
||||||
|
options: [
|
||||||
|
{ label: ">", value: ">", default: true },
|
||||||
|
{ label: "-#", value: "-#" }
|
||||||
|
]
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
export default definePlugin({
|
export default definePlugin({
|
||||||
name: "ForwardAnywhere",
|
name: "ForwardAnywhere",
|
||||||
description: "If a forward fails send it as a normal message also allows nsfw forwards",
|
description: "If a forward fails send it as a normal message also allows nsfw forwards",
|
||||||
authors: [EquicordDevs.thororen],
|
authors: [EquicordDevs.thororen],
|
||||||
|
settings,
|
||||||
patches: [
|
patches: [
|
||||||
{
|
{
|
||||||
find: "#{intl::MESSAGE_FORWARDING_NSFW_NOT_ALLOWED}",
|
find: "#{intl::MESSAGE_FORWARDING_NSFW_NOT_ALLOWED}",
|
||||||
|
@ -32,7 +45,7 @@ export default definePlugin({
|
||||||
sendForward(channels: any, message: Message) {
|
sendForward(channels: any, message: Message) {
|
||||||
for (const c of channels) {
|
for (const c of channels) {
|
||||||
sendMessage(c.id, {
|
sendMessage(c.id, {
|
||||||
content: `${message.content}\n\n> Forwarded from <#${message.channel_id}>`
|
content: `${message.content}\n${settings.store.textHeader} Forwarded from <#${message.channel_id}>`
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -76,7 +76,7 @@ export default definePlugin({
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
find: "action:\"PRESS_APP_CONNECTION\"",
|
find: "#{intl::CONNECTIONS}),scrollIntoView",
|
||||||
replacement: {
|
replacement: {
|
||||||
match: /(?<=user:(\i).{0,15}displayProfile:(\i).*?CONNECTIONS.{0,100}\}\)\}\))/,
|
match: /(?<=user:(\i).{0,15}displayProfile:(\i).*?CONNECTIONS.{0,100}\}\)\}\))/,
|
||||||
replace: ",$self.ProfilePopoutComponent({ user: $1, displayProfile: $2 })"
|
replace: ",$self.ProfilePopoutComponent({ user: $1, displayProfile: $2 })"
|
||||||
|
|
|
@ -27,11 +27,6 @@ let NotificationQueue: JSX.Element[] = [];
|
||||||
let notificationID = 0;
|
let notificationID = 0;
|
||||||
let RootContainer: Root;
|
let RootContainer: Root;
|
||||||
|
|
||||||
/**
|
|
||||||
* getNotificationContainer()
|
|
||||||
* Gets the root container for the notifications, creating it if it doesn't exist.
|
|
||||||
* @returns {Root} The root DOM container.
|
|
||||||
*/
|
|
||||||
function getNotificationContainer() {
|
function getNotificationContainer() {
|
||||||
if (!RootContainer) {
|
if (!RootContainer) {
|
||||||
const container = document.createElement("div");
|
const container = document.createElement("div");
|
||||||
|
|
|
@ -32,7 +32,7 @@ export default definePlugin({
|
||||||
},
|
},
|
||||||
// User Profile Modal
|
// User Profile Modal
|
||||||
{
|
{
|
||||||
find: "action:\"PRESS_APP_CONNECTION\"",
|
find: "#{intl::CONNECTIONS}),scrollIntoView",
|
||||||
replacement: {
|
replacement: {
|
||||||
match: /#{intl::USER_PROFILE_MEMBER_SINCE}\),.{0,100}userId:(\i\.id),.{0,100}}\)}\),/,
|
match: /#{intl::USER_PROFILE_MEMBER_SINCE}\),.{0,100}userId:(\i\.id),.{0,100}}\)}\),/,
|
||||||
replace: "$&,$self.FriendsSinceComponent({userId:$1,isSidebar:false}),"
|
replace: "$&,$self.FriendsSinceComponent({userId:$1,isSidebar:false}),"
|
||||||
|
|
|
@ -17,8 +17,7 @@
|
||||||
*/
|
*/
|
||||||
|
|
||||||
import { Settings, SettingsStore } from "@api/Settings";
|
import { Settings, SettingsStore } from "@api/Settings";
|
||||||
import { ThemeStore } from "@webpack/common";
|
import { findByCodeLazy } from "@webpack";
|
||||||
|
|
||||||
|
|
||||||
let style: HTMLStyleElement;
|
let style: HTMLStyleElement;
|
||||||
let themesStyle: HTMLStyleElement;
|
let themesStyle: HTMLStyleElement;
|
||||||
|
@ -62,6 +61,7 @@ async function initThemes() {
|
||||||
|
|
||||||
const enabledlinks: string[] = [...enabledThemeLinks];
|
const enabledlinks: string[] = [...enabledThemeLinks];
|
||||||
// "darker" and "midnight" both count as dark
|
// "darker" and "midnight" both count as dark
|
||||||
|
const ThemeStore = findByCodeLazy("ThemeStore");
|
||||||
const activeTheme = ThemeStore.theme === "light" ? "light" : "dark";
|
const activeTheme = ThemeStore.theme === "light" ? "light" : "dark";
|
||||||
|
|
||||||
const links = enabledlinks
|
const links = enabledlinks
|
||||||
|
@ -99,14 +99,6 @@ document.addEventListener("DOMContentLoaded", () => {
|
||||||
SettingsStore.addChangeListener("enabledThemeLinks", initThemes);
|
SettingsStore.addChangeListener("enabledThemeLinks", initThemes);
|
||||||
SettingsStore.addChangeListener("enabledThemes", initThemes);
|
SettingsStore.addChangeListener("enabledThemes", initThemes);
|
||||||
|
|
||||||
let currentTheme = ThemeStore.theme;
|
|
||||||
ThemeStore.addChangeListener(() => {
|
|
||||||
if (currentTheme === ThemeStore.theme) return;
|
|
||||||
|
|
||||||
currentTheme = ThemeStore.theme;
|
|
||||||
initThemes();
|
|
||||||
});
|
|
||||||
|
|
||||||
if (!IS_WEB)
|
if (!IS_WEB)
|
||||||
VencordNative.quickCss.addThemeChangeListener(initThemes);
|
VencordNative.quickCss.addThemeChangeListener(initThemes);
|
||||||
});
|
});
|
||||||
|
|
|
@ -16,7 +16,7 @@
|
||||||
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
import { findByPropsLazy, waitFor } from "@webpack";
|
import { findByPropsLazy, waitFor } from "../webpack";
|
||||||
|
|
||||||
export let React: typeof import("react");
|
export let React: typeof import("react");
|
||||||
export let useState: typeof React.useState;
|
export let useState: typeof React.useState;
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue