Unverified Commit ca5b31c3 authored by Simon Esposito's avatar Simon Esposito Committed by GitHub
Browse files

Do not import steam friends by default. (#560)

Fix steam friends API call argument.
parent 59ba1d53
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -8,6 +8,7 @@ The format is based on [keep a changelog](http://keepachangelog.com) and this pr
- Sort match listings to show newer created matches first by default.
- Improve status follow input validation and constraints.
- Build with Go 1.16.0 release.
- Do not import Steam friends by default on Steam authentication.

### Fixed
- Fix an issue in the js runtime that would prevent the matchmaker matched callback to function correctly.
+2 −2
Original line number Diff line number Diff line
@@ -653,8 +653,8 @@ func (s *ApiServer) AuthenticateSteam(ctx context.Context, in *api.AuthenticateS
	}

	// Import friends if requested.
	if in.Sync == nil || in.Sync.Value {
		_ = importSteamFriends(ctx, s.logger, s.db, s.router, s.socialClient, uuid.FromStringOrNil(dbUserID), dbUsername, in.Account.Token, steamID, false)
	if in.Sync != nil && in.Sync.Value {
		_ = importSteamFriends(ctx, s.logger, s.db, s.router, s.socialClient, uuid.FromStringOrNil(dbUserID), dbUsername, s.config.GetSocial().Steam.PublisherKey, steamID, false)
	}

	token, exp := generateToken(s.config, dbUserID, dbUsername, in.Account.Vars)
+1 −1
Original line number Diff line number Diff line
@@ -238,7 +238,7 @@ func (c *Client) GetFacebookFriends(ctx context.Context, accessToken string) ([]

// GetSteamFriends queries the Steam API for friends.
func (c *Client) GetSteamFriends(ctx context.Context, publisherKey, steamId string) ([]SteamProfile, error) {
	c.logger.Debug("Getting Steam friends", zap.String("publisherKey", publisherKey), zap.String("steamId", steamId))
	c.logger.Debug("Getting Steam friends", zap.String("steamId", steamId))

	path := fmt.Sprintf("https://api.steampowered.com/ISteamUser/GetFriendList/v0001/?key=%s&steamid=%s&relationship=friend", publisherKey, steamId)
	var steamFriends steamFriendsWrapper