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); }
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); }