Basic frontend support for image attachments

This commit is contained in:
lilia
2014-10-24 18:44:30 -07:00
parent d362d0d978
commit 229007040c
5 changed files with 76 additions and 6 deletions

View File

@@ -21,7 +21,7 @@ var Whisper = Whisper || {};
if (missing.length) { return "Thread must have " + missing; }
},
sendMessage: function(message) {
sendMessage: function(message, attachments) {
var timestamp = Date.now();
this.messages().add({ type: 'outgoing',
@@ -34,10 +34,10 @@ var Whisper = Whisper || {};
active: true});
if (this.get('type') == 'private') {
var promise = textsecure.messaging.sendMessageToNumber(this.get('id'), message, []);
var promise = textsecure.messaging.sendMessageToNumber(this.get('id'), message, attachments)
}
else {
var promise = textsecure.messaging.sendMessageToGroup(this.get('groupId'), message, []);
var promise = textsecure.messaging.sendMessageToGroup(this.get('groupId'), message, attachments);
}
promise.then(
function(result) {