From c499556d077131c33714452917410dc28c5bce4d Mon Sep 17 00:00:00 2001 From: Florian Schmaus Date: Tue, 2 Apr 2019 16:00:18 +0200 Subject: [PATCH] Remove dead code from OmemoService --- .../smackx/omemo/OmemoService.java | 86 ------------------- 1 file changed, 86 deletions(-) diff --git a/smack-omemo/src/main/java/org/jivesoftware/smackx/omemo/OmemoService.java b/smack-omemo/src/main/java/org/jivesoftware/smackx/omemo/OmemoService.java index 56d0c4d9f..34f0c3dcc 100644 --- a/smack-omemo/src/main/java/org/jivesoftware/smackx/omemo/OmemoService.java +++ b/smack-omemo/src/main/java/org/jivesoftware/smackx/omemo/OmemoService.java @@ -785,33 +785,6 @@ public abstract class OmemoService buildMissingSessionsWithContact(XMPPConnection connection, - OmemoDevice userDevice, - BareJid contact) - throws SmackException.NotConnectedException, InterruptedException, SmackException.NoResponseException { - - OmemoCachedDeviceList contactsDeviceIds = getOmemoStoreBackend().loadCachedDeviceList(userDevice, contact); - Set contactsDevices = new HashSet<>(); - for (int deviceId : contactsDeviceIds.getActiveDevices()) { - contactsDevices.add(new OmemoDevice(contact, deviceId)); - } - - return buildMissingSessionsWithDevices(connection, userDevice, contactsDevices); - } - /** * Build sessions with all devices from the set, we don't have a session with yet. * Return the set of all devices we have a session with afterwards. @@ -853,34 +826,6 @@ public abstract class OmemoService buildMissingSessionsWithContacts(XMPPConnection connection, - OmemoDevice userDevice, - Set contacts) - throws SmackException.NotConnectedException, InterruptedException, SmackException.NoResponseException { - - Set devicesWithSessions = new HashSet<>(); - - for (BareJid contact : contacts) { - Set devices = buildMissingSessionsWithContact(connection, userDevice, contact); - devicesWithSessions.addAll(devices); - } - - return devicesWithSessions; - } - /** * Return a set of all devices from the provided set, which trust level is undecided. * A device is also considered undecided, if its fingerprint cannot be loaded. @@ -913,37 +858,6 @@ public abstract class OmemoService getUntrustedDeviced(OmemoDevice userDevice, OmemoTrustCallback trustCallback, Set devices) { - Set untrustedDevices = new HashSet<>(); - - for (OmemoDevice device : devices) { - - OmemoFingerprint fingerprint; - try { - fingerprint = getOmemoStoreBackend().getFingerprint(userDevice, device); - } catch (CorruptedOmemoKeyException | NoIdentityKeyException e) { - // TODO: Best solution? - untrustedDevices.add(device); - continue; - } - - if (trustCallback.getTrust(device, fingerprint) == TrustState.untrusted) { - untrustedDevices.add(device); - } - } - - return untrustedDevices; - } - /** * Return true, if the OmemoManager of userDevice has a session with the contactsDevice. *