diff --git a/js/models/messages.js b/js/models/messages.js index 18ec0c9fe..31dfcf77a 100644 --- a/js/models/messages.js +++ b/js/models/messages.js @@ -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() diff --git a/js/popup.js b/js/popup.js index f3fb5948b..3e8fafe7d 100644 --- a/js/popup.js +++ b/js/popup.js @@ -53,7 +53,7 @@ textsecure.registerOnLoadFunction(function() { } var messageProto = new PushMessageContentProtobuf(); messageProto.body = $("#popup_send_text").val(); - Whisper.Messages.addOutgoingMessage(messageProto, numbers[0]); + Whisper.Messages.addOutgoingMessage(messageProto, numbers); textsecure.sendMessage(numbers, messageProto, //TODO: Handle result function(thing) {console.log(thing);}); diff --git a/js/views/messages.js b/js/views/messages.js index fdbe1d79d..4c71a8cd7 100644 --- a/js/views/messages.js +++ b/js/views/messages.js @@ -45,15 +45,14 @@ var Whisper = Whisper || {}; initialize: function(options) { this.$el.addClass('closed'); this.$header = $('
'). - append($('').text(options.sender)).appendTo(this.$el); + append($('').text(options.name)).appendTo(this.$el); this.$header.prepend($('
')); this.$collapsable = $('
').hide(); this.$messages = $('
    ').addClass('messages').appendTo(this.$collapsable); this.$button = $('