PrivateChannelsStore -> ChannelActionCreators
Some checks are pending
Test / Test (push) Waiting to run

This commit is contained in:
thororen1234 2025-06-17 00:34:25 -04:00
parent 8d2984442c
commit 727abb429e
No known key found for this signature in database
2 changed files with 6 additions and 6 deletions

View file

@ -11,7 +11,7 @@ import { Devs } from "@utils/constants";
import { getCurrentChannel } from "@utils/discord";
import { Logger } from "@utils/Logger";
import definePlugin, { OptionType } from "@utils/types";
import { ChannelStore, Menu, MessageStore, NavigationRouter, PresenceStore, PrivateChannelsStore, UserStore, WindowStore } from "@webpack/common";
import { ChannelActionCreators, ChannelStore, Menu, MessageStore, NavigationRouter, PresenceStore, UserStore, WindowStore } from "@webpack/common";
import type { Message } from "discord-types/general";
import { JSX } from "react";
@ -163,7 +163,7 @@ export default definePlugin({
if ((settings.store.guilds.split(", ").includes(guildId) || settings.store.channels.split(", ").includes(channelId)) && mentioned) {
await showNotification(message, guildId);
} else if (settings.store.users.split(", ").includes(message.author.id)) {
const userChannelId = await PrivateChannelsStore.getOrEnsurePrivateChannel(message.author.id);
const userChannelId = await ChannelActionCreators.getOrEnsurePrivateChannel(message.author.id);
if (channelId === userChannelId || (mentioned && settings.store.allowOutsideOfDms === true)) {
await showNotification(message, guildId);
}

View file

@ -16,8 +16,8 @@ import { Devs, EquicordDevs } from "@utils/constants";
import { sleep } from "@utils/misc";
import definePlugin from "@utils/types";
import {
FluxDispatcher, MessageActions,
PrivateChannelsStore, RestAPI,
ChannelActionCreators,
FluxDispatcher, MessageActions, RestAPI,
SnowflakeUtils,
useEffect, UserStore,
UserUtils, useState,
@ -201,7 +201,7 @@ export default definePlugin({
}
return;
}
const dmChannelId = await PrivateChannelsStore.getOrEnsurePrivateChannel(message.author.id);
const dmChannelId = await ChannelActionCreators.getOrEnsurePrivateChannel(message.author.id);
if (channelId !== dmChannelId) return;
const sender = await UserUtils.getUser(message.author.id).catch(() => null);
if (!sender) return;
@ -282,7 +282,7 @@ export default definePlugin({
// Send Temporary Message
async function sendTempMessage(recipientId: string, attachment: string, content: string, dm: boolean = true) {
if (recipientId === UserStore.getCurrentUser().id) return;
const channelId = dm ? await PrivateChannelsStore.getOrEnsurePrivateChannel(recipientId) : recipientId;
const channelId = dm ? await ChannelActionCreators.getOrEnsurePrivateChannel(recipientId) : recipientId;
if (attachment && attachment !== "") {
const upload = await new CloudUpload({
file: new File([new Blob([attachment])], "file.text", { type: "text/plain; charset=utf-8" }),