com.fsck.k9.mail.Message.getSubject()方法的使用及代码示例

x33g5p2x  于2022-01-25 转载在 其他  
字(6.7k)|赞(0)|评价(0)|浏览(273)

本文整理了Java中com.fsck.k9.mail.Message.getSubject()方法的一些代码示例,展示了Message.getSubject()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Message.getSubject()方法的具体详情如下:
包路径:com.fsck.k9.mail.Message
类名称:Message
方法名:getSubject

Message.getSubject介绍

暂无

代码示例

代码示例来源:origin: k9mail/k-9

private String getMessageSubject(Message message) {
  String subject = message.getSubject();
  if (!TextUtils.isEmpty(subject)) {
    return subject;
  }
  return resourceProvider.noSubject();
}

代码示例来源:origin: k9mail/k-9

private MessageViewInfo extractSubject(MessageViewInfo messageViewInfo) {
  if (messageViewInfo.cryptoResultAnnotation != null && messageViewInfo.cryptoResultAnnotation.isEncrypted()) {
    String protectedSubject = extractProtectedSubject(messageViewInfo);
    if (protectedSubject != null) {
      return messageViewInfo.withSubject(protectedSubject, true);
    }
  }
  return messageViewInfo.withSubject(messageViewInfo.message.getSubject(), false);
}

代码示例来源:origin: k9mail/k-9

String subject = message.getSubject();
text.append(resourceProvider.messageHeaderSubject());
text.append(' ');

代码示例来源:origin: k9mail/k-9

.append("<br>\r\n");
if (originalMessage.getSubject() != null) {
  header.append("<b>").append(resourceProvider.messageHeaderSubject()).append("</b> ")
      .append(HtmlConverter.textToHtmlFragment(originalMessage.getSubject()))
      .append("<br>\r\n");

代码示例来源:origin: k9mail/k-9

cv.put("message_part_id", rootMessagePartId);
cv.put("uid", uid);
cv.put("subject", message.getSubject());
cv.put("sender_list", Address.pack(message.getFrom()));
cv.put("date", message.getSentDate() == null
throw new MessagingException("Error appending message: " + message.getSubject(), e);

代码示例来源:origin: k9mail/k-9

assertEquals("subject of second message", ((MessageHeader) outputViewableParts.get(2)).getMessage().getSubject());

代码示例来源:origin: k9mail/k-9

@WorkerThread
public MessageViewInfo extractMessageForView(Message message, @Nullable MessageCryptoAnnotations cryptoAnnotations,
    boolean openPgpProviderConfigured) throws MessagingException {
  ArrayList<Part> extraParts = new ArrayList<>();
  Part cryptoContentPart = MessageCryptoStructureDetector.findPrimaryEncryptedOrSignedPart(message, extraParts);
  if (cryptoContentPart == null) {
    if (cryptoAnnotations != null && !cryptoAnnotations.isEmpty()) {
      Timber.e("Got crypto message cryptoContentAnnotations but no crypto root part!");
    }
    MessageViewInfo messageViewInfo = extractSimpleMessageForView(message, message);
    return messageViewInfo.withSubject(message.getSubject(), false);
  }
  boolean isOpenPgpEncrypted = (MessageCryptoStructureDetector.isPartMultipartEncrypted(cryptoContentPart) &&
          MessageCryptoStructureDetector.isMultipartEncryptedOpenPgpProtocol(cryptoContentPart)) ||
          MessageCryptoStructureDetector.isPartPgpInlineEncrypted(cryptoContentPart);
  if (!openPgpProviderConfigured && isOpenPgpEncrypted) {
    CryptoResultAnnotation noProviderAnnotation = CryptoResultAnnotation.createErrorAnnotation(
        CryptoError.OPENPGP_ENCRYPTED_NO_PROVIDER, null);
    return MessageViewInfo.createWithErrorState(message, false)
        .withCryptoData(noProviderAnnotation, null, null);
  }
  MessageViewInfo messageViewInfo = getMessageContent(message, cryptoAnnotations, extraParts, cryptoContentPart);
  messageViewInfo = extractSubject(messageViewInfo);
  return messageViewInfo;
}

代码示例来源:origin: k9mail/k-9

String subject = message.getSubject();
addTableRow(html, resourceProvider.messageHeaderSubject(),
    (subject == null) ? resourceProvider.noSubject() : subject);

代码示例来源:origin: jberkel/sms-backup-plus

private void assertMessage(Message message) {
  assertThat(message).isNotNull();
  assertThat(message.getSubject()).isEqualTo("Call with Test Testor");
  assertThat(message.getFrom()[0].toString()).isEqualTo("Test Testor <unknown.number@unknown.email>");
  assertThat(message.getRecipients(Message.RecipientType.TO)[0]).isEqualTo(me);
}

代码示例来源:origin: jberkel/sms-backup-plus

@Test public void testShouldGenerateSubjectWithNameForMMS() throws Exception {
  PersonRecord personRecord = new PersonRecord(1, "Foo Bar", "foo@bar.com", "1234");
  MmsSupport.MmsDetails details = new MmsSupport.MmsDetails(true, "foo",
      personRecord,
      new Address("foo@bar.com"));
  when(mmsSupport.getDetails(any(Uri.class), any(AddressStyle.class))).thenReturn(details);
  Message msg = generator.messageForDataType(mockMessage("1234", personRecord), DataType.MMS);
  assertThat(msg).isNotNull();
  assertThat(msg.getSubject()).isEqualTo("SMS with Foo Bar");
}

代码示例来源:origin: jberkel/sms-backup-plus

@Test public void testShouldUseNumberIfNameIsUnknown() throws Exception {
  PersonRecord record = new PersonRecord(-1, null, null, "1234");
  Message msg = generator.messageForDataType(mockMessage("1234", record), DataType.SMS);
  assertThat(msg).isNotNull();
  assertThat(msg.getSubject()).isEqualTo("SMS with 1234");
}

代码示例来源:origin: jberkel/sms-backup-plus

@Test public void testShouldGenerateSubjectWithNameForSMS() throws Exception {
  PersonRecord record = new PersonRecord(1, "Test Testor", null, null);
  Message msg = generator.messageForDataType(mockMessage("1234", record), DataType.SMS);
  assertThat(msg).isNotNull();
  assertThat(msg.getSubject()).isEqualTo("SMS with Test Testor");
}

代码示例来源:origin: jberkel/sms-backup-plus

@Test public void testShouldGenerateSubjectWithNameAndNumberForSMS() throws Exception {
  PersonRecord record = new PersonRecord(1, "Test Testor", "test@test.com", "1234");
  Message msg = generator.messageForDataType(mockMessage("1234", record), DataType.SMS);
  assertThat(msg).isNotNull();
  assertThat(msg.getSubject()).isEqualTo("SMS with Test Testor");
}

代码示例来源:origin: jberkel/sms-backup-plus

@Test public void testShouldGenerateMessageForCallLogOutgoing() throws Exception {
  PersonRecord record = new PersonRecord(-1, "Test Testor", null, null);
  Message msg = generator.messageForDataType(mockCalllogMessage("1234", OUTGOING_TYPE, record), CALLLOG);
  assertThat(msg).isNotNull();
  assertThat(msg.getSubject()).isEqualTo("Call with Test Testor");
  assertThat(msg.getFrom()[0]).isEqualTo(me);
  assertThat(msg.getRecipients(Message.RecipientType.TO)[0].toString()).isEqualTo("Test Testor <unknown.number@unknown.email>");
}

代码示例来源:origin: jberkel/sms-backup-plus

@Test public void testShouldGenerateMessageForCallLogIncomingUnknown() throws Exception {
  PersonRecord record = new PersonRecord(0, null, null, "-1");
  Message msg = generator.messageForDataType(mockCalllogMessage("", INCOMING_TYPE, record), CALLLOG);
  assertThat(msg).isNotNull();
  assertThat(msg.getSubject()).isEqualTo("Call with Unknown");
  assertThat(msg.getFrom()[0].toString()).isEqualTo("Unknown <unknown.number@unknown.email>");
  assertThat(msg.getRecipients(Message.RecipientType.TO)[0]).isEqualTo(me);
}

相关文章