mirror of
https://github.com/DoctorMcKay/node-steamcommunity.git
synced 2025-01-06 07:30:09 +08:00
Added acceptAllConfirmations method
This commit is contained in:
parent
47a24d19cf
commit
575c196cb7
@ -144,6 +144,31 @@ SteamCommunity.prototype.respondToConfirmation = function(confID, confKey, time,
|
|||||||
});
|
});
|
||||||
};
|
};
|
||||||
|
|
||||||
|
SteamCommunity.prototype.acceptAllConfirmations = function(time, confKey, allowKey, callback) {
|
||||||
|
var self = this;
|
||||||
|
|
||||||
|
this.getConfirmations(time, confKey, function(err, confs) {
|
||||||
|
if (err) {
|
||||||
|
callback(err);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (confs.length == 0) {
|
||||||
|
callback(null, []);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
self.respondToConfirmation(confs.map(function(conf) { return conf.id; }), confs.map(function(conf) { return conf.key; }), time, allowKey, true, function(err) {
|
||||||
|
if (err) {
|
||||||
|
callback(err);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
callback(err, confs);
|
||||||
|
});
|
||||||
|
});
|
||||||
|
};
|
||||||
|
|
||||||
function request(community, url, key, time, tag, params, json, callback) {
|
function request(community, url, key, time, tag, params, json, callback) {
|
||||||
params = params || {};
|
params = params || {};
|
||||||
params.p = SteamTotp.getDeviceID(community.steamID);
|
params.p = SteamTotp.getDeviceID(community.steamID);
|
||||||
|
Loading…
Reference in New Issue
Block a user