Refactor components for the main content section
Each conversation views now manages its own separate elements rather than all binding to a shared #conversation element, and similarly for message composition ui. Also includes the beginnings of group creation UI (not working yet), featuring bootstrap-tagsinput field for entering group recipients
This commit is contained in:
parent
28e16aaae8
commit
c034ac8267
9 changed files with 216 additions and 44 deletions
|
@ -48,26 +48,9 @@ var Whisper = Whisper || {};
|
|||
if (decrypted.message.timestamp > thread.get('timestamp')) {
|
||||
thread.set('timestamp', decrypted.message.timestamp);
|
||||
}
|
||||
thread.set('unreadCount', thread.get('unreadCount') + 1);
|
||||
thread.set('active', true);
|
||||
thread.save();
|
||||
return m;
|
||||
},
|
||||
|
||||
addOutgoingMessage: function(message, thread) {
|
||||
var m = thread.messages().add({
|
||||
threadId: thread.id,
|
||||
body: message,
|
||||
type: 'outgoing',
|
||||
timestamp: new Date().getTime()
|
||||
});
|
||||
m.save();
|
||||
|
||||
thread.set('timestamp', new Date().getTime());
|
||||
thread.set('unreadCount', 0);
|
||||
thread.set('active', true);
|
||||
thread.save();
|
||||
thread.save({unreadCount: thread.get('unreadCount') + 1, active: true});
|
||||
return m;
|
||||
}
|
||||
|
||||
}))();
|
||||
})()
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue