mirror of
https://github.com/Equicord/Equicord.git
synced 2025-06-08 14:13:01 -04:00
Fix ImplicitRelationships
This commit is contained in:
parent
d19b0aeb5b
commit
5936e74e7f
3 changed files with 7 additions and 11 deletions
|
@ -19,17 +19,11 @@
|
||||||
import { definePluginSettings } from "@api/Settings";
|
import { definePluginSettings } from "@api/Settings";
|
||||||
import { Devs } from "@utils/constants";
|
import { Devs } from "@utils/constants";
|
||||||
import definePlugin, { OptionType } from "@utils/types";
|
import definePlugin, { OptionType } from "@utils/types";
|
||||||
import { findByPropsLazy, findStoreLazy } from "@webpack";
|
import { findStoreLazy } from "@webpack";
|
||||||
import { ChannelStore, FluxDispatcher, GuildStore, RelationshipStore, SnowflakeUtils, UserStore } from "@webpack/common";
|
import { ChannelStore, Constants, FluxDispatcher, GuildStore, RelationshipStore, SnowflakeUtils, UserStore } from "@webpack/common";
|
||||||
import { Settings } from "Vencord";
|
import { Settings } from "Vencord";
|
||||||
|
|
||||||
const UserAffinitiesStore = findStoreLazy("UserAffinitiesStore");
|
const UserAffinitiesStore = findStoreLazy("UserAffinitiesStore");
|
||||||
const { FriendsSections } = findByPropsLazy("FriendsSections");
|
|
||||||
|
|
||||||
interface UserAffinity {
|
|
||||||
user_id: string;
|
|
||||||
affinity: number;
|
|
||||||
}
|
|
||||||
|
|
||||||
export default definePlugin({
|
export default definePlugin({
|
||||||
name: "ImplicitRelationships",
|
name: "ImplicitRelationships",
|
||||||
|
@ -70,7 +64,7 @@ export default definePlugin({
|
||||||
},
|
},
|
||||||
// Piggyback relationship fetch
|
// Piggyback relationship fetch
|
||||||
{
|
{
|
||||||
find: ".fetchRelationships()",
|
find: '"FriendsStore',
|
||||||
replacement: {
|
replacement: {
|
||||||
match: /(\i\.\i)\.fetchRelationships\(\)/,
|
match: /(\i\.\i)\.fetchRelationships\(\)/,
|
||||||
// This relationship fetch is actually completely useless, but whatevs
|
// This relationship fetch is actually completely useless, but whatevs
|
||||||
|
@ -182,6 +176,6 @@ export default definePlugin({
|
||||||
},
|
},
|
||||||
|
|
||||||
start() {
|
start() {
|
||||||
FriendsSections.IMPLICIT = "IMPLICIT";
|
Constants.FriendsSections.IMPLICIT = "IMPLICIT";
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
1
src/webpack/common/types/utils.d.ts
vendored
1
src/webpack/common/types/utils.d.ts
vendored
|
@ -219,4 +219,5 @@ export interface IconUtils {
|
||||||
export interface Constants {
|
export interface Constants {
|
||||||
Endpoints: Record<string, any>;
|
Endpoints: Record<string, any>;
|
||||||
UserFlags: Record<string, number>;
|
UserFlags: Record<string, number>;
|
||||||
|
FriendsSections: Record<string, string>;
|
||||||
}
|
}
|
||||||
|
|
|
@ -40,7 +40,8 @@ waitFor(["dispatchToLastSubscribed"], m => ComponentDispatch = m);
|
||||||
|
|
||||||
export const Constants: t.Constants = mapMangledModuleLazy('ME:"/users/@me"', {
|
export const Constants: t.Constants = mapMangledModuleLazy('ME:"/users/@me"', {
|
||||||
Endpoints: filters.byProps("USER", "ME"),
|
Endpoints: filters.byProps("USER", "ME"),
|
||||||
UserFlags: filters.byProps("STAFF", "SPAMMER")
|
UserFlags: filters.byProps("STAFF", "SPAMMER"),
|
||||||
|
FriendsSections: m => m.PENDING === "PENDING" && m.ADD_FRIEND
|
||||||
});
|
});
|
||||||
|
|
||||||
export const RestAPI: t.RestAPI = findLazy(m => typeof m === "object" && m.del && m.put);
|
export const RestAPI: t.RestAPI = findLazy(m => typeof m === "object" && m.del && m.put);
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue