Search in sources :

Example 1 with OutgoingEncryptedMessage

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);
}
Also used : GroupContext(org.whispersystems.signalservice.internal.push.SignalServiceProtos.GroupContext) Context(android.content.Context) OutgoingTextMessage(org.thoughtcrime.securesms.sms.OutgoingTextMessage) OutgoingEncryptedMessage(org.thoughtcrime.securesms.sms.OutgoingEncryptedMessage)

Aggregations

Context (android.content.Context)1 OutgoingEncryptedMessage (org.thoughtcrime.securesms.sms.OutgoingEncryptedMessage)1 OutgoingTextMessage (org.thoughtcrime.securesms.sms.OutgoingTextMessage)1 GroupContext (org.whispersystems.signalservice.internal.push.SignalServiceProtos.GroupContext)1