Added public static CSteamUser.getAvatarURL method

This commit is contained in:
Alexander Corn 2015-06-18 00:41:26 -04:00
parent e01d05c140
commit 1aa42b89f7

View File

@ -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) {