mirror of
https://code.briarproject.org/briar/briar.git
synced 2026-02-16 20:59:54 +01:00
Add sharing information to private group ActionBar subtitle
This commit is contained in:
@@ -402,7 +402,7 @@ class PrivateGroupManagerImpl extends BdfIncomingMessageHook
|
||||
try {
|
||||
Collection<GroupMember> members = new ArrayList<GroupMember>();
|
||||
Map<Author, Visibility> authors = getMembers(txn, g);
|
||||
LocalAuthor la = identityManager.getLocalAuthor();
|
||||
LocalAuthor la = identityManager.getLocalAuthor(txn);
|
||||
PrivateGroup privateGroup = getPrivateGroup(txn, g);
|
||||
for (Entry<Author, Visibility> m : authors.entrySet()) {
|
||||
Author a = m.getKey();
|
||||
@@ -488,7 +488,10 @@ class PrivateGroupManagerImpl extends BdfIncomingMessageHook
|
||||
if (!foundMember) throw new ProtocolStateException();
|
||||
if (changed) {
|
||||
clientHelper.mergeGroupMetadata(txn, g, meta);
|
||||
txn.attach(new ContactRelationshipRevealedEvent(g, a, v));
|
||||
LocalAuthor la = identityManager.getLocalAuthor(txn);
|
||||
ContactId c = contactManager.getContact(txn, a, la.getId()).getId();
|
||||
Event e = new ContactRelationshipRevealedEvent(g, a, c, v);
|
||||
txn.attach(e);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -255,7 +255,7 @@ class CreatorProtocolEngine extends AbstractProtocolEngine<CreatorSession> {
|
||||
GroupInvitationMessage m, ContactId c, boolean accept) {
|
||||
SessionId sessionId = new SessionId(m.getPrivateGroupId().getBytes());
|
||||
return new GroupInvitationResponse(m.getId(), sessionId,
|
||||
m.getContactGroupId(), c, accept, m.getTimestamp(), false,
|
||||
m.getPrivateGroupId(), c, accept, m.getTimestamp(), false,
|
||||
false, true, false);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -380,11 +380,11 @@ class GroupInvitationManagerImpl extends ConversationClientImpl
|
||||
messages.add(parseInvitationRequest(txn, c, contactGroupId,
|
||||
m, meta, status));
|
||||
} else if (type == JOIN) {
|
||||
messages.add(parseInvitationResponse(c, contactGroupId, m,
|
||||
meta, status, true));
|
||||
messages.add(
|
||||
parseInvitationResponse(c, m, meta, status, true));
|
||||
} else if (type == LEAVE) {
|
||||
messages.add(parseInvitationResponse(c, contactGroupId, m,
|
||||
meta, status, false));
|
||||
messages.add(
|
||||
parseInvitationResponse(c, m, meta, status, false));
|
||||
}
|
||||
}
|
||||
db.commitTransaction(txn);
|
||||
@@ -418,13 +418,13 @@ class GroupInvitationManagerImpl extends ConversationClientImpl
|
||||
}
|
||||
|
||||
private GroupInvitationResponse parseInvitationResponse(ContactId c,
|
||||
GroupId contactGroupId, MessageId m, MessageMetadata meta,
|
||||
MessageStatus status, boolean accept)
|
||||
throws DbException, FormatException {
|
||||
MessageId m, MessageMetadata meta, MessageStatus status,
|
||||
boolean accept) throws DbException, FormatException {
|
||||
SessionId sessionId = getSessionId(meta.getPrivateGroupId());
|
||||
return new GroupInvitationResponse(m, sessionId, contactGroupId, c,
|
||||
accept, meta.getTimestamp(), meta.isLocal(), status.isSent(),
|
||||
status.isSeen(), meta.isRead());
|
||||
return new GroupInvitationResponse(m, sessionId,
|
||||
meta.getPrivateGroupId(), c, accept, meta.getTimestamp(),
|
||||
meta.isLocal(), status.isSent(), status.isSeen(),
|
||||
meta.isRead());
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -441,6 +441,9 @@ public class PrivateGroupManagerIntegrationTest
|
||||
Collection<GroupMember> members2 = groupManager2.getMembers(groupId0);
|
||||
assertEquals(3, members2.size());
|
||||
|
||||
// 1 and 2 add each other
|
||||
addContacts1And2();
|
||||
|
||||
// assert that contact relationship is not revealed initially
|
||||
for (GroupMember m : members1) {
|
||||
if (m.getAuthor().equals(author2)) {
|
||||
|
||||
Reference in New Issue
Block a user