Merge branch '732-reveal-backennd' into 'master'

Add support for revealing contacts to the PrivateGroupManager

This also adds three integration tests and improves some small details here and there in the private group client.

Prerequisite for #732.

See merge request !396
This commit is contained in:
akwizgran
2016-11-10 17:00:31 +00:00
16 changed files with 582 additions and 208 deletions
@@ -105,7 +105,7 @@ public class GroupActivity extends
ActionBar actionBar = getSupportActionBar();
if (actionBar != null) {
actionBar.setSubtitle(getString(R.string.groups_created_by,
group.getAuthor().getName()));
group.getCreator().getName()));
}
controller.isCreator(group,
new UiResultExceptionHandler<Boolean, DbException>(this) {
@@ -196,7 +196,7 @@ public class GroupControllerImpl extends
try {
LocalAuthor author = identityManager.getLocalAuthor();
boolean isCreator =
author.getId().equals(group.getAuthor().getId());
author.getId().equals(group.getCreator().getId());
handler.onResult(isCreator);
} catch (DbException e) {
if (LOG.isLoggable(WARNING))
@@ -117,7 +117,7 @@ public class CreateGroupControllerImpl extends DbControllerImpl
public void run() {
LOG.info("Adding group to database...");
try {
groupManager.addPrivateGroup(group, joinMsg);
groupManager.addPrivateGroup(group, joinMsg, true);
handler.onResult(group.getId());
} catch (DbException e) {
if (LOG.isLoggable(WARNING))
@@ -43,7 +43,7 @@ class GroupItem {
}
Author getCreator() {
return privateGroup.getAuthor();
return privateGroup.getCreator();
}
String getName() {
@@ -7,6 +7,8 @@ import org.briarproject.api.privategroup.GroupMember;
import javax.annotation.concurrent.Immutable;
import static org.briarproject.api.privategroup.Visibility.INVISIBLE;
@Immutable
@NotNullByDefault
class MemberListItem {
@@ -17,7 +19,7 @@ class MemberListItem {
public MemberListItem(GroupMember groupMember) {
this.member = groupMember.getAuthor();
this.sharing = groupMember.isShared();
this.sharing = groupMember.getVisibility() != INVISIBLE; // TODO #732
this.status = groupMember.getStatus();
}