Handle identity key mismatch on outgoing group messages.

Additionally, make the group creation process asynchronous.
This commit is contained in:
Moxie Marlinspike
2014-02-17 11:42:51 -08:00
parent 5810062b25
commit b9f4fba98a
19 changed files with 355 additions and 156 deletions

View File

@@ -5,7 +5,6 @@ import android.util.Log;
import com.google.thoughtcrimegson.Gson;
import com.google.thoughtcrimegson.JsonParseException;
import com.google.thoughtcrimegson.JsonSyntaxException;
import org.apache.http.conn.ssl.StrictHostnameVerifier;
import org.whispersystems.textsecure.crypto.IdentityKey;
@@ -27,7 +26,6 @@ import java.security.KeyStore;
import java.security.KeyStoreException;
import java.security.NoSuchAlgorithmException;
import java.security.cert.CertificateException;
import java.util.Iterator;
import java.util.LinkedList;
import java.util.List;
import java.util.Set;
@@ -94,7 +92,7 @@ public class PushServiceSocket {
try {
makeRequest(String.format(MESSAGE_PATH, bundle.getDestination()), "PUT", new Gson().toJson(bundle));
} catch (NotFoundException nfe) {
throw new UnregisteredUserException(nfe);
throw new UnregisteredUserException(bundle.getDestination(), nfe);
}
}

View File

@@ -5,8 +5,14 @@ import java.util.List;
public class UnregisteredUserException extends IOException {
public UnregisteredUserException(Exception exception) {
private final String e164number;
public UnregisteredUserException(String e164number, Exception exception) {
super(exception);
this.e164number = e164number;
}
public String getE164Number() {
return e164number;
}
}