Resolve recipient address when displaying untrusted identity message

This commit is contained in:
AsamK 2021-04-23 22:00:09 +02:00
parent 3935ebf81b
commit b9b4d846d3

View file

@ -67,14 +67,17 @@ public class ReceiveMessageHandler implements Manager.ReceiveMessageHandler {
var e = (UntrustedIdentityException) exception; var e = (UntrustedIdentityException) exception;
writer.println( writer.println(
"The users key is untrusted, either the user has reinstalled Signal or a third party sent this message."); "The users key is untrusted, either the user has reinstalled Signal or a third party sent this message.");
final var recipientName = m.resolveSignalServiceAddress(e.getName()).getLegacyIdentifier();
writer.println( writer.println(
"Use 'signal-cli -u {0} listIdentities -n {1}', verify the key and run 'signal-cli -u {0} trust -v \"FINGER_PRINT\" {1}' to mark it as trusted", "Use 'signal-cli -u {} listIdentities -n {}', verify the key and run 'signal-cli -u {} trust -v \"FINGER_PRINT\" {}' to mark it as trusted",
m.getUsername(), m.getUsername(),
e.getName()); recipientName,
m.getUsername(),
recipientName);
writer.println( writer.println(
"If you don't care about security, use 'signal-cli -u {} trust -a {}' to trust it without verification", "If you don't care about security, use 'signal-cli -u {} trust -a {}' to trust it without verification",
m.getUsername(), m.getUsername(),
e.getName()); recipientName);
} else { } else {
writer.println("Exception: {} ({})", exception.getMessage(), exception.getClass().getSimpleName()); writer.println("Exception: {} ({})", exception.getMessage(), exception.getClass().getSimpleName());
} }