mirror of
https://code.briarproject.org/briar/briar.git
synced 2026-02-13 03:09:04 +01:00
Add client version to groups table.
This commit is contained in:
@@ -241,7 +241,8 @@ public interface DatabaseComponent {
|
||||
* <p/>
|
||||
* Read-only.
|
||||
*/
|
||||
Collection<Group> getGroups(Transaction txn, ClientId c) throws DbException;
|
||||
Collection<Group> getGroups(Transaction txn, ClientId c, int clientVersion)
|
||||
throws DbException;
|
||||
|
||||
/**
|
||||
* Returns the given group's visibility to the given contact, or
|
||||
|
||||
@@ -17,13 +17,16 @@ public class Group {
|
||||
|
||||
private final GroupId id;
|
||||
private final ClientId clientId;
|
||||
private final int clientVersion;
|
||||
private final byte[] descriptor;
|
||||
|
||||
public Group(GroupId id, ClientId clientId, byte[] descriptor) {
|
||||
public Group(GroupId id, ClientId clientId, int clientVersion,
|
||||
byte[] descriptor) {
|
||||
if (descriptor.length > MAX_GROUP_DESCRIPTOR_LENGTH)
|
||||
throw new IllegalArgumentException();
|
||||
this.id = id;
|
||||
this.clientId = clientId;
|
||||
this.clientVersion = clientVersion;
|
||||
this.descriptor = descriptor;
|
||||
}
|
||||
|
||||
@@ -41,6 +44,13 @@ public class Group {
|
||||
return clientId;
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the version of the client to which the group belongs.
|
||||
*/
|
||||
public int getClientVersion() {
|
||||
return clientVersion;
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the group's descriptor.
|
||||
*/
|
||||
|
||||
Reference in New Issue
Block a user