avoid unnecessary roster sync in OMEMO code. fixed startup performance regression
This commit is contained in:
parent
837c212931
commit
f5da4791ad
|
@ -218,14 +218,12 @@ public class AxolotlService implements OnAdvancedStreamFeaturesLoaded {
|
||||||
deviceIds = store.getSubDeviceSessions(address);
|
deviceIds = store.getSubDeviceSessions(address);
|
||||||
putDevicesForJid(address, deviceIds, store);
|
putDevicesForJid(address, deviceIds, store);
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void put(SignalProtocolAddress address, XmppAxolotlSession value) {
|
public void put(SignalProtocolAddress address, XmppAxolotlSession value) {
|
||||||
super.put(address, value);
|
super.put(address, value);
|
||||||
value.setNotFresh();
|
value.setNotFresh();
|
||||||
xmppConnectionService.syncRosterToDisk(account); //TODO why?
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public void put(XmppAxolotlSession session) {
|
public void put(XmppAxolotlSession session) {
|
||||||
|
|
|
@ -956,7 +956,7 @@ public class DatabaseBackend extends SQLiteOpenHelper {
|
||||||
|
|
||||||
public List<String> getKnownSignalAddresses(Account account) {
|
public List<String> getKnownSignalAddresses(Account account) {
|
||||||
List<String> addresses = new ArrayList<>();
|
List<String> addresses = new ArrayList<>();
|
||||||
String[] colums = {SQLiteAxolotlStore.NAME};
|
String[] colums = {"DISTINCT "+SQLiteAxolotlStore.NAME};
|
||||||
String[] selectionArgs = {account.getUuid()};
|
String[] selectionArgs = {account.getUuid()};
|
||||||
Cursor cursor = getReadableDatabase().query(SQLiteAxolotlStore.SESSION_TABLENAME,
|
Cursor cursor = getReadableDatabase().query(SQLiteAxolotlStore.SESSION_TABLENAME,
|
||||||
colums,
|
colums,
|
||||||
|
@ -965,7 +965,7 @@ public class DatabaseBackend extends SQLiteOpenHelper {
|
||||||
null,null,null
|
null,null,null
|
||||||
);
|
);
|
||||||
while (cursor.moveToNext()) {
|
while (cursor.moveToNext()) {
|
||||||
addresses.add(cursor.getString(cursor.getColumnIndex(SQLiteAxolotlStore.NAME)));
|
addresses.add(cursor.getString(0));
|
||||||
}
|
}
|
||||||
cursor.close();
|
cursor.close();
|
||||||
return addresses;
|
return addresses;
|
||||||
|
|
Loading…
Reference in a new issue