Merge branch 'develop' into hairlessbear-quest_invite_modal_on_user_sync

This commit is contained in:
Blade Barringer
2015-06-14 16:33:38 -05:00
679 changed files with 14883 additions and 11486 deletions

View File

@@ -34,7 +34,8 @@ var UserSchema = new Schema({
originalUser: Boolean,
helpedHabit: Boolean, //TODO: Deprecate this. Superseded by habitSurveys
habitSurveys: Number,
ultimateGear: Boolean,
ultimateGear: Boolean, //TODO: Deprecate this. Superseded by ultimateGearSets
ultimateGearSets: Schema.Types.Mixed,
beastMaster: Boolean,
beastMasterCount: Number,
mountMaster: Boolean,
@@ -129,7 +130,11 @@ var UserSchema = new Schema({
party: {type: Number, 'default': -1},
guilds: {type: Number, 'default': -1},
challenges: {type: Number, 'default': -1},
market: {type: Number, 'default': -1}
market: {type: Number, 'default': -1},
pets: {type: Number, 'default': -1},
mounts: {type: Number, 'default': -1},
hall: {type: Number, 'default': -1},
equipment: {type: Number, 'default': -1}
},
dropsEnabled: {type: Boolean, 'default': false},
itemsEnabled: {type: Boolean, 'default': false},
@@ -148,8 +153,14 @@ var UserSchema = new Schema({
recaptureEmailsPhase: {type: Number, 'default': 0},
// Needed to track the tip to send inside the email
weeklyRecapEmailsPhase: {type: Number, 'default': 0},
// Used to track when the next weekly recap should be sent
lastWeeklyRecap: {type: Date, 'default': Date.now},
communityGuidelinesAccepted: {type: Boolean, 'default': false},
cronCount: {type:Number, 'default':0}
cronCount: {type:Number, 'default':0},
welcomed: {type: Boolean, 'default': false},
armoireEnabled: {type: Boolean, 'default': false},
armoireOpened: {type: Boolean, 'default': false},
armoireEmpty: {type: Boolean, 'default': false}
},
history: {
exp: Array, // [{date: Date, value: Number}], // big peformance issues if these are defined
@@ -315,6 +326,7 @@ var UserSchema = new Schema({
advancedCollapsed: {type: Boolean, 'default': false},
toolbarCollapsed: {type:Boolean, 'default':false},
background: String,
displayInviteToPartyWhenPartyIs1: { type:Boolean, 'default':true},
webhooks: {type: Schema.Types.Mixed, 'default': {}},
// For this fields make sure to use strict comparison when searching for falsey values (=== false)
// As users who didn't login after these were introduced may have them undefined/null
@@ -395,7 +407,7 @@ var UserSchema = new Schema({
rewards: {type:[TaskSchemas.RewardSchema]},
extra: Schema.Types.Mixed,
pushDevices: {type: [{
regId: {type: String},
type: {type: String}
@@ -448,7 +460,9 @@ UserSchema.pre('save', function(next) {
newTask.name = newTask.name(self.preferences.language);
}else{
newTask.text = newTask.text(self.preferences.language);
newTask.notes = newTask.notes(self.preferences.language);
if(newTask.notes) {
newTask.notes = newTask.notes(self.preferences.language);
}
if(newTask.checklist){
newTask.checklist = _.map(newTask.checklist, function(checklistItem){