Address review comments (rename event, fix annotations, final field)

This commit is contained in:
Torsten Grote
2016-12-09 13:54:39 -02:00
parent d04dda1566
commit 7c6232db9d
9 changed files with 29 additions and 27 deletions

View File

@@ -26,7 +26,7 @@ import org.briarproject.briar.api.blog.BlogSharingManager;
import org.briarproject.briar.api.blog.event.BlogInvitationResponseReceivedEvent;
import org.briarproject.briar.api.blog.event.BlogPostAddedEvent;
import org.briarproject.briar.api.sharing.InvitationResponse;
import org.briarproject.briar.api.sharing.event.ShareableLeftEvent;
import org.briarproject.briar.api.sharing.event.ContactLeftShareableEvent;
import java.util.ArrayList;
import java.util.Collection;
@@ -110,10 +110,10 @@ class BlogControllerImpl extends BaseControllerImpl
LOG.info("Blog invitation accepted");
onBlogInvitationAccepted(b.getContactId());
}
} else if (e instanceof ShareableLeftEvent) {
ShareableLeftEvent s = (ShareableLeftEvent) e;
} else if (e instanceof ContactLeftShareableEvent) {
ContactLeftShareableEvent s = (ContactLeftShareableEvent) e;
if (s.getGroupId().equals(groupId)) {
LOG.info("Blog left");
LOG.info("Blog left by contact");
onBlogLeft(s.getContactId());
}
} else if (e instanceof GroupRemovedEvent) {

View File

@@ -18,7 +18,6 @@ import java.util.Set;
import javax.inject.Inject;
@UiThread
@NotNullByDefault
public class SharingControllerImpl implements SharingController, EventListener {
@@ -26,8 +25,9 @@ public class SharingControllerImpl implements SharingController, EventListener {
private final ConnectionRegistry connectionRegistry;
@Nullable
private SharingListener listener;
private Set<ContactId> contacts = new HashSet<>();
private volatile SharingListener listener;
// only access on @UiThread
private final Set<ContactId> contacts = new HashSet<>();
@Inject
SharingControllerImpl(EventBus eventBus,