From d84601e2567ed22e2dd9cca6a6325542e66bc67f Mon Sep 17 00:00:00 2001 From: Shaun Barratt Date: Fri, 15 Jan 2016 21:28:43 +0000 Subject: [PATCH] Adding the whitespace back (blame atom.io!) Converting spaces to tabs. --- classes/CSteamGroup.js | 16 ++++---- examples/edit-group-announcement.js | 60 ++++++++++++++--------------- 2 files changed, 38 insertions(+), 38 deletions(-) diff --git a/classes/CSteamGroup.js b/classes/CSteamGroup.js index 812f42b..2f74e7c 100644 --- a/classes/CSteamGroup.js +++ b/classes/CSteamGroup.js @@ -6,27 +6,27 @@ SteamCommunity.prototype.getSteamGroup = function(id, callback) { if(typeof id !== 'string' && !(typeof id === 'object' && id.__proto__ === SteamID.prototype)) { throw new Error("id parameter should be a group URL string or a SteamID object"); } - + if(typeof id === 'object' && (id.universe != SteamID.Universe.PUBLIC || id.type != SteamID.Type.CLAN)) { throw new Error("SteamID must stand for a clan account in the public universe"); } - + var self = this; this.request("https://steamcommunity.com/" + (typeof id === 'string' ? "groups/" + id : "gid/" + id.toString()) + "/memberslistxml/?xml=1", function(err, response, body) { if(self._checkHttpError(err, response, callback)) { return; } - + if(self._checkCommunityError(body, callback)) { return; } - + xml2js.parseString(body, function(err, result) { if(err) { callback(err); return; } - + callback(null, new CSteamGroup(self, result.memberList)); }); }); @@ -34,7 +34,7 @@ SteamCommunity.prototype.getSteamGroup = function(id, callback) { function CSteamGroup(community, groupData) { this._community = community; - + this.steamID = new SteamID(groupData.groupID64[0]); this.name = groupData.groupDetails[0].groupName[0]; this.url = groupData.groupDetails[0].groupURL[0]; @@ -50,7 +50,7 @@ function CSteamGroup(community, groupData) { CSteamGroup.prototype.getAvatarURL = function(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; if(size == 'full' || size == 'medium') { return url + "_" + size + ".jpg"; @@ -64,7 +64,7 @@ CSteamGroup.prototype.getMembers = function(addresses, callback) { callback = addresses; addresses = null; } - + this._community.getGroupMembers(this.steamID, callback, null, null, addresses, 0); }; diff --git a/examples/edit-group-announcement.js b/examples/edit-group-announcement.js index e59932b..fdea5e7 100644 --- a/examples/edit-group-announcement.js +++ b/examples/edit-group-announcement.js @@ -19,15 +19,15 @@ function doLogin(accountName, password, authCode, twoFactorCode) { "accountName": accountName, "password": password, "authCode": authCode, - "twoFactorCode": twoFactorCode + "twoFactorCode": twoFactorCode }, function(err, sessionID, cookies, steamguard) { if(err) { if(err.message == 'SteamGuardMobile') { - rl.question("Steam Authenticator Code: ", function(code) { - doLogin(accountName, password, null, code); + rl.question("Steam Authenticator Code: ", function(code) { + doLogin(accountName, password, null, code); }); - return; + return; } if(err.message == 'SteamGuard') { @@ -46,34 +46,34 @@ function doLogin(accountName, password, authCode, twoFactorCode) { console.log("Logged on!"); - rl.question("Group ID: ", function(gid) { - community.getSteamGroup(gid, function(err, group) { - if (err) { - console.log(err); - process.exit(1); - } + rl.question("Group ID: ", function(gid) { + community.getSteamGroup(gid, function(err, group) { + if (err) { + console.log(err); + process.exit(1); + } - rl.question("Annoucement ID: ", function(aid) { - rl.question("New title: ", function(header) { - rl.question("New body: ", function(content) { - // EW THE PYRAMID! - editAnnouncement(group, aid, header, content); - }); - }); - }); - }); - }); - }); + rl.question("Annoucement ID: ", function(aid) { + rl.question("New title: ", function(header) { + rl.question("New body: ", function(content) { + // EW THE PYRAMID! + editAnnouncement(group, aid, header, content); + }); + }); + }); + }); + }); + }); } function editAnnouncement(group, aid, header, content) { - // Actual community method. - group.editAnnouncement(aid, header, content, function(error) { - if(!error) { - console.log("Annoucement edited!"); - } else { - console.log("Unable to edit annoucement! %j", error); - process.exit(1); - } - }); + // Actual community method. + group.editAnnouncement(aid, header, content, function(error) { + if(!error) { + console.log("Annoucement edited!"); + } else { + console.log("Unable to edit annoucement! %j", error); + process.exit(1); + } + }); }