Commit e3abff5a authored by Torsten Grote's avatar Torsten Grote

Refactor PrivateMessageHeader to ConversationMessageHeader base-class

This is preparation for adding attachments to private messages
parent 391732b2
......@@ -43,7 +43,7 @@ import org.briarproject.briar.api.feed.FeedManager;
import org.briarproject.briar.api.forum.ForumManager;
import org.briarproject.briar.api.forum.ForumSharingManager;
import org.briarproject.briar.api.introduction.IntroductionManager;
import org.briarproject.briar.api.messaging.ConversationManager;
import org.briarproject.briar.api.conversation.ConversationManager;
import org.briarproject.briar.api.messaging.MessagingManager;
import org.briarproject.briar.api.messaging.PrivateMessageFactory;
import org.briarproject.briar.api.privategroup.GroupMessageFactory;
......
......@@ -36,7 +36,7 @@ import org.briarproject.briar.android.keyagreement.ContactExchangeActivity;
import org.briarproject.briar.android.view.BriarRecyclerView;
import org.briarproject.briar.api.android.AndroidNotificationManager;
import org.briarproject.briar.api.client.MessageTracker.GroupCount;
import org.briarproject.briar.api.messaging.ConversationManager;
import org.briarproject.briar.api.conversation.ConversationManager;
import org.briarproject.briar.api.messaging.PrivateMessageHeader;
import org.briarproject.briar.api.messaging.event.PrivateMessageReceivedEvent;
......
......@@ -63,15 +63,16 @@ import org.briarproject.briar.api.android.AndroidNotificationManager;
import org.briarproject.briar.api.blog.BlogSharingManager;
import org.briarproject.briar.api.client.ProtocolStateException;
import org.briarproject.briar.api.client.SessionId;
import org.briarproject.briar.api.conversation.ConversationMessageHeader;
import org.briarproject.briar.api.forum.ForumSharingManager;
import org.briarproject.briar.api.introduction.IntroductionManager;
import org.briarproject.briar.api.messaging.ConversationManager;
import org.briarproject.briar.api.conversation.ConversationManager;
import org.briarproject.briar.api.messaging.MessagingManager;
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.conversation.ConversationRequest;
import org.briarproject.briar.api.conversation.ConversationResponse;
import org.briarproject.briar.api.messaging.event.PrivateMessageReceivedEvent;
import org.briarproject.briar.api.privategroup.invitation.GroupInvitationManager;
......@@ -326,7 +327,7 @@ public class ConversationActivity extends BriarActivity
runOnDbThread(() -> {
try {
long start = now();
Collection<PrivateMessageHeader> headers =
Collection<ConversationMessageHeader> headers =
conversationManager.getMessageHeaders(contactId);
logDuration(LOG, "Loading messages", start);
displayMessages(revision, headers);
......@@ -339,7 +340,7 @@ public class ConversationActivity extends BriarActivity
}
private void displayMessages(int revision,
Collection<PrivateMessageHeader> headers) {
Collection<ConversationMessageHeader> headers) {
runOnUiThreadUnlessDestroyed(() -> {
if (revision == adapter.getRevision()) {
adapter.incrementRevision();
......@@ -363,9 +364,10 @@ public class ConversationActivity extends BriarActivity
*/
@SuppressWarnings("ConstantConditions")
private List<ConversationItem> createItems(
Collection<PrivateMessageHeader> headers) {
Collection<ConversationMessageHeader> headers) {
List<ConversationItem> items = new ArrayList<>(headers.size());
for (PrivateMessageHeader h : headers) items.add(h.accept(visitor));
for (ConversationMessageHeader h : headers)
items.add(h.accept(visitor));
return items;
}
......@@ -449,9 +451,10 @@ public class ConversationActivity extends BriarActivity
});
}
private void onNewPrivateMessage(PrivateMessageHeader h) {
private void onNewPrivateMessage(ConversationMessageHeader h) {
runOnUiThreadUnlessDestroyed(() -> {
if (h instanceof PrivateRequest || h instanceof PrivateResponse) {
if (h instanceof ConversationRequest ||
h instanceof ConversationResponse) {
// contact name might not have been loaded
observeOnce(viewModel.getContactDisplayName(), this,
name -> addConversationItem(h.accept(visitor)));
......
......@@ -6,7 +6,7 @@ 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.R;
import org.briarproject.briar.api.messaging.PrivateResponse;
import org.briarproject.briar.api.conversation.ConversationResponse;
import javax.annotation.Nullable;
import javax.annotation.concurrent.NotThreadSafe;
......@@ -24,7 +24,7 @@ class ConversationNoticeInItem extends ConversationItem {
this.msgText = msgText;
}
ConversationNoticeInItem(String text, PrivateResponse r) {
ConversationNoticeInItem(String text, ConversationResponse r) {
super(r.getId(), r.getGroupId(), text, r.getTimestamp(), r.isRead());
this.msgText = null;
}
......
......@@ -4,8 +4,8 @@ import android.support.annotation.LayoutRes;
import org.briarproject.bramble.api.nullsafety.NotNullByDefault;
import org.briarproject.briar.R;
import org.briarproject.briar.api.messaging.PrivateRequest;
import org.briarproject.briar.api.messaging.PrivateResponse;
import org.briarproject.briar.api.conversation.ConversationRequest;
import org.briarproject.briar.api.conversation.ConversationResponse;
import javax.annotation.Nullable;
import javax.annotation.concurrent.NotThreadSafe;
......@@ -17,13 +17,13 @@ class ConversationNoticeOutItem extends ConversationOutItem {
@Nullable
private final String msgText;
ConversationNoticeOutItem(String text, PrivateRequest r) {
ConversationNoticeOutItem(String text, ConversationRequest r) {
super(r.getId(), r.getGroupId(), text, r.getTimestamp(), r.isSent(),
r.isSeen());
this.msgText = r.getText();
}
ConversationNoticeOutItem(String text, PrivateResponse r) {
ConversationNoticeOutItem(String text, ConversationResponse r) {
super(r.getId(), r.getGroupId(), text, r.getTimestamp(), r.isSent(),
r.isSeen());
this.msgText = null;
......
......@@ -6,7 +6,7 @@ import org.briarproject.bramble.api.nullsafety.NotNullByDefault;
import org.briarproject.bramble.api.sync.GroupId;
import org.briarproject.briar.R;
import org.briarproject.briar.api.client.SessionId;
import org.briarproject.briar.api.messaging.PrivateRequest;
import org.briarproject.briar.api.conversation.ConversationRequest;
import org.briarproject.briar.api.sharing.InvitationRequest;
import org.briarproject.briar.api.sharing.Shareable;
......@@ -26,7 +26,7 @@ class ConversationRequestItem extends ConversationNoticeInItem {
private final boolean canBeOpened;
private boolean answered;
ConversationRequestItem(String text, RequestType type, PrivateRequest r) {
ConversationRequestItem(String text, RequestType type, ConversationRequest r) {
super(r.getId(), r.getGroupId(), text, r.getText(),
r.getTimestamp(), r.isRead());
this.requestType = type;
......
......@@ -14,7 +14,7 @@ import org.briarproject.briar.api.forum.ForumInvitationResponse;
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.PrivateMessageVisitor;
import org.briarproject.briar.api.conversation.ConversationMessageVisitor;
import org.briarproject.briar.api.privategroup.invitation.GroupInvitationRequest;
import org.briarproject.briar.api.privategroup.invitation.GroupInvitationResponse;
......@@ -28,7 +28,8 @@ import static org.briarproject.briar.android.util.UiUtils.getContactDisplayName;
@UiThread
@NotNullByDefault
class ConversationVisitor implements PrivateMessageVisitor<ConversationItem> {
class ConversationVisitor implements
ConversationMessageVisitor<ConversationItem> {
private final Context ctx;
private final TextCache textCache;
......
......@@ -20,7 +20,7 @@ import org.briarproject.briar.android.contact.ContactListItem;
import org.briarproject.briar.android.fragment.BaseFragment;
import org.briarproject.briar.android.view.BriarRecyclerView;
import org.briarproject.briar.api.client.MessageTracker.GroupCount;
import org.briarproject.briar.api.messaging.ConversationManager;
import org.briarproject.briar.api.conversation.ConversationManager;
import java.util.ArrayList;
import java.util.List;
......
......@@ -14,7 +14,7 @@ import org.briarproject.bramble.api.system.Clock;
import org.briarproject.briar.android.contactselection.ContactSelectorControllerImpl;
import org.briarproject.briar.android.controller.handler.ExceptionHandler;
import org.briarproject.briar.api.blog.BlogSharingManager;
import org.briarproject.briar.api.messaging.ConversationManager;
import org.briarproject.briar.api.conversation.ConversationManager;
import java.util.Collection;
import java.util.concurrent.Executor;
......
......@@ -14,7 +14,7 @@ import org.briarproject.bramble.api.system.Clock;
import org.briarproject.briar.android.contactselection.ContactSelectorControllerImpl;
import org.briarproject.briar.android.controller.handler.ExceptionHandler;
import org.briarproject.briar.api.forum.ForumSharingManager;
import org.briarproject.briar.api.messaging.ConversationManager;
import org.briarproject.briar.api.conversation.ConversationManager;
import java.util.Collection;
import java.util.concurrent.Executor;
......
......@@ -4,7 +4,7 @@ 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.PrivateMessageVisitor;
import org.briarproject.briar.api.conversation.ConversationMessageVisitor;
import org.briarproject.briar.api.sharing.InvitationRequest;
import javax.annotation.Nullable;
......@@ -21,7 +21,7 @@ public class BlogInvitationRequest extends InvitationRequest<Blog> {
}
@Override
public <T> T accept(PrivateMessageVisitor<T> v) {
public <T> T accept(ConversationMessageVisitor<T> v) {
return v.visitBlogInvitationRequest(this);
}
}
......@@ -4,7 +4,7 @@ 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.PrivateMessageVisitor;
import org.briarproject.briar.api.conversation.ConversationMessageVisitor;
import org.briarproject.briar.api.sharing.InvitationResponse;
@NotNullByDefault
......@@ -18,7 +18,7 @@ public class BlogInvitationResponse extends InvitationResponse {
}
@Override
public <T> T accept(PrivateMessageVisitor<T> v) {
public <T> T accept(ConversationMessageVisitor<T> v) {
return v.visitBlogInvitationResponse(this);
}
}
......@@ -3,17 +3,17 @@ 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.messaging.PrivateRequest;
import org.briarproject.briar.api.messaging.event.PrivateMessageReceivedEvent;
import org.briarproject.briar.api.conversation.ConversationRequest;
import org.briarproject.briar.api.conversation.event.ConversationMessageReceivedEvent;
import javax.annotation.concurrent.Immutable;
@Immutable
@NotNullByDefault
public class BlogInvitationRequestReceivedEvent extends
PrivateMessageReceivedEvent<PrivateRequest<Blog>> {
ConversationMessageReceivedEvent<ConversationRequest<Blog>> {
public BlogInvitationRequestReceivedEvent(PrivateRequest<Blog> request,
public BlogInvitationRequestReceivedEvent(ConversationRequest<Blog> request,
ContactId contactId) {
super(request, contactId);
}
......
......@@ -3,14 +3,14 @@ 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.BlogInvitationResponse;
import org.briarproject.briar.api.messaging.event.PrivateMessageReceivedEvent;
import org.briarproject.briar.api.conversation.event.ConversationMessageReceivedEvent;
import javax.annotation.concurrent.Immutable;
@Immutable
@NotNullByDefault
public class BlogInvitationResponseReceivedEvent
extends PrivateMessageReceivedEvent<BlogInvitationResponse> {
extends ConversationMessageReceivedEvent<BlogInvitationResponse> {
public BlogInvitationResponseReceivedEvent(BlogInvitationResponse response,
ContactId contactId) {
......
package org.briarproject.briar.api.messaging;
package org.briarproject.briar.api.conversation;
import org.briarproject.bramble.api.contact.Contact;
import org.briarproject.bramble.api.contact.ContactId;
......@@ -9,6 +9,7 @@ import org.briarproject.bramble.api.sync.Group;
import org.briarproject.bramble.api.sync.GroupId;
import org.briarproject.bramble.api.sync.MessageId;
import org.briarproject.briar.api.client.MessageTracker.GroupCount;
import org.briarproject.briar.api.messaging.MessagingManager;
import java.util.Collection;
......@@ -27,7 +28,7 @@ public interface ConversationManager {
* Only {@link MessagingManager} returns only headers.
* The others also return the message text.
*/
Collection<PrivateMessageHeader> getMessageHeaders(ContactId c)
Collection<ConversationMessageHeader> getMessageHeaders(ContactId c)
throws DbException;
/**
......@@ -40,7 +41,7 @@ public interface ConversationManager {
Group getContactGroup(Contact c);
Collection<PrivateMessageHeader> getMessageHeaders(Transaction txn,
Collection<ConversationMessageHeader> getMessageHeaders(Transaction txn,
ContactId contactId) throws DbException;
GroupCount getGroupCount(Transaction txn, ContactId c)
......
package org.briarproject.briar.api.conversation;
import org.briarproject.bramble.api.nullsafety.NotNullByDefault;
import org.briarproject.bramble.api.sync.GroupId;
import org.briarproject.bramble.api.sync.MessageId;
import javax.annotation.concurrent.Immutable;
@Immutable
@NotNullByDefault
public abstract class ConversationMessageHeader {
private final MessageId id;
private final GroupId groupId;
private final long timestamp;
private final boolean local, sent, seen, read;
public ConversationMessageHeader(MessageId id, GroupId groupId, long timestamp,
boolean local, boolean read, boolean sent, boolean seen) {
this.id = id;
this.groupId = groupId;
this.timestamp = timestamp;
this.local = local;
this.sent = sent;
this.seen = seen;
this.read = read;
}
public MessageId getId() {
return id;
}
public GroupId getGroupId() {
return groupId;
}
public long getTimestamp() {
return timestamp;
}
public boolean isLocal() {
return local;
}
public boolean isSent() {
return sent;
}
public boolean isSeen() {
return seen;
}
public boolean isRead() {
return read;
}
public abstract <T> T accept(ConversationMessageVisitor<T> v);
}
package org.briarproject.briar.api.messaging;
package org.briarproject.briar.api.conversation;
import org.briarproject.bramble.api.nullsafety.NotNullByDefault;
import org.briarproject.briar.api.blog.BlogInvitationRequest;
......@@ -7,11 +7,12 @@ import org.briarproject.briar.api.forum.ForumInvitationRequest;
import org.briarproject.briar.api.forum.ForumInvitationResponse;
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.privategroup.invitation.GroupInvitationRequest;
import org.briarproject.briar.api.privategroup.invitation.GroupInvitationResponse;
@NotNullByDefault
public interface PrivateMessageVisitor<T> {
public interface ConversationMessageVisitor<T> {
T visitPrivateMessageHeader(PrivateMessageHeader h);
......
package org.briarproject.briar.api.messaging;
package org.briarproject.briar.api.conversation;
import org.briarproject.bramble.api.Nameable;
import org.briarproject.bramble.api.nullsafety.NotNullByDefault;
......@@ -11,7 +11,8 @@ import javax.annotation.concurrent.Immutable;
@Immutable
@NotNullByDefault
public class PrivateRequest<N extends Nameable> extends PrivateMessageHeader {
public abstract class ConversationRequest<N extends Nameable>
extends ConversationMessageHeader {
private final SessionId sessionId;
private final N nameable;
......@@ -19,7 +20,7 @@ public class PrivateRequest<N extends Nameable> extends PrivateMessageHeader {
private final String text;
private final boolean answered;
public PrivateRequest(MessageId messageId, GroupId groupId, long time,
public ConversationRequest(MessageId messageId, GroupId groupId, long time,
boolean local, boolean sent, boolean seen, boolean read,
SessionId sessionId, N nameable, @Nullable String text,
boolean answered) {
......@@ -50,4 +51,5 @@ public class PrivateRequest<N extends Nameable> extends PrivateMessageHeader {
public boolean wasAnswered() {
return answered;
}
}
package org.briarproject.briar.api.messaging;
package org.briarproject.briar.api.conversation;
import org.briarproject.bramble.api.nullsafety.NotNullByDefault;
import org.briarproject.bramble.api.sync.GroupId;
......@@ -9,12 +9,12 @@ import javax.annotation.concurrent.Immutable;
@Immutable
@NotNullByDefault
public abstract class PrivateResponse extends PrivateMessageHeader {
public abstract class ConversationResponse extends ConversationMessageHeader {
private final SessionId sessionId;
private final boolean accepted;
public PrivateResponse(MessageId id, GroupId groupId, long time,
public ConversationResponse(MessageId id, GroupId groupId, long time,
boolean local, boolean sent, boolean seen, boolean read,
SessionId sessionId, boolean accepted) {
super(id, groupId, time, local, sent, seen, read);
......
package org.briarproject.briar.api.conversation.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.conversation.ConversationMessageHeader;
import javax.annotation.concurrent.Immutable;
/**
* An event that is broadcast when a new conversation message is received.
*/
@Immutable
@NotNullByDefault
public class ConversationMessageReceivedEvent<H extends ConversationMessageHeader>
extends Event {
private final H messageHeader;
private final ContactId contactId;
public ConversationMessageReceivedEvent(H messageHeader, ContactId contactId) {
this.messageHeader = messageHeader;
this.contactId = contactId;
}
public H getMessageHeader() {
return messageHeader;
}
public ContactId getContactId() {
return contactId;
}
}
......@@ -4,7 +4,7 @@ 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.PrivateMessageVisitor;
import org.briarproject.briar.api.conversation.ConversationMessageVisitor;
import org.briarproject.briar.api.sharing.InvitationRequest;
import javax.annotation.Nullable;
......@@ -23,7 +23,7 @@ public class ForumInvitationRequest extends InvitationRequest<Forum> {
}
@Override
public <T> T accept(PrivateMessageVisitor<T> v) {
public <T> T accept(ConversationMessageVisitor<T> v) {
return v.visitForumInvitationRequest(this);
}
}
......@@ -4,7 +4,7 @@ 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.PrivateMessageVisitor;
import org.briarproject.briar.api.conversation.ConversationMessageVisitor;
import org.briarproject.briar.api.sharing.InvitationResponse;
import javax.annotation.concurrent.Immutable;
......@@ -21,7 +21,7 @@ public class ForumInvitationResponse extends InvitationResponse {
}
@Override
public <T> T accept(PrivateMessageVisitor<T> v) {
public <T> T accept(ConversationMessageVisitor<T> v) {
return v.visitForumInvitationResponse(this);
}
}
......@@ -2,18 +2,18 @@ package org.briarproject.briar.api.forum.event;
import org.briarproject.bramble.api.contact.ContactId;
import org.briarproject.bramble.api.nullsafety.NotNullByDefault;
import org.briarproject.briar.api.conversation.ConversationRequest;
import org.briarproject.briar.api.conversation.event.ConversationMessageReceivedEvent;
import org.briarproject.briar.api.forum.Forum;
import org.briarproject.briar.api.messaging.PrivateRequest;
import org.briarproject.briar.api.messaging.event.PrivateMessageReceivedEvent;
import javax.annotation.concurrent.Immutable;
@Immutable
@NotNullByDefault
public class ForumInvitationRequestReceivedEvent extends
PrivateMessageReceivedEvent<PrivateRequest<Forum>> {
ConversationMessageReceivedEvent<ConversationRequest<Forum>> {
public ForumInvitationRequestReceivedEvent(PrivateRequest<Forum> request,
public ForumInvitationRequestReceivedEvent(ConversationRequest<Forum> request,
ContactId contactId) {
super(request, contactId);
}
......
......@@ -2,15 +2,15 @@ package org.briarproject.briar.api.forum.event;
import org.briarproject.bramble.api.contact.ContactId;
import org.briarproject.bramble.api.nullsafety.NotNullByDefault;
import org.briarproject.briar.api.conversation.event.ConversationMessageReceivedEvent;
import org.briarproject.briar.api.forum.ForumInvitationResponse;
import org.briarproject.briar.api.messaging.event.PrivateMessageReceivedEvent;
import javax.annotation.concurrent.Immutable;
@Immutable
@NotNullByDefault
public class ForumInvitationResponseReceivedEvent extends
PrivateMessageReceivedEvent<ForumInvitationResponse> {
ConversationMessageReceivedEvent<ForumInvitationResponse> {
public ForumInvitationResponseReceivedEvent(
ForumInvitationResponse response, ContactId contactId) {
......
......@@ -6,7 +6,7 @@ import org.briarproject.bramble.api.db.DbException;
import org.briarproject.bramble.api.nullsafety.NotNullByDefault;
import org.briarproject.bramble.api.sync.ClientId;
import org.briarproject.briar.api.client.SessionId;
import org.briarproject.briar.api.messaging.ConversationManager.ConversationClient;
import org.briarproject.briar.api.conversation.ConversationManager.ConversationClient;
import javax.annotation.Nullable;
......
......@@ -6,15 +6,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.messaging.PrivateMessageVisitor;
import org.briarproject.briar.api.messaging.PrivateRequest;
import org.briarproject.briar.api.conversation.ConversationMessageVisitor;
import org.briarproject.briar.api.conversation.ConversationRequest;
import javax.annotation.Nullable;
import javax.annotation.concurrent.Immutable;
@Immutable
@NotNullByDefault
public class IntroductionRequest extends PrivateRequest<Author> {
public class IntroductionRequest extends ConversationRequest<Author> {
private final AuthorInfo authorInfo;
......@@ -37,7 +37,7 @@ public class IntroductionRequest extends PrivateRequest<Author> {
}
@Override
public <T> T accept(PrivateMessageVisitor<T> v) {
public <T> T accept(ConversationMessageVisitor<T> v) {
return v.visitIntroductionRequest(this);
}
}
......@@ -6,8 +6,8 @@ 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.PrivateMessageVisitor;
import org.briarproject.briar.api.messaging.PrivateResponse;
import org.briarproject.briar.api.conversation.ConversationMessageVisitor;
import org.briarproject.briar.api.conversation.ConversationResponse;
import javax.annotation.concurrent.Immutable;
......@@ -15,7 +15,7 @@ import static org.briarproject.briar.api.introduction.Role.INTRODUCER;
@Immutable
@NotNullByDefault
public class IntroductionResponse extends PrivateResponse {
public class IntroductionResponse extends ConversationResponse {
private final Author introducedAuthor;
private final AuthorInfo introducedAuthorInfo;
......@@ -45,7 +45,7 @@ public class IntroductionResponse extends PrivateResponse {
}
@Override
public <T> T accept(PrivateMessageVisitor<T> v) {
public <T> T accept(ConversationMessageVisitor<T> v) {
return v.visitIntroductionResponse(this);
}
}
......@@ -2,15 +2,15 @@ package org.briarproject.briar.api.introduction.event;
import org.briarproject.bramble.api.contact.ContactId;
import org.briarproject.bramble.api.nullsafety.NotNullByDefault;
import org.briarproject.briar.api.conversation.event.ConversationMessageReceivedEvent;
import org.briarproject.briar.api.introduction.IntroductionRequest;
import org.briarproject.briar.api.messaging.event.PrivateMessageReceivedEvent;
import javax.annotation.concurrent.Immutable;
@Immutable
@NotNullByDefault
public class IntroductionRequestReceivedEvent extends
PrivateMessageReceivedEvent<IntroductionRequest> {
public class IntroductionRequestReceivedEvent
extends ConversationMessageReceivedEvent<IntroductionRequest> {
public IntroductionRequestReceivedEvent(
IntroductionRequest introductionRequest, ContactId contactId) {
......
......@@ -2,15 +2,15 @@ package org.briarproject.briar.api.introduction.event;
import org.briarproject.bramble.api.contact.ContactId;
import org.briarproject.bramble.api.nullsafety.NotNullByDefault;
import org.briarproject.briar.api.conversation.event.ConversationMessageReceivedEvent;
import org.briarproject.briar.api.introduction.IntroductionResponse;
import org.briarproject.briar.api.messaging.event.PrivateMessageReceivedEvent;
import javax.annotation.concurrent.Immutable;
@Immutable
@NotNullByDefault
public class IntroductionResponseReceivedEvent extends
PrivateMessageReceivedEvent<IntroductionResponse> {
ConversationMessageReceivedEvent<IntroductionResponse> {