feat: FriendList context menu

This commit is contained in:
2026-06-28 19:02:25 +07:00
parent 07ce777bb9
commit e10e002593
12 changed files with 352 additions and 25 deletions
+21
View File
@@ -3,6 +3,7 @@ import { requireActiveClient } from "./client";
import { toUserProfile } from "./mappers";
import { currentUser, userCache } from "./userService";
import { cacheKeys, policies } from "../cache/policies";
import { entityStore } from "../store/entityStore";
const order: Record<string, number> = {
"join me": 0,
@@ -35,3 +36,23 @@ export async function listFriends(): Promise<UserProfile[]> {
);
});
}
export async function unfriend(userId: string): Promise<void> {
const vrc = requireActiveClient();
await vrc.unfriend({ path: { userId }, throwOnError: true });
entityStore.removeFriend(userId);
}
export async function inviteUser(userId: string, instanceLocation: string): Promise<void> {
const vrc = requireActiveClient();
await vrc.inviteUser({
path: { userId },
body: { instanceId: instanceLocation },
throwOnError: true,
});
}
export async function requestInvite(userId: string): Promise<void> {
const vrc = requireActiveClient();
await vrc.requestInvite({ path: { userId }, throwOnError: true });
}