feat: show orange users that are in the same instance (#1138)

* feat: show orange users that are in the same instance

* misc: simplify traveling check for same instance list

---------

Co-authored-by: Natsumi <11171153+Natsumi-sama@users.noreply.github.com>
This commit is contained in:
góngo
2025-02-16 19:26:10 -05:00
committed by GitHub
parent 107b62889d
commit 0ae756d2eb

View File

@@ -23366,13 +23366,27 @@ console.log(`isLinux: ${LINUX}`);
const allFriends = [...this.vipFriends, ...this.onlineFriends];
allFriends.forEach((friend) => {
if (!friend.ref?.$location.isRealInstance) return;
let locationTag;
const key = friend.ref.$location.tag;
if (!friendsList[key]) {
friendsList[key] = [];
if (friend.ref?.$location.isRealInstance) {
locationTag = friend.ref.$location.tag;
} else if (this.lastLocation.friendList.has(friend.id)) {
let $location = $utils.parseLocation(this.lastLocation.location);
if ($location.isRealInstance) {
if ($location.tag === 'private') {
locationTag = this.lastLocation.name;
} else {
locationTag = $location.tag;
}
}
}
friendsList[key].push(friend);
if (!locationTag) return;
if (!friendsList[locationTag]) {
friendsList[locationTag] = [];
}
friendsList[locationTag].push(friend);
});
const sortedFriendsList = [];
@@ -23439,6 +23453,9 @@ console.log(`isLinux: ${LINUX}`);
if ($utils.isRealInstance(friend.ref?.travelingToLocation)) {
return friend.ref.travelingToLocation;
}
if (this.lastLocation.friendList.has(friend.id)) {
return this.lastLocation.name;
}
}
return friendsArr[0].ref?.location;
};