Skip to content

Commit

Permalink
Merge pull request #260 from smoogipoo/fix-error-on-self-friend
Browse files Browse the repository at this point in the history
Fix connection errors on self-friends
  • Loading branch information
bdach authored Jan 16, 2025
2 parents 8987732 + 05b30c0 commit 2d51d49
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions osu.Server.Spectator/Hubs/Metadata/MetadataHub.cs
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,11 @@ public override async Task OnConnectedAsync()
{
foreach (int friendId in await db.GetUserFriendsAsync(usage.Item.UserId))
{
// Once upon a time users were able to add themselves as friends.
// This errors during the state retrieval below, so let's not support it.
if (friendId == usage.Item.UserId)
continue;

await Groups.AddToGroupAsync(Context.ConnectionId, FRIEND_PRESENCE_WATCHERS_GROUP(friendId));

// Check if the friend is online, and if they are, broadcast to the connected user.
Expand Down

0 comments on commit 2d51d49

Please sign in to comment.