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:
@@ -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()
|
||||
|
Reference in New Issue
Block a user