Improve output for profile key update messages

This commit is contained in:
AsamK 2022-06-18 12:11:36 +02:00
parent adce64bc21
commit abebffb2cd
3 changed files with 8 additions and 1 deletions

View file

@ -100,6 +100,7 @@ public record MessageEnvelope(
boolean isExpirationUpdate, boolean isExpirationUpdate,
boolean isViewOnce, boolean isViewOnce,
boolean isEndSession, boolean isEndSession,
boolean isProfileKeyUpdate,
boolean hasProfileKey, boolean hasProfileKey,
Optional<Reaction> reaction, Optional<Reaction> reaction,
Optional<Quote> quote, Optional<Quote> quote,
@ -126,6 +127,7 @@ public record MessageEnvelope(
dataMessage.isExpirationUpdate(), dataMessage.isExpirationUpdate(),
dataMessage.isViewOnce(), dataMessage.isViewOnce(),
dataMessage.isEndSession(), dataMessage.isEndSession(),
dataMessage.isProfileKeyUpdate(),
dataMessage.getProfileKey().isPresent(), dataMessage.getProfileKey().isPresent(),
dataMessage.getReaction().map(r -> Reaction.from(r, recipientResolver, addressResolver)), dataMessage.getReaction().map(r -> Reaction.from(r, recipientResolver, addressResolver)),
dataMessage.getQuote().map(q -> Quote.from(q, recipientResolver, addressResolver, fileProvider)), dataMessage.getQuote().map(q -> Quote.from(q, recipientResolver, addressResolver, fileProvider)),

View file

@ -141,9 +141,12 @@ public class ReceiveMessageHandler implements Manager.ReceiveMessageHandler {
if (message.expiresInSeconds() > 0) { if (message.expiresInSeconds() > 0) {
writer.println("Expires in: {} seconds", message.expiresInSeconds()); writer.println("Expires in: {} seconds", message.expiresInSeconds());
} }
if (message.hasProfileKey()) { if (message.isProfileKeyUpdate()) {
writer.println("Profile key update"); writer.println("Profile key update");
} }
if (message.hasProfileKey()) {
writer.println("With profile key");
}
if (message.reaction().isPresent()) { if (message.reaction().isPresent()) {
writer.println("Reaction:"); writer.println("Reaction:");
final var reaction = message.reaction().get(); final var reaction = message.reaction().get();

View file

@ -757,6 +757,7 @@ public class DbusManagerImpl implements Manager {
false, false,
false, false,
false, false,
false,
Optional.empty(), Optional.empty(),
Optional.empty(), Optional.empty(),
Optional.empty(), Optional.empty(),
@ -827,6 +828,7 @@ public class DbusManagerImpl implements Manager {
false, false,
false, false,
false, false,
false,
Optional.empty(), Optional.empty(),
Optional.empty(), Optional.empty(),
Optional.empty(), Optional.empty(),