include original request in error for changed safety number

* to facilitate re-sending messages that failed to send due to changed
  safety number, include the original failed request in
  `untrusted_identity` error messages
parent 14216567
......@@ -26,11 +26,13 @@ class JsonUntrustedIdentityException {
public String number;
public String fingerprint;
public String safety_number;
public JsonRequest request;
JsonUntrustedIdentityException(IdentityKey key, String number, Manager m) {
JsonUntrustedIdentityException(IdentityKey key, String number, Manager m, JsonRequest request) {
this.username = m.getUsername();
this.number = number;
this.fingerprint = Hex.toStringCondensed(key.getPublicKey().serialize());
this.safety_number = m.computeSafetyNumber(this.number, key);
this.request = request;
}
}
......@@ -276,7 +276,7 @@ public class SocketHandler implements Runnable {
SendMessageResult.IdentityFailure identityFailure = result.getIdentityFailure();
if(identityFailure != null) {
this.reply("untrusted_identity", new JsonUntrustedIdentityException(identityFailure.getIdentityKey(), result.getAddress().getNumber(), manager), request.id);
this.reply("untrusted_identity", new JsonUntrustedIdentityException(identityFailure.getIdentityKey(), result.getAddress().getNumber(), manager, request), request.id);
}
}
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment