Check trust store for identity key information on every new message

It's debounced so it doesn't go too crazy.

FREEBIE
This commit is contained in:
Scott Nonnenberg 2017-06-16 11:51:08 -07:00
parent 782c484680
commit b0dbecb4e2

View file

@ -106,6 +106,8 @@
this.listenTo(this.model, 'expired', this.onExpired);
this.listenTo(this.model.messageCollection, 'expired', this.onExpiredCollection);
this.lazyUpdateVerified = _.debounce(this.model.updateVerified, 1000);
this.render();
new TimerMenuView({ el: this.$('.timer-menu'), model: this.model });
@ -467,6 +469,9 @@
},
addMessage: function(message) {
// This is debounced, so it won't hit the database too often.
this.lazyUpdateVerified();
this.model.messageCollection.add(message, {merge: true});
message.setToExpire();