mirror of
https://github.com/YuzuZensai/VRC-Circle.git
synced 2026-09-13 19:08:52 +00:00
✨ feat: Add friend functionality and refactor user context menus
This commit is contained in:
@@ -37,6 +37,7 @@ const handlers = {
|
||||
"user:search": (query) => guard(() => users.searchUsers(query)),
|
||||
|
||||
"friends:list": () => guard(() => friends.listFriends()),
|
||||
"friends:add": (userId) => guard(() => friends.addFriend(userId)),
|
||||
"friends:unfriend": (userId) => guard(() => friends.unfriend(userId)),
|
||||
"friends:invite": (p) => guard(() => friends.inviteUser(p.userId, p.instanceLocation)),
|
||||
"friends:requestInvite": (userId) => guard(() => friends.requestInvite(userId)),
|
||||
|
||||
@@ -37,6 +37,11 @@ export async function listFriends(): Promise<UserProfile[]> {
|
||||
});
|
||||
}
|
||||
|
||||
export async function addFriend(userId: string): Promise<void> {
|
||||
const vrc = requireActiveClient();
|
||||
await vrc.friend({ path: { userId }, throwOnError: true });
|
||||
}
|
||||
|
||||
export async function unfriend(userId: string): Promise<void> {
|
||||
const vrc = requireActiveClient();
|
||||
await vrc.unfriend({ path: { userId }, throwOnError: true });
|
||||
|
||||
Reference in New Issue
Block a user