Commit 031eac54 authored by akwizgran's avatar akwizgran

Add private message visitor.

parent 2c2596af
......@@ -4,6 +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.sharing.InvitationRequest;
import javax.annotation.Nullable;
......@@ -19,4 +20,8 @@ public class BlogInvitationRequest extends InvitationRequest<Blog> {
message, available, canBeOpened);
}
@Override
public void accept(PrivateMessageVisitor v) {
v.visitBlogInvitatioRequest(this);
}
}
......@@ -4,6 +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.sharing.InvitationResponse;
@NotNullByDefault
......@@ -16,4 +17,8 @@ public class BlogInvitationResponse extends InvitationResponse {
accept, shareableId);
}
@Override
public void accept(PrivateMessageVisitor v) {
v.visitBlogInvitationResponse(this);
}
}
......@@ -4,6 +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.sharing.InvitationRequest;
import javax.annotation.Nullable;
......@@ -21,4 +22,8 @@ public class ForumInvitationRequest extends InvitationRequest<Forum> {
message, available, canBeOpened);
}
@Override
public void accept(PrivateMessageVisitor v) {
v.visitForumInvitationRequest(this);
}
}
......@@ -4,6 +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.sharing.InvitationResponse;
import javax.annotation.concurrent.Immutable;
......@@ -19,4 +20,8 @@ public class ForumInvitationResponse extends InvitationResponse {
accept, shareableId);
}
@Override
public void accept(PrivateMessageVisitor v) {
v.visitForumInvitationResponse(this);
}
}
......@@ -5,6 +5,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.messaging.PrivateRequest;
import javax.annotation.Nullable;
......@@ -28,4 +29,9 @@ public class IntroductionRequest extends PrivateRequest<Author> {
public boolean isContact() {
return contact;
}
@Override
public void accept(PrivateMessageVisitor v) {
v.visitIntroductionRequest(this);
}
}
......@@ -5,6 +5,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.messaging.PrivateResponse;
import javax.annotation.concurrent.Immutable;
......@@ -35,4 +36,8 @@ public class IntroductionResponse extends PrivateResponse {
return ourRole == INTRODUCER;
}
@Override
public void accept(PrivateMessageVisitor v) {
v.visitIntroductionResponse(this);
}
}
......@@ -54,4 +54,7 @@ public class PrivateMessageHeader {
return read;
}
public void accept(PrivateMessageVisitor v) {
v.visitPrivateMessageHeader(this);
}
}
package org.briarproject.briar.api.messaging;
import org.briarproject.briar.api.blog.BlogInvitationRequest;
import org.briarproject.briar.api.blog.BlogInvitationResponse;
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.privategroup.invitation.GroupInvitationRequest;
import org.briarproject.briar.api.privategroup.invitation.GroupInvitationResponse;
public interface PrivateMessageVisitor {
void visitPrivateMessageHeader(PrivateMessageHeader h);
void visitBlogInvitatioRequest(BlogInvitationRequest r);
void visitBlogInvitationResponse(BlogInvitationResponse r);
void visitForumInvitationRequest(ForumInvitationRequest r);
void visitForumInvitationResponse(ForumInvitationResponse r);
void visitGroupInvitationRequest(GroupInvitationRequest r);
void visitGroupInvitationResponse(GroupInvitationResponse r);
void visitIntroductionRequest(IntroductionRequest r);
void visitIntroductionResponse(IntroductionResponse r);
}
......@@ -4,6 +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.privategroup.PrivateGroup;
import org.briarproject.briar.api.sharing.InvitationRequest;
......@@ -22,4 +23,8 @@ public class GroupInvitationRequest extends InvitationRequest<PrivateGroup> {
message, available, canBeOpened);
}
@Override
public void accept(PrivateMessageVisitor v) {
v.visitGroupInvitationRequest(this);
}
}
......@@ -4,6 +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.sharing.InvitationResponse;
import javax.annotation.concurrent.Immutable;
......@@ -19,4 +20,8 @@ public class GroupInvitationResponse extends InvitationResponse {
accept, shareableId);
}
@Override
public void accept(PrivateMessageVisitor v) {
v.visitGroupInvitationResponse(this);
}
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment