diff options
author | Christian Schneppe <christian@pix-art.de> | 2017-08-01 13:36:19 +0200 |
---|---|---|
committer | Christian Schneppe <christian@pix-art.de> | 2017-08-01 13:36:19 +0200 |
commit | 62bddc494de8da7de7f59e789b415d666a210666 (patch) | |
tree | 13be9c1a9f12a22b7c09aeb4ce8d7a499b4fb704 /src/main | |
parent | 635b5d3341fe57680130c4d04f517709e61f05de (diff) |
avoid unnecessary roster sync in OMEMO code. fixed startup performance regression
Diffstat (limited to 'src/main')
-rw-r--r-- | src/main/java/de/pixart/messenger/crypto/axolotl/AxolotlService.java | 1 | ||||
-rw-r--r-- | src/main/java/de/pixart/messenger/persistance/DatabaseBackend.java | 4 |
2 files changed, 2 insertions, 3 deletions
diff --git a/src/main/java/de/pixart/messenger/crypto/axolotl/AxolotlService.java b/src/main/java/de/pixart/messenger/crypto/axolotl/AxolotlService.java index 697c0dec5..098586efa 100644 --- a/src/main/java/de/pixart/messenger/crypto/axolotl/AxolotlService.java +++ b/src/main/java/de/pixart/messenger/crypto/axolotl/AxolotlService.java @@ -224,7 +224,6 @@ public class AxolotlService implements OnAdvancedStreamFeaturesLoaded { public void put(SignalProtocolAddress address, XmppAxolotlSession value) { super.put(address, value); value.setNotFresh(); - xmppConnectionService.syncRosterToDisk(account); //TODO why? } public void put(XmppAxolotlSession session) { diff --git a/src/main/java/de/pixart/messenger/persistance/DatabaseBackend.java b/src/main/java/de/pixart/messenger/persistance/DatabaseBackend.java index 611a0b65d..b23212c83 100644 --- a/src/main/java/de/pixart/messenger/persistance/DatabaseBackend.java +++ b/src/main/java/de/pixart/messenger/persistance/DatabaseBackend.java @@ -967,7 +967,7 @@ public class DatabaseBackend extends SQLiteOpenHelper { public List<String> getKnownSignalAddresses(Account account) { List<String> addresses = new ArrayList<>(); - String[] colums = {SQLiteAxolotlStore.NAME}; + String[] colums = {"DISTINCT "+SQLiteAxolotlStore.NAME}; String[] selectionArgs = {account.getUuid()}; Cursor cursor = getReadableDatabase().query(SQLiteAxolotlStore.SESSION_TABLENAME, colums, @@ -976,7 +976,7 @@ public class DatabaseBackend extends SQLiteOpenHelper { null, null, null ); while (cursor.moveToNext()) { - addresses.add(cursor.getString(cursor.getColumnIndex(SQLiteAxolotlStore.NAME))); + addresses.add(cursor.getString(0)); } cursor.close(); return addresses; |