Use textsecure.messaging to create groups

Not textsecure.storage. Sigh. Also accomodate the fact that
the group id is not returned directly, but rather at the end
of a promise chain.
This commit is contained in:
lilia 2014-10-16 14:14:00 -07:00
parent fa4c385598
commit 4f21bbd21f
2 changed files with 14 additions and 9 deletions

View file

@ -36,10 +36,12 @@ var Whisper = Whisper || {};
e.preventDefault();
var numbers = this.$el.find('input.numbers').val().split(',');
var name = this.$el.find('input.name').val();
var thread = Whisper.Threads.createGroup(numbers, name);
thread.sendMessage(this.$el.find('input.send-message').val());
this.remove();
thread.trigger('render');
var view = this;
Whisper.Threads.createGroup(numbers, name).then(function(thread){
thread.sendMessage(view.$el.find('input.send-message').val());
view.remove();
thread.trigger('render');
});
},
render: function() {