Optimize bandwidth usage of updateChallenges

This commit is contained in:
Guangcong Luo 2014-03-05 23:27:10 -05:00
parent 70ea1533a4
commit d5b528dbcc

View File

@ -1142,9 +1142,16 @@ var User = (function () {
}
};
User.prototype.updateChallenges = function() {
var challengeTo = this.challengeTo;
if (challengeTo) {
challengeTo = {
to: challengeTo.to,
format: challengeTo.format
}
}
this.send('|updatechallenges|'+JSON.stringify({
challengesFrom: this.challengesFrom,
challengeTo: this.challengeTo
challengesFrom: Object.map(this.challengesFrom, 'format'),
challengeTo: challengeTo
}));
};
User.prototype.makeChallenge = function(user, format/*, isPrivate*/) {