mirror of
https://github.com/YuzuZensai/VRC-Circle.git
synced 2026-09-14 03:10:01 +00:00
✨ feat: FriendList context menu
This commit is contained in:
@@ -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 });
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user