mirror of
https://github.com/aljazceru/signal-cli.git
synced 2025-12-25 18:14:27 +01:00
Print text styles in plain text output
This commit is contained in:
@@ -177,6 +177,12 @@ public class ReceiveMessageHandler implements Manager.ReceiveMessageHandler {
|
||||
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()) {
|
||||
@@ -555,6 +561,12 @@ public class ReceiveMessageHandler implements Manager.ReceiveMessageHandler {
|
||||
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");
|
||||
|
||||
@@ -778,6 +778,7 @@ public class DbusManagerImpl implements Manager {
|
||||
Optional.empty(),
|
||||
List.of(),
|
||||
List.of(),
|
||||
List.of(),
|
||||
List.of())),
|
||||
Optional.empty(),
|
||||
Optional.empty(),
|
||||
@@ -852,6 +853,7 @@ public class DbusManagerImpl implements Manager {
|
||||
Optional.empty(),
|
||||
List.of(),
|
||||
List.of(),
|
||||
List.of(),
|
||||
List.of())),
|
||||
Optional.empty())),
|
||||
Optional.empty(),
|
||||
|
||||
Reference in New Issue
Block a user