Initialize schema version during `Message` construction

pull/1/head
Daniel Gasienica 8 years ago
parent 9a540d6d18
commit e3dbeba963

@ -5,10 +5,16 @@
'use strict';
window.Whisper = window.Whisper || {};
const { Message: TypedMessage } = window.Signal.Types;
var Message = window.Whisper.Message = Backbone.Model.extend({
database : Whisper.Database,
storeName : 'messages',
initialize: function() {
initialize: function(attributes) {
if (_.isObject(attributes)) {
this.set(TypedMessage.initializeSchemaVersion(attributes));
}
this.on('change:attachments', this.updateImageUrl);
this.on('destroy', this.revokeImageUrl);
this.on('change:expirationStartTimestamp', this.setToExpire);

Loading…
Cancel
Save