예제 #1
0
  private long sendTextMessage(boolean forcePlaintext, boolean forceSms)
      throws InvalidMessageException {
    OutgoingTextMessage message;

    if (isEncryptedConversation && !forcePlaintext) {
      message = new OutgoingEncryptedMessage(recipients, getMessage());
    } else {
      message = new OutgoingTextMessage(recipients, getMessage());
    }

    Log.w(TAG, "Sending message...");

    return MessageSender.send(ConversationActivity.this, masterSecret, message, threadId, forceSms);
  }
예제 #2
0
  private long sendMediaMessage(boolean forcePlaintext, boolean forceSms)
      throws InvalidMessageException, MmsException {
    SlideDeck slideDeck;

    if (attachmentManager.isAttachmentPresent()) slideDeck = attachmentManager.getSlideDeck();
    else slideDeck = new SlideDeck();

    OutgoingMediaMessage outgoingMessage =
        new OutgoingMediaMessage(this, recipients, slideDeck, getMessage(), distributionType);

    if (isEncryptedConversation && !forcePlaintext) {
      outgoingMessage = new OutgoingSecureMediaMessage(outgoingMessage);
    }

    return MessageSender.send(this, masterSecret, outgoingMessage, threadId, forceSms);
  }