mirror of
https://github.com/YuzuZensai/VRC-Circle.git
synced 2026-09-13 19:08:52 +00:00
🐛 fix: don't mark self online on offline location events
This commit is contained in:
@@ -139,8 +139,15 @@ function subscribe(vrc: VRChat & Pipeline): void {
|
|||||||
const d = asRecord(data);
|
const d = asRecord(data);
|
||||||
const id = (d.userId ?? userOf(data).id) as string | undefined;
|
const id = (d.userId ?? userOf(data).id) as string | undefined;
|
||||||
if (!id) return;
|
if (!id) return;
|
||||||
|
const loc = d.location as string | undefined;
|
||||||
const fromUser = patchFromUser(userOf(data)) ?? { id };
|
const fromUser = patchFromUser(userOf(data)) ?? { id };
|
||||||
entityStore.upsert({ ...fromUser, id, location: d.location as string, state: "online" });
|
const offline = !loc || loc.startsWith("offline");
|
||||||
|
entityStore.upsert({
|
||||||
|
...fromUser,
|
||||||
|
id,
|
||||||
|
location: offline ? "offline" : loc,
|
||||||
|
state: offline ? "offline" : "online",
|
||||||
|
});
|
||||||
};
|
};
|
||||||
vrc.on("friend-location", location);
|
vrc.on("friend-location", location);
|
||||||
vrc.on("user-location", location);
|
vrc.on("user-location", location);
|
||||||
|
|||||||
Reference in New Issue
Block a user