Exemplo n.º 1
0
  private List<Draft> getDraftsForCurrentState() {
    List<Draft> drafts = new LinkedList<Draft>();

    if (!Util.isEmpty(composeText)) {
      drafts.add(new Draft(Draft.TEXT, composeText.getText().toString()));
    }

    for (Slide slide : attachmentManager.getSlideDeck().getSlides()) {
      if (slide.hasImage()) drafts.add(new Draft(Draft.IMAGE, slide.getUri().toString()));
      else if (slide.hasAudio()) drafts.add(new Draft(Draft.AUDIO, slide.getUri().toString()));
      else if (slide.hasVideo()) drafts.add(new Draft(Draft.VIDEO, slide.getUri().toString()));
    }

    return drafts;
  }
Exemplo n.º 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);
  }