Rename some things to be a little more semantic
The 'sender' field actually holds the recipient for outgoing messages. Rename that field to 'person', indicating the 2nd party generically. Also decouples the thread name from thread recipients at the view layer, in preparation for group support.
This commit is contained in:
parent
0362ecf709
commit
2601c3cc3a
3 changed files with 12 additions and 13 deletions
|
@ -11,7 +11,7 @@ var Whisper = Whisper || {};
|
|||
|
||||
addIncomingMessage: function(decrypted) {
|
||||
Whisper.Messages.add({
|
||||
sender: decrypted.pushMessage.source,
|
||||
person: decrypted.pushMessage.source,
|
||||
group: decrypted.message.group,
|
||||
body: decrypted.message.body,
|
||||
type: 'incoming',
|
||||
|
@ -19,9 +19,9 @@ var Whisper = Whisper || {};
|
|||
}).save();
|
||||
},
|
||||
|
||||
addOutgoingMessage: function(messageProto, sender) {
|
||||
addOutgoingMessage: function(messageProto, recipients) {
|
||||
Whisper.Messages.add({
|
||||
sender: sender,
|
||||
person: recipients[0], // TODO: groups
|
||||
body: messageProto.body,
|
||||
type: 'outgoing',
|
||||
timestamp: new Date().getTime()
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue