mirror of
https://github.com/AsamK/signal-cli
synced 2025-08-29 10:30:38 +00:00
Print text styles in plain text output
This commit is contained in:
parent
a4f7632981
commit
15da210de7
3 changed files with 58 additions and 3 deletions
|
@ -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(),
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue