Commit 61e18f10 authored by Torsten Grote's avatar Torsten Grote

Unify all private message responses in one PrivateResponse class

This also adds `Shareable`s to invitation response
which is a precondition for #561
parent ffeca881
......@@ -25,7 +25,7 @@ import org.briarproject.briar.api.blog.BlogManager;
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.messaging.PrivateResponse;
import org.briarproject.briar.api.sharing.event.ContactLeftShareableEvent;
import java.util.ArrayList;
......@@ -107,8 +107,8 @@ class BlogControllerImpl extends BaseControllerImpl
} else if (e instanceof BlogInvitationResponseReceivedEvent) {
BlogInvitationResponseReceivedEvent b =
(BlogInvitationResponseReceivedEvent) e;
InvitationResponse r = b.getResponse();
if (r.getShareableId().equals(groupId) && r.wasAccepted()) {
PrivateResponse<Blog> r = b.getResponse();
if (r.getObject().getId().equals(groupId) && r.wasAccepted()) {
LOG.info("Blog invitation accepted");
onBlogInvitationAccepted(b.getContactId());
}
......
......@@ -44,8 +44,8 @@ import org.briarproject.briar.api.introduction.event.IntroductionResponseReceive
import org.briarproject.briar.api.messaging.ConversationManager;
import org.briarproject.briar.api.messaging.PrivateMessageHeader;
import org.briarproject.briar.api.messaging.PrivateRequest;
import org.briarproject.briar.api.messaging.PrivateResponse;
import org.briarproject.briar.api.messaging.event.PrivateMessageReceivedEvent;
import org.briarproject.briar.api.sharing.InvitationResponse;
import org.briarproject.briar.api.sharing.event.InvitationRequestReceivedEvent;
import org.briarproject.briar.api.sharing.event.InvitationResponseReceivedEvent;
......@@ -277,7 +277,7 @@ public class ContactListFragment extends BaseFragment implements EventListener {
LOG.info("Invitation response received, updating item");
InvitationResponseReceivedEvent m =
(InvitationResponseReceivedEvent) e;
InvitationResponse ir = m.getResponse();
PrivateResponse ir = m.getResponse();
updateItem(m.getContactId(), ir);
}
}
......
......@@ -71,9 +71,9 @@ import org.briarproject.briar.api.messaging.PrivateMessage;
import org.briarproject.briar.api.messaging.PrivateMessageFactory;
import org.briarproject.briar.api.messaging.PrivateMessageHeader;
import org.briarproject.briar.api.messaging.PrivateRequest;
import org.briarproject.briar.api.messaging.PrivateResponse;
import org.briarproject.briar.api.messaging.event.PrivateMessageReceivedEvent;
import org.briarproject.briar.api.privategroup.invitation.GroupInvitationManager;
import org.briarproject.briar.api.sharing.InvitationResponse;
import org.briarproject.briar.api.sharing.event.InvitationRequestReceivedEvent;
import org.briarproject.briar.api.sharing.event.InvitationResponseReceivedEvent;
import org.thoughtcrime.securesms.components.util.FutureTaskListener;
......@@ -424,7 +424,7 @@ public class ConversationActivity extends BriarActivity
item = ConversationItem
.from(this, contactName, (PrivateRequest) i);
} else {
InvitationResponse r = (InvitationResponse) i;
PrivateResponse r = (PrivateResponse) i;
item = ConversationItem.from(this, contactName, r);
}
items.add(item);
......@@ -507,16 +507,16 @@ public class ConversationActivity extends BriarActivity
(IntroductionRequestReceivedEvent) e;
if (event.getContactId().equals(contactId)) {
LOG.info("Introduction request received, adding...");
IntroductionRequest ir = event.getIntroductionRequest();
handleIntroductionRequest(ir);
PrivateRequest ir = event.getIntroductionRequest();
handlePrivateRequest(ir);
}
} else if (e instanceof IntroductionResponseReceivedEvent) {
IntroductionResponseReceivedEvent event =
(IntroductionResponseReceivedEvent) e;
if (event.getContactId().equals(contactId)) {
LOG.info("Introduction response received, adding...");
IntroductionResponse ir = event.getIntroductionResponse();
handleIntroductionResponse(ir);
PrivateResponse ir = event.getIntroductionResponse();
handlePrivateResponse(ir);
}
} else if (e instanceof InvitationRequestReceivedEvent) {
InvitationRequestReceivedEvent event =
......@@ -524,15 +524,15 @@ public class ConversationActivity extends BriarActivity
if (event.getContactId().equals(contactId)) {
LOG.info("Invitation received, adding...");
PrivateRequest ir = event.getRequest();
handleInvitationRequest(ir);
handlePrivateRequest(ir);
}
} else if (e instanceof InvitationResponseReceivedEvent) {
InvitationResponseReceivedEvent event =
(InvitationResponseReceivedEvent) e;
if (event.getContactId().equals(contactId)) {
LOG.info("Invitation response received, adding...");
InvitationResponse ir = event.getResponse();
handleInvitationResponse(ir);
PrivateResponse ir = event.getResponse();
handlePrivateResponse(ir);
}
}
}
......@@ -546,7 +546,7 @@ public class ConversationActivity extends BriarActivity
});
}
private void handleIntroductionRequest(IntroductionRequest m) {
private void handlePrivateRequest(PrivateRequest m) {
getContactNameTask().addListener(new FutureTaskListener<String>() {
@Override
public void onSuccess(String contactName) {
......@@ -565,7 +565,7 @@ public class ConversationActivity extends BriarActivity
});
}
private void handleIntroductionResponse(IntroductionResponse m) {
private void handlePrivateResponse(PrivateResponse m) {
getContactNameTask().addListener(new FutureTaskListener<String>() {
@Override
public void onSuccess(String contactName) {
......@@ -584,46 +584,8 @@ public class ConversationActivity extends BriarActivity
});
}
private void handleInvitationRequest(PrivateRequest m) {
getContactNameTask().addListener(new FutureTaskListener<String>() {
@Override
public void onSuccess(String contactName) {
runOnUiThreadUnlessDestroyed(() -> {
ConversationItem item = ConversationItem
.from(ConversationActivity.this, contactName, m);
addConversationItem(item);
});
}
@Override
public void onFailure(Throwable exception) {
runOnUiThreadUnlessDestroyed(
() -> handleDbException((DbException) exception));
}
});
}
private void handleInvitationResponse(InvitationResponse m) {
getContactNameTask().addListener(new FutureTaskListener<String>() {
@Override
public void onSuccess(String contactName) {
runOnUiThreadUnlessDestroyed(() -> {
ConversationItem item = ConversationItem
.from(ConversationActivity.this, contactName, m);
addConversationItem(item);
});
}
@Override
public void onFailure(Throwable exception) {
runOnUiThreadUnlessDestroyed(
() -> handleDbException((DbException) exception));
}
});
}
private void markMessages(Collection<MessageId> messageIds,
boolean sent, boolean seen) {
private void markMessages(Collection<MessageId> messageIds, boolean sent,
boolean seen) {
runOnUiThreadUnlessDestroyed(() -> {
adapter.incrementRevision();
Set<MessageId> messages = new HashSet<>(messageIds);
......
......@@ -17,9 +17,9 @@ import org.briarproject.briar.api.introduction.IntroductionRequest;
import org.briarproject.briar.api.introduction.IntroductionResponse;
import org.briarproject.briar.api.messaging.PrivateMessageHeader;
import org.briarproject.briar.api.messaging.PrivateRequest;
import org.briarproject.briar.api.messaging.PrivateResponse;
import org.briarproject.briar.api.privategroup.invitation.GroupInvitationRequest;
import org.briarproject.briar.api.privategroup.invitation.GroupInvitationResponse;
import org.briarproject.briar.api.sharing.InvitationResponse;
import org.briarproject.briar.api.sharing.Shareable;
import javax.annotation.Nullable;
......@@ -87,46 +87,6 @@ abstract class ConversationItem {
}
}
static ConversationItem from(Context ctx, String contactName,
IntroductionResponse ir) {
if (ir.isLocal()) {
String text;
if (ir.wasAccepted()) {
text = ctx.getString(
R.string.introduction_response_accepted_sent,
ir.getName());
text += "\n\n" + ctx.getString(
R.string.introduction_response_accepted_sent_info,
ir.getName());
} else {
text = ctx.getString(
R.string.introduction_response_declined_sent,
ir.getName());
}
return new ConversationNoticeOutItem(ir.getId(), ir.getGroupId(),
text, null, ir.getTimestamp(), ir.isSent(), ir.isSeen());
} else {
String text;
if (ir.wasAccepted()) {
text = ctx.getString(
R.string.introduction_response_accepted_received,
contactName, ir.getName());
} else {
if (ir.isIntroducer()) {
text = ctx.getString(
R.string.introduction_response_declined_received,
contactName, ir.getName());
} else {
text = ctx.getString(
R.string.introduction_response_declined_received_by_introducee,
contactName, ir.getName());
}
}
return new ConversationNoticeInItem(ir.getId(), ir.getGroupId(),
text, null, ir.getTimestamp(), ir.isRead());
}
}
static ConversationItem from(Context ctx, String contactName,
PrivateRequest ir) {
if (ir.isLocal()) {
......@@ -196,7 +156,44 @@ abstract class ConversationItem {
}
static ConversationItem from(Context ctx, String contactName,
InvitationResponse ir) {
IntroductionResponse ir) {
if (ir.isLocal()) {
String text;
if (ir.wasAccepted()) {
text = ctx.getString(
R.string.introduction_response_accepted_sent,
ir.getObject().getName());
text += "\n\n" + ctx.getString(
R.string.introduction_response_accepted_sent_info,
ir.getObject().getName());
} else {
text = ctx.getString(
R.string.introduction_response_declined_sent,
ir.getObject().getName());
}
return new ConversationNoticeOutItem(ir.getId(), ir.getGroupId(),
text, null, ir.getTimestamp(), ir.isSent(), ir.isSeen());
} else {
@StringRes int res;
if (ir.wasAccepted()) {
res = R.string.introduction_response_accepted_received;
} else {
if (ir.getObject().isIntroducer()) {
res = R.string.introduction_response_declined_received;
} else {
res =
R.string.introduction_response_declined_received_by_introducee;
}
}
String text =
ctx.getString(res, contactName, ir.getObject().getName());
return new ConversationNoticeInItem(ir.getId(), ir.getGroupId(),
text, null, ir.getTimestamp(), ir.isRead());
}
}
static ConversationItem from(Context ctx, String contactName,
PrivateResponse ir) {
@StringRes int res;
if (ir.isLocal()) {
if (ir.wasAccepted()) {
......@@ -208,7 +205,7 @@ abstract class ConversationItem {
res = R.string.groups_invitations_response_accepted_sent;
} else {
throw new IllegalArgumentException(
"Unknown InvitationResponse");
"Unknown PrivateResponse");
}
} else {
if (ir instanceof ForumInvitationResponse) {
......@@ -219,7 +216,7 @@ abstract class ConversationItem {
res = R.string.groups_invitations_response_declined_sent;
} else {
throw new IllegalArgumentException(
"Unknown InvitationResponse");
"Unknown PrivateResponse");
}
}
String text = ctx.getString(res, contactName);
......@@ -235,7 +232,7 @@ abstract class ConversationItem {
res = R.string.groups_invitations_response_accepted_received;
} else {
throw new IllegalArgumentException(
"Unknown InvitationResponse");
"Unknown PrivateResponse");
}
} else {
if (ir instanceof ForumInvitationResponse) {
......@@ -246,7 +243,7 @@ abstract class ConversationItem {
res = R.string.groups_invitations_response_declined_received;
} else {
throw new IllegalArgumentException(
"Unknown InvitationResponse");
"Unknown PrivateResponse");
}
}
String text = ctx.getString(res, contactName);
......@@ -261,14 +258,12 @@ abstract class ConversationItem {
* PrivateMessageHeader.
**/
static ConversationItem from(Context ctx, PrivateMessageHeader h) {
if(h instanceof IntroductionRequest) {
return from(ctx, "", (IntroductionRequest) h);
} else if(h instanceof IntroductionResponse) {
if(h instanceof IntroductionResponse) {
return from(ctx, "", (IntroductionResponse) h);
} else if(h instanceof PrivateRequest) {
return from(ctx, "", (PrivateRequest) h);
} else if(h instanceof InvitationResponse) {
return from(ctx, "", (InvitationResponse) h);
} else if(h instanceof PrivateResponse) {
return from(ctx, "", (PrivateResponse) h);
} else {
return from(h);
}
......
......@@ -86,7 +86,7 @@ class ForumControllerImpl extends
(ForumInvitationResponseReceivedEvent) e;
ForumInvitationResponse r =
(ForumInvitationResponse) f.getResponse();
if (r.getShareableId().equals(getGroupId()) && r.wasAccepted()) {
if (r.getObject().getId().equals(getGroupId()) && r.wasAccepted()) {
LOG.info("Forum invitation was accepted");
onForumInvitationAccepted(f.getContactId());
}
......
......@@ -101,7 +101,7 @@ class GroupControllerImpl extends
(GroupInvitationResponseReceivedEvent) e;
GroupInvitationResponse r =
(GroupInvitationResponse) g.getResponse();
if (getGroupId().equals(r.getShareableId()) && r.wasAccepted()) {
if (getGroupId().equals(r.getObject().getId()) && r.wasAccepted()) {
listener.runOnUiThreadUnlessDestroyed(
() -> listener.onInvitationAccepted(g.getContactId()));
}
......
......@@ -4,15 +4,15 @@ import org.briarproject.bramble.api.nullsafety.NotNullByDefault;
import org.briarproject.bramble.api.sync.GroupId;
import org.briarproject.bramble.api.sync.MessageId;
import org.briarproject.briar.api.client.SessionId;
import org.briarproject.briar.api.sharing.InvitationResponse;
import org.briarproject.briar.api.messaging.PrivateResponse;
@NotNullByDefault
public class BlogInvitationResponse extends InvitationResponse {
public class BlogInvitationResponse extends PrivateResponse<Blog> {
public BlogInvitationResponse(MessageId id, GroupId groupId, long time,
boolean local, boolean sent, boolean seen, boolean read,
SessionId sessionId, GroupId blogId, boolean accept) {
super(id, groupId, time, local, sent, seen, read, sessionId, blogId,
SessionId sessionId, Blog blog, boolean accept) {
super(id, groupId, time, local, sent, seen, read, sessionId, blog,
accept);
}
......
......@@ -2,6 +2,7 @@ package org.briarproject.briar.api.blog.event;
import org.briarproject.bramble.api.contact.ContactId;
import org.briarproject.bramble.api.nullsafety.NotNullByDefault;
import org.briarproject.briar.api.blog.Blog;
import org.briarproject.briar.api.blog.BlogInvitationResponse;
import org.briarproject.briar.api.sharing.event.InvitationResponseReceivedEvent;
......@@ -10,7 +11,7 @@ import javax.annotation.concurrent.Immutable;
@Immutable
@NotNullByDefault
public class BlogInvitationResponseReceivedEvent
extends InvitationResponseReceivedEvent {
extends InvitationResponseReceivedEvent<Blog> {
public BlogInvitationResponseReceivedEvent(ContactId contactId,
BlogInvitationResponse response) {
......
......@@ -4,18 +4,18 @@ import org.briarproject.bramble.api.nullsafety.NotNullByDefault;
import org.briarproject.bramble.api.sync.GroupId;
import org.briarproject.bramble.api.sync.MessageId;
import org.briarproject.briar.api.client.SessionId;
import org.briarproject.briar.api.sharing.InvitationResponse;
import org.briarproject.briar.api.messaging.PrivateResponse;
import javax.annotation.concurrent.Immutable;
@Immutable
@NotNullByDefault
public class ForumInvitationResponse extends InvitationResponse {
public class ForumInvitationResponse extends PrivateResponse<Forum> {
public ForumInvitationResponse(MessageId id, GroupId groupId, long time,
boolean local, boolean sent, boolean seen, boolean read,
SessionId sessionId, GroupId forumId, boolean accept) {
super(id, groupId, time, local, sent, seen, read, sessionId, forumId,
SessionId sessionId, Forum forum, boolean accept) {
super(id, groupId, time, local, sent, seen, read, sessionId, forum,
accept);
}
......
......@@ -4,45 +4,19 @@ import org.briarproject.bramble.api.nullsafety.NotNullByDefault;
import org.briarproject.bramble.api.sync.GroupId;
import org.briarproject.bramble.api.sync.MessageId;
import org.briarproject.briar.api.client.SessionId;
import org.briarproject.briar.api.messaging.PrivateMessageHeader;
import org.briarproject.briar.api.messaging.PrivateResponse;
import javax.annotation.concurrent.Immutable;
import static org.briarproject.briar.api.introduction.Role.INTRODUCER;
@Immutable
@NotNullByDefault
public class IntroductionResponse extends PrivateMessageHeader {
private final SessionId sessionId;
private final String name;
private final Role role;
private final boolean accepted;
public IntroductionResponse(SessionId sessionId, MessageId messageId,
GroupId groupId, Role role, long time, boolean local, boolean sent,
boolean seen, boolean read, String name, boolean accepted) {
super(messageId, groupId, time, local, sent, seen, read);
this.sessionId = sessionId;
this.name = name;
this.role = role;
this.accepted = accepted;
}
public SessionId getSessionId() {
return sessionId;
}
public String getName() {
return name;
}
public boolean isIntroducer() {
return role == INTRODUCER;
}
public class IntroductionResponse extends PrivateResponse<Introduction> {
public boolean wasAccepted() {
return accepted;
public IntroductionResponse(MessageId messageId, GroupId groupId, long time,
boolean local, boolean sent, boolean seen, boolean read,
SessionId sessionId, Introduction introduction, boolean accepted) {
super(messageId, groupId, time, local, sent, seen, read, sessionId,
introduction, accepted);
}
}
package org.briarproject.briar.api.sharing;
package org.briarproject.briar.api.messaging;
import org.briarproject.bramble.api.nullsafety.NotNullByDefault;
import org.briarproject.bramble.api.sync.GroupId;
import org.briarproject.bramble.api.sync.MessageId;
import org.briarproject.briar.api.client.SessionId;
import org.briarproject.briar.api.messaging.PrivateMessageHeader;
import javax.annotation.concurrent.Immutable;
@Immutable
@NotNullByDefault
public abstract class InvitationResponse extends PrivateMessageHeader {
public abstract class PrivateResponse<O extends Nameable>
extends PrivateMessageHeader {
private final SessionId sessionId;
private final GroupId shareableId;
private final boolean accept;
private final O object;
private final boolean accepted;
public InvitationResponse(MessageId id, GroupId groupId,
long time, boolean local, boolean sent, boolean seen,
boolean read, SessionId sessionId, GroupId shareableId,
boolean accept) {
public PrivateResponse(MessageId id, GroupId groupId, long time,
boolean local, boolean sent, boolean seen, boolean read,
SessionId sessionId, O object, boolean accepted) {
super(id, groupId, time, local, sent, seen, read);
this.sessionId = sessionId;
this.shareableId = shareableId;
this.accept = accept;
this.object = object;
this.accepted = accepted;
}
public SessionId getSessionId() {
return sessionId;
}
public boolean wasAccepted() {
return accept;
public O getObject() {
return object;
}
public GroupId getShareableId() {
return shareableId;
public boolean wasAccepted() {
return accepted;
}
}
......@@ -2,7 +2,8 @@ package org.briarproject.briar.api.privategroup.event;
import org.briarproject.bramble.api.contact.ContactId;
import org.briarproject.bramble.api.nullsafety.NotNullByDefault;
import org.briarproject.briar.api.sharing.InvitationResponse;
import org.briarproject.briar.api.messaging.PrivateResponse;
import org.briarproject.briar.api.privategroup.PrivateGroup;
import org.briarproject.briar.api.sharing.event.InvitationResponseReceivedEvent;
import javax.annotation.concurrent.Immutable;
......@@ -10,10 +11,10 @@ import javax.annotation.concurrent.Immutable;
@Immutable
@NotNullByDefault
public class GroupInvitationResponseReceivedEvent
extends InvitationResponseReceivedEvent {
extends InvitationResponseReceivedEvent<PrivateGroup> {
public GroupInvitationResponseReceivedEvent(ContactId contactId,
InvitationResponse response) {
PrivateResponse<PrivateGroup> response) {
super(contactId, response);
}
}
......@@ -4,19 +4,20 @@ import org.briarproject.bramble.api.nullsafety.NotNullByDefault;
import org.briarproject.bramble.api.sync.GroupId;
import org.briarproject.bramble.api.sync.MessageId;
import org.briarproject.briar.api.client.SessionId;
import org.briarproject.briar.api.sharing.InvitationResponse;
import org.briarproject.briar.api.messaging.PrivateResponse;
import org.briarproject.briar.api.privategroup.PrivateGroup;
import javax.annotation.concurrent.Immutable;
@Immutable
@NotNullByDefault
public class GroupInvitationResponse extends InvitationResponse {
public class GroupInvitationResponse extends PrivateResponse<PrivateGroup> {
public GroupInvitationResponse(MessageId id, GroupId groupId, long time,
boolean local, boolean sent, boolean seen, boolean read,
SessionId sessionId, GroupId shareableId, boolean accept) {
SessionId sessionId, PrivateGroup privateGroup, boolean accept) {
super(id, groupId, time, local, sent, seen, read, sessionId,
shareableId, accept);
privateGroup, accept);
}
}
......@@ -3,19 +3,21 @@ package org.briarproject.briar.api.sharing.event;
import org.briarproject.bramble.api.contact.ContactId;
import org.briarproject.bramble.api.event.Event;
import org.briarproject.bramble.api.nullsafety.NotNullByDefault;
import org.briarproject.briar.api.sharing.InvitationResponse;
import org.briarproject.briar.api.messaging.PrivateResponse;
import org.briarproject.briar.api.sharing.Shareable;
import javax.annotation.concurrent.Immutable;
@Immutable
@NotNullByDefault
public abstract class InvitationResponseReceivedEvent extends Event {
public abstract class InvitationResponseReceivedEvent<S extends Shareable>
extends Event {
private final ContactId contactId;
private final InvitationResponse response;
private final PrivateResponse<S> response;
public InvitationResponseReceivedEvent(ContactId contactId,
InvitationResponse response) {
PrivateResponse<S> response) {
this.contactId = contactId;
this.response = response;
}
......@@ -24,7 +26,7 @@ public abstract class InvitationResponseReceivedEvent extends Event {
return contactId;
}
public InvitationResponse getResponse() {
public PrivateResponse<S> getResponse() {
return response;
}
}
......@@ -20,6 +20,7 @@ import org.briarproject.bramble.api.sync.MessageId;
import org.briarproject.bramble.api.system.Clock;
import org.briarproject.briar.api.client.MessageTracker;
import org.briarproject.briar.api.client.SessionId;
import org.briarproject.briar.api.introduction.Introduction;
import org.briarproject.briar.api.introduction.IntroductionResponse;
import org.briarproject.briar.api.introduction.event.IntroductionResponseReceivedEvent;
......@@ -147,12 +148,13 @@ abstract class AbstractProtocolEngine<S extends Session>
void broadcastIntroductionResponseReceivedEvent(Transaction txn, Session s,
AuthorId sender, Author otherAuthor, AbstractIntroductionMessage m)
throws DbException {
Introduction introduction = new Introduction(otherAuthor, s.getRole());
AuthorId localAuthorId = identityManager.getLocalAuthor(txn).getId();
Contact c = contactManager.getContact(txn, sender, localAuthorId);
IntroductionResponse response =
new IntroductionResponse(s.getSessionId(), m.getMessageId(),
m.getGroupId(), s.getRole(), m.getTimestamp(), false,
false, false, false, otherAuthor.getName(),
new IntroductionResponse(m.getMessageId(), m.getGroupId(),
m.getTimestamp(), false, false, false, false,
s.getSessionId(), introduction,
m instanceof AcceptMessage);
IntroductionResponseReceivedEvent e =
new IntroductionResponseReceivedEvent(c.getId(), response);
......
......@@ -509,9 +509,10 @@ class IntroductionManagerImpl extends ConversationClientImpl
sessionId = session.getSessionId();
author = session.getRemote().author;
} else throw new AssertionError();
return new IntroductionResponse(sessionId, m, contactGroupId,
role, meta.getTimestamp(), meta.isLocal(), status.isSent(),
status.isSeen(), meta.isRead(), author.getName(), accept);
Introduction introduction = new Introduction(author, role);
return new IntroductionResponse(m, contactGroupId, meta.getTimestamp(),
meta.isLocal(), status.isSent(), status.isSeen(), meta.isRead(),
sessionId, introduction, accept);
}
private void removeSessionWithIntroducer(Transaction txn,
......
......@@ -15,6 +15,7 @@ import org.briarproject.briar.api.client.MessageTracker;
import org.briarproject.briar.api.client.ProtocolStateException;
import org.briarproject.briar.api.client.SessionId;
import org.briarproject.briar.api.privategroup.GroupMessageFactory;
import org.briarproject.briar.api.privategroup.PrivateGroup;
import org.briarproject.briar.api.privategroup.PrivateGroupFactory;
import org.briarproject.briar.api.privategroup.PrivateGroupManager;
import org.briarproject.briar.api.privategroup.event.GroupInvitationResponseReceivedEvent;
......@@ -193,8 +194,10 @@ class CreatorProtocolEngine extends AbstractProtocolEngine<CreatorSession> {
setPrivateGroupVisibility(txn, s, SHARED);
// Broadcast an event
ContactId contactId = getContactId(txn, m.getContactGroupId());
PrivateGroup privateGroup =
privateGroupManager.getPrivateGroup(txn, m.getPrivateGroupId());