Fix conversation list self-resorting

When deleting all messages in a conversation, the entry in the left pane
should be inserted into the alphabetical portion of the list. To keep it
in this collection, do not nullify active_at.

To ensure the list view is keeping itself correctly sorted, make sure
that resorting behavior is triggered any time a relevant attribute is
changed.

This fixes deleted conversations jumping to the top of the list, and
conversation order scrambling when getting a group or contact sync
message from our master device.

Fixes #734

// FREEBIE
This commit is contained in:
lilia 2016-03-25 10:39:36 -07:00
parent 7210636b5e
commit 07a0463b65
4 changed files with 10 additions and 9 deletions

View file

@ -283,7 +283,7 @@
var models = this.messageCollection.models;
this.messageCollection.reset([]);
_.each(models, function(message) { message.destroy(); });
this.save({active_at: null, lastMessage: '', timestamp: null}); // archive
this.save({lastMessage: null, timestamp: null}); // archive
}.bind(this));
},