diff --git a/classes/CSteamUser.js b/classes/CSteamUser.js index 72f662d..75a1302 100644 --- a/classes/CSteamUser.js +++ b/classes/CSteamUser.js @@ -91,11 +91,11 @@ function CSteamUser(community, userData, customurl) { } } -CSteamUser.prototype.getAvatarURL = function(size, protocol) { +CSteamUser.getAvatarURL = function(hash, size, protocol) { size = size || ''; protocol = protocol || 'http://'; - var url = protocol + "steamcdn-a.akamaihd.net/steamcommunity/public/images/avatars/" + this.avatarHash.substring(0, 2) + "/" + this.avatarHash; + var url = protocol + "steamcdn-a.akamaihd.net/steamcommunity/public/images/avatars/" + hash.substring(0, 2) + "/" + hash; if(size == 'full' || size == 'medium') { return url + "_" + size + ".jpg"; } else { @@ -103,6 +103,10 @@ CSteamUser.prototype.getAvatarURL = function(size, protocol) { } }; +CSteamUser.prototype.getAvatarURL = function(size, protocol) { + return CSteamUser.getAvatarURL(this.avatarHash, size, protocol); +}; + CSteamUser.prototype.addFriend = function(callback) { this._community.request.post('https://steamcommunity.com/actions/AddFriendAjax', {"form": {"accept_invite": 0, "sessionID": this._community.getSessionID(), "steamid": this.steamID.toString()}}, function(err, response, body) { if(!callback) {