Fix ImplicitRelationships, RelationshipNotifier & ServerInfo

This commit is contained in:
Vendicated 2025-06-17 21:58:12 +02:00
parent 3a1e17e04d
commit 8d97863db6
No known key found for this signature in database
GPG key ID: D66986BAF75ECF18
7 changed files with 30 additions and 26 deletions

View file

@ -46,11 +46,7 @@ export let SelectedChannelStore: Stores.SelectedChannelStore & t.FluxStore;
export let SelectedGuildStore: t.FluxStore & Record<string, any>;
export let ChannelStore: Stores.ChannelStore & t.FluxStore;
export let GuildMemberStore: Stores.GuildMemberStore & t.FluxStore;
export let RelationshipStore: Stores.RelationshipStore & t.FluxStore & {
/** Get the date (as a string) that the relationship was created */
getSince(userId: string): string;
isIgnored(userId: string): boolean;
};
export let RelationshipStore: t.RelationshipStore;
export let EmojiStore: t.EmojiStore;
export let ThemeStore: t.ThemeStore;

View file

@ -233,3 +233,20 @@ export type useStateFromStores = <T>(
dependencies?: any,
isEqual?: (old: T, newer: T) => boolean
) => T;
export class RelationshipStore extends FluxStore {
getFriendIDs(): string[];
/** Related to friend nicknames experiment. */
getNickname(userId: string): string;
getPendingCount(): number;
getRelationshipCount(): number;
/** @returns Enum value from constants.RelationshipTypes */
getRelationshipType(userId: string): number;
/** @returns Format: [userId: Enum value from constants.RelationshipTypes] */
getMutableRelationships(): Record<number, number>;
isBlocked(userId: string): boolean;
isFriend(userId: string): boolean;
getSince(userId: string): string;
isIgnored(userId: string): boolean;
}