Store attachments as binary blobs
Move base64 encoding of attachments to an AttachmentView. This makes image rendering an asynchronous task so we fire an update event to indicate to the parent MessageListView that its content has changed height and it is time to scroll down.
This commit is contained in:
@@ -21,7 +21,12 @@
|
||||
var Message = Backbone.Model.extend({
|
||||
database: Whisper.Database,
|
||||
storeName: 'messages',
|
||||
defaults: function() { return { timestamp: new Date().getTime() }; },
|
||||
defaults: function() {
|
||||
return {
|
||||
timestamp: new Date().getTime(),
|
||||
attachments: []
|
||||
};
|
||||
},
|
||||
validate: function(attributes, options) {
|
||||
var required = ['timestamp', 'conversationId'];
|
||||
var missing = _.filter(required, function(attr) { return !attributes[attr]; });
|
||||
|
Reference in New Issue
Block a user