mirror of
https://github.com/oxen-io/session-android.git
synced 2025-12-05 07:32:14 +00:00
Handle identity key mismatch on outgoing group messages.
Additionally, make the group creation process asynchronous.
This commit is contained in:
@@ -92,8 +92,7 @@ public class MmsSender {
|
||||
Recipients recipients = threads.getRecipientsForThreadId(threadId);
|
||||
MessageNotifier.notifyMessageDeliveryFailed(context, recipients, threadId);
|
||||
} catch (UntrustedIdentityException uie) {
|
||||
IncomingTextMessage base = new IncomingTextMessage(message);
|
||||
IncomingIdentityUpdateMessage identityUpdateMessage = new IncomingIdentityUpdateMessage(base, Base64.encodeBytesWithoutPadding(uie.getIdentityKey().serialize()));
|
||||
IncomingIdentityUpdateMessage identityUpdateMessage = IncomingIdentityUpdateMessage.createFor(message.getTo()[0].getString(), uie.getIdentityKey());
|
||||
DatabaseFactory.getEncryptingSmsDatabase(context).insertMessageInbox(masterSecret, identityUpdateMessage);
|
||||
database.markAsSentFailed(messageId);
|
||||
} catch (RetryLaterException e) {
|
||||
|
||||
@@ -81,8 +81,7 @@ public class SmsSender {
|
||||
transport.deliver(record);
|
||||
} catch (UntrustedIdentityException e) {
|
||||
Log.w("SmsSender", e);
|
||||
IncomingTextMessage base = new IncomingTextMessage(record);
|
||||
IncomingIdentityUpdateMessage identityUpdateMessage = new IncomingIdentityUpdateMessage(base, Base64.encodeBytesWithoutPadding(e.getIdentityKey().serialize()));
|
||||
IncomingIdentityUpdateMessage identityUpdateMessage = IncomingIdentityUpdateMessage.createFor(e.getE164Number(), e.getIdentityKey());
|
||||
DatabaseFactory.getEncryptingSmsDatabase(context).insertMessageInbox(masterSecret, identityUpdateMessage);
|
||||
DatabaseFactory.getSmsDatabase(context).markAsSentFailed(messageId);
|
||||
} catch (UndeliverableMessageException ude) {
|
||||
|
||||
Reference in New Issue
Block a user