diff --git a/packages/discord-types/src/stores/RelationshipStore.d.ts b/packages/discord-types/src/stores/RelationshipStore.d.ts index 5874a85fc..73fbd077a 100644 --- a/packages/discord-types/src/stores/RelationshipStore.d.ts +++ b/packages/discord-types/src/stores/RelationshipStore.d.ts @@ -1,38 +1,53 @@ import { FluxStore } from ".."; +export const enum RelationshipType { + NONE = 0, + FRIEND = 1, + BLOCKED = 2, + INCOMING_REQUEST = 3, + OUTGOING_REQUEST = 4, + IMPLICIT = 5, + SUGGESTION = 6 +} + export class RelationshipStore extends FluxStore { - getFriendIDs(): string[]; - getIgnoredIDs(): string[]; getBlockedIDs(): string[]; getBlockedOrIgnoredIDs(): string[]; - - getPendingCount(): number; - getRelationshipCount(): number; - - /** Related to friend nicknames. */ - getNickname(userId: string): string; - - /** @returns Enum value from constants.RelationshipTypes */ - getRelationshipType(userId: string): number; - isBlockedOrIgnored(userId: string): boolean; - isBlockedOrIgnoredForMessage(userId: string): boolean; - isBlocked(userId: string): boolean; - isBlockedForMessage(userId: string): boolean; - isFriend(userId: string): boolean; - isIgnored(userId: string): boolean; - isIgnoredForMessage(userId: string): boolean; - isUnfilteredPendingIncoming(userId: string): boolean; - isSpam(userId): boolean; - getSince(userId: string): string; - getSinces(): Record; - getFriendCount(): number; - getRelationshipCount(): number; + getFriendIDs(): string[]; + getIgnoredIDs(): string[]; + + getMutableRelationships(): Map; + getNickname(userId: string): string; + getOriginApplicationId(applicationId: string): string; getOutgoingCount(): number; getPendingCount(): number; getPendingIgnoredCount(): number; - getSpamCount(): number; + getRelationshipCount(): number; - getMutableRelationships(): Map; + /** @returns Enum value from constants.RelationshipTypes */ + getRelationshipType(userId: string): RelationshipType; + getSince(userId: string): string; + getSinces(): Record; + getSpamCount(): number; getVersion(): number; + getPendingCount(): number; + getRelationshipCount(): number; + + isBlocked(userId: string): boolean; + isBlockedForMessage(userId: string): boolean; + + /** + * @see {@link isBlocked} + * @see {@link isIgnored} + */ + isBlockedOrIgnored(userId: string): boolean; + isBlockedOrIgnoredForMessage(userId: string): boolean; + + isFriend(userId: string): boolean; + isIgnored(userId: string): boolean; + isIgnoredForMessage(userId: string): boolean; + isStranger(userId: string): boolean; + isSpam(userId: string): boolean; + isUnfilteredPendingIncoming(userId: string): boolean; } diff --git a/src/equicordplugins/toastNotifications/index.tsx b/src/equicordplugins/toastNotifications/index.tsx index 006be4dce..b2218180b 100644 --- a/src/equicordplugins/toastNotifications/index.tsx +++ b/src/equicordplugins/toastNotifications/index.tsx @@ -19,14 +19,14 @@ import { definePluginSettings } from "@api/Settings"; import { EquicordDevs } from "@utils/constants"; import definePlugin, { makeRange, OptionType } from "@utils/types"; -import { Channel, Message, User } from "@vencord/discord-types"; +import { Channel, Message, RelationshipType, User } from "@vencord/discord-types"; import { MessageType } from "@vencord/discord-types/enums"; import { findByPropsLazy, findStore } from "@webpack"; import { Button, ChannelStore, GuildRoleStore, NavigationRouter, RelationshipStore, SelectedChannelStore, StreamerModeStore, UserStore } from "@webpack/common"; import { ReactNode } from "react"; import { NotificationData, showNotification } from "./components/Notifications"; -import { RelationshipType, StreamingTreatment } from "./types"; +import { StreamingTreatment } from "./types"; let ignoredUsers: string[] = []; let notifyFor: string[] = []; diff --git a/src/equicordplugins/toastNotifications/types.ts b/src/equicordplugins/toastNotifications/types.ts index 4959fe853..6081eac0f 100644 --- a/src/equicordplugins/toastNotifications/types.ts +++ b/src/equicordplugins/toastNotifications/types.ts @@ -16,13 +16,6 @@ * along with this program. If not, see . */ -export const enum RelationshipType { - FRIEND = 1, - BLOCKED = 2, - INCOMING_REQUEST = 3, - OUTGOING_REQUEST = 4, -} - export const enum StreamingTreatment { NORMAL = 0, NO_CONTENT = 1, diff --git a/src/plugins/relationshipNotifier/functions.ts b/src/plugins/relationshipNotifier/functions.ts index 19f360866..688631a87 100644 --- a/src/plugins/relationshipNotifier/functions.ts +++ b/src/plugins/relationshipNotifier/functions.ts @@ -17,11 +17,12 @@ */ import { getUniqueUsername, openUserProfile } from "@utils/discord"; +import { RelationshipType } from "@vencord/discord-types"; import { ChannelType } from "@vencord/discord-types/enums"; import { UserUtils } from "@webpack/common"; import settings from "./settings"; -import { ChannelDelete, GuildDelete, RelationshipRemove, RelationshipType } from "./types"; +import { ChannelDelete, GuildDelete, RelationshipRemove } from "./types"; import { deleteGroup, deleteGuild, getGroup, getGuild, GuildAvailabilityStore, notify } from "./utils"; let manuallyRemovedFriend: string | undefined; diff --git a/src/plugins/relationshipNotifier/types.ts b/src/plugins/relationshipNotifier/types.ts index 5d3d12d46..914f1a43b 100644 --- a/src/plugins/relationshipNotifier/types.ts +++ b/src/plugins/relationshipNotifier/types.ts @@ -51,10 +51,3 @@ export interface SimpleGuild { name: string; iconURL?: string; } - -export const enum RelationshipType { - FRIEND = 1, - BLOCKED = 2, - INCOMING_REQUEST = 3, - OUTGOING_REQUEST = 4, -} diff --git a/src/plugins/relationshipNotifier/utils.ts b/src/plugins/relationshipNotifier/utils.ts index 206cb63c7..187248d9a 100644 --- a/src/plugins/relationshipNotifier/utils.ts +++ b/src/plugins/relationshipNotifier/utils.ts @@ -20,13 +20,13 @@ import * as DataStore from "@api/DataStore"; import { popNotice, showNotice } from "@api/Notices"; import { showNotification } from "@api/Notifications"; import { getUniqueUsername, openUserProfile } from "@utils/discord"; -import { FluxStore } from "@vencord/discord-types"; +import { FluxStore, RelationshipType } from "@vencord/discord-types"; import { ChannelType } from "@vencord/discord-types/enums"; import { findStoreLazy } from "@webpack"; import { ChannelStore, GuildMemberStore, GuildStore, RelationshipStore, UserStore, UserUtils } from "@webpack/common"; import settings from "./settings"; -import { RelationshipType, SimpleGroupChannel, SimpleGuild } from "./types"; +import { SimpleGroupChannel, SimpleGuild } from "./types"; export const GuildAvailabilityStore = findStoreLazy("GuildAvailabilityStore") as FluxStore & { totalGuilds: number; diff --git a/src/webpack/common/stores.ts b/src/webpack/common/stores.ts index 0b505faa8..381bee85c 100644 --- a/src/webpack/common/stores.ts +++ b/src/webpack/common/stores.ts @@ -61,7 +61,6 @@ export let SpellCheckStore: t.SpellCheckStore; export let UploadAttachmentStore: t.UploadAttachmentStore; export let OverridePremiumTypeStore: t.OverridePremiumTypeStore; - /** * @see jsdoc of {@link t.useStateFromStores} */