private void handleMessageInternal(MessageEnvelope envelope, Throwable exception) {
var source = envelope.sourceAddress();
- writer.println("Envelope from: {} (device: {})",
+ writer.println("Envelope from: {} (device: {}) to {}",
source.map(this::formatContact).orElse("unknown source"),
- envelope.sourceDevice());
+ envelope.sourceDevice(),
+ m.getSelfNumber());
writer.println("Timestamp: {}", DateUtils.formatTimestamp(envelope.timestamp()));
writer.println("Server timestamps: received: {} delivered: {}",
DateUtils.formatTimestamp(envelope.serverReceivedTimestamp()),
printMention(writer, mention);
}
}
+ if (message.textStyles().size() > 0) {
+ writer.println("Text styles:");
+ for (var textStyle : message.textStyles()) {
+ printTextStyle(writer, textStyle);
+ }
+ }
if (message.attachments().size() > 0) {
writer.println("Attachments:");
for (var attachment : message.attachments()) {
writer.println("- {}: {} (length: {})", formatContact(mention.recipient()), mention.start(), mention.length());
}
+ private void printTextStyle(
+ PlainTextWriter writer, MessageEnvelope.Data.TextStyle textStyle
+ ) {
+ writer.println("- {}: {} (length: {})", textStyle.style().name(), textStyle.start(), textStyle.length());
+ }
+
private void printAttachment(PlainTextWriter writer, MessageEnvelope.Data.Attachment attachment) {
writer.println("Content-Type: {}", attachment.contentType());
writer.println("Type: {}", attachment.id().isPresent() ? "Pointer" : "Stream");