use of org.thoughtcrime.securesms.sms.OutgoingEncryptedMessage in project Signal-Android by WhisperSystems.
the class ConversationActivity method sendTextMessage.
private void sendTextMessage(final boolean forceSms, final long expiresIn, final int subscriptionId) throws InvalidMessageException {
final Context context = getApplicationContext();
OutgoingTextMessage message;
if (isSecureText && !forceSms) {
message = new OutgoingEncryptedMessage(recipients, getMessage(), expiresIn);
} else {
message = new OutgoingTextMessage(recipients, getMessage(), expiresIn, subscriptionId);
}
this.composeText.setText("");
new AsyncTask<OutgoingTextMessage, Void, Long>() {
@Override
protected Long doInBackground(OutgoingTextMessage... messages) {
return MessageSender.send(context, masterSecret, messages[0], threadId, forceSms);
}
@Override
protected void onPostExecute(Long result) {
sendComplete(result);
}
}.execute(message);
}
Aggregations