delete omemo keys when deleting account
This commit is contained in:
parent
175d9f539e
commit
9276eff1db
|
@ -839,6 +839,13 @@ public class AxolotlService implements OnAdvancedStreamFeaturesLoaded {
|
|||
});
|
||||
}
|
||||
|
||||
public void deleteOmemoIdentity() {
|
||||
final String node = AxolotlService.PEP_BUNDLES + ":" + getOwnDeviceId();
|
||||
final IqPacket deleteBundleNode = mXmppConnectionService.getIqGenerator().deleteNode(node);
|
||||
mXmppConnectionService.sendIqPacket(account, deleteBundleNode, null);
|
||||
publishDeviceIdsAndRefineAccessModel(getOwnDeviceIds());
|
||||
}
|
||||
|
||||
public List<Jid> getCryptoTargets(Conversation conversation) {
|
||||
final List<Jid> jids;
|
||||
if (conversation.getMode() == Conversation.MODE_SINGLE) {
|
||||
|
|
|
@ -2199,6 +2199,7 @@ public class XmppConnectionService extends Service {
|
|||
|
||||
public void deleteAccount(final Account account) {
|
||||
synchronized (this.conversations) {
|
||||
account.getAxolotlService().deleteOmemoIdentity();
|
||||
for (final Conversation conversation : conversations) {
|
||||
if (conversation.getAccount() == account) {
|
||||
if (conversation.getMode() == Conversation.MODE_MULTI) {
|
||||
|
@ -2209,7 +2210,7 @@ public class XmppConnectionService extends Service {
|
|||
}
|
||||
}
|
||||
if (account.getXmppConnection() != null) {
|
||||
new Thread(() -> disconnect(account, true)).start();
|
||||
new Thread(() -> disconnect(account, false)).start();
|
||||
}
|
||||
final Runnable runnable = () -> {
|
||||
if (!databaseBackend.deleteAccount(account)) {
|
||||
|
|
Loading…
Reference in a new issue