Merge branch 'client-version-update-events' into 'master'

Send ClientVersionUpdatedEvent for each client state change, not only on version updates

See merge request briar/briar!1724
This commit is contained in:
akwizgran
2022-10-31 12:36:25 +00:00

View File

@@ -228,15 +228,11 @@ class ClientVersioningManagerImpl implements ClientVersioningManager,
Contact contact = db.getContact(txn, c); Contact contact = db.getContact(txn, c);
callVisibilityHooks(txn, contact, before, after); callVisibilityHooks(txn, contact, before, after);
} }
// Broadcast events for any new client versions // Broadcast events for any client version update
Set<ClientVersion> oldRemoteVersions = new HashSet<>();
for (ClientState cs : oldRemoteStates) {
oldRemoteVersions.add(cs.clientVersion);
}
for (ClientState cs : newRemoteStates) { for (ClientState cs : newRemoteStates) {
if (!oldRemoteVersions.contains(cs.clientVersion)) { if (!oldRemoteStates.contains(cs)) {
txn.attach(new ClientVersionUpdatedEvent(c, txn.attach(
cs.clientVersion)); new ClientVersionUpdatedEvent(c, cs.clientVersion));
} }
} }
} catch (FormatException e) { } catch (FormatException e) {