Merge branch 'release' into sabrecat/usernames-master

This commit is contained in:
Sabe Jones
2018-11-01 14:51:28 -05:00
129 changed files with 6880 additions and 6703 deletions

View File

@@ -14,19 +14,20 @@ const defaultSchema = () => ({
contributor: {type: mongoose.Schema.Types.Mixed},
backer: {type: mongoose.Schema.Types.Mixed},
uuid: String, // sender uuid
userStyles: {type: mongoose.Schema.Types.Mixed},
userStyles: {$type: mongoose.Schema.Types.Mixed},
flags: {type: mongoose.Schema.Types.Mixed, default: {}},
flagCount: {type: Number, default: 0},
likes: {type: mongoose.Schema.Types.Mixed},
_meta: {type: mongoose.Schema.Types.Mixed},
flags: {$type: mongoose.Schema.Types.Mixed, default: {}},
flagCount: {$type: Number, default: 0},
likes: {$type: mongoose.Schema.Types.Mixed},
_meta: {$type: mongoose.Schema.Types.Mixed},
});
const chatSchema = new mongoose.Schema({
...defaultSchema(),
groupId: {type: String, ref: 'Group'},
groupId: {$type: String, ref: 'Group'},
}, {
minimize: false, // Allow for empty flags to be saved
typeKey: '$type', // So that we can use fields named `type`
});
chatSchema.plugin(baseModel, {
@@ -34,14 +35,15 @@ chatSchema.plugin(baseModel, {
});
const inboxSchema = new mongoose.Schema({
sent: {type: Boolean, default: false}, // if the owner sent this message
sent: {$type: Boolean, default: false}, // if the owner sent this message
// the uuid of the user where the message is stored,
// we store two copies of each inbox messages:
// one for the sender and one for the receiver
ownerId: {type: String, ref: 'User'},
ownerId: {$type: String, ref: 'User'},
...defaultSchema(),
}, {
minimize: false, // Allow for empty flags to be saved
typeKey: '$type', // So that we can use fields named `type`
});
inboxSchema.plugin(baseModel, {