mirror of
https://code.briarproject.org/briar/briar.git
synced 2026-02-13 11:19:04 +01:00
Address review comments
This commit is contained in:
@@ -1,22 +1,23 @@
|
||||
package org.briarproject.api.introduction;
|
||||
|
||||
import org.briarproject.api.clients.SessionId;
|
||||
import org.briarproject.api.clients.BaseMessageHeader;
|
||||
import org.briarproject.api.clients.SessionId;
|
||||
import org.briarproject.api.sync.GroupId;
|
||||
import org.briarproject.api.sync.MessageId;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
|
||||
import static org.briarproject.api.introduction.IntroductionConstants.ROLE_INTRODUCEE;
|
||||
import static org.briarproject.api.introduction.IntroductionConstants.ROLE_INTRODUCER;
|
||||
|
||||
public class IntroductionMessage extends BaseMessageHeader {
|
||||
public class IntroductionMessage extends BaseMessageHeader {
|
||||
|
||||
private final SessionId sessionId;
|
||||
private final MessageId messageId;
|
||||
private final int role;
|
||||
|
||||
public IntroductionMessage(SessionId sessionId, MessageId messageId,
|
||||
GroupId groupId, int role, long time, boolean local, boolean sent,
|
||||
boolean seen, boolean read) {
|
||||
public IntroductionMessage(@NotNull SessionId sessionId,
|
||||
@NotNull MessageId messageId, @NotNull GroupId groupId, int role,
|
||||
long time, boolean local, boolean sent, boolean seen,
|
||||
boolean read) {
|
||||
|
||||
super(messageId, groupId, time, local, read, sent, seen);
|
||||
this.sessionId = sessionId;
|
||||
@@ -24,10 +25,12 @@ import static org.briarproject.api.introduction.IntroductionConstants.ROLE_INTRO
|
||||
this.role = role;
|
||||
}
|
||||
|
||||
@NotNull
|
||||
public SessionId getSessionId() {
|
||||
return sessionId;
|
||||
}
|
||||
|
||||
@NotNull
|
||||
public MessageId getMessageId() {
|
||||
return messageId;
|
||||
}
|
||||
@@ -36,9 +39,4 @@ import static org.briarproject.api.introduction.IntroductionConstants.ROLE_INTRO
|
||||
return role == ROLE_INTRODUCER;
|
||||
}
|
||||
|
||||
public boolean isIntroducee() {
|
||||
return role == ROLE_INTRODUCEE;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
@@ -4,16 +4,19 @@ import org.briarproject.api.clients.SessionId;
|
||||
import org.briarproject.api.identity.AuthorId;
|
||||
import org.briarproject.api.sync.GroupId;
|
||||
import org.briarproject.api.sync.MessageId;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
import org.jetbrains.annotations.Nullable;
|
||||
|
||||
public class IntroductionRequest extends IntroductionResponse {
|
||||
|
||||
private final String message;
|
||||
private final boolean answered, exists, introducesOtherIdentity;
|
||||
|
||||
public IntroductionRequest(SessionId sessionId, MessageId messageId,
|
||||
GroupId groupId, int role, long time, boolean local, boolean sent,
|
||||
boolean seen, boolean read, AuthorId authorId, String name,
|
||||
boolean accepted, String message, boolean answered, boolean exists,
|
||||
public IntroductionRequest(@NotNull SessionId sessionId,
|
||||
@NotNull MessageId messageId, @NotNull GroupId groupId, int role,
|
||||
long time, boolean local, boolean sent, boolean seen, boolean read,
|
||||
AuthorId authorId, String name, boolean accepted,
|
||||
@Nullable String message, boolean answered, boolean exists,
|
||||
boolean introducesOtherIdentity) {
|
||||
|
||||
super(sessionId, messageId, groupId, role, time, local, sent, seen,
|
||||
@@ -25,6 +28,7 @@ public class IntroductionRequest extends IntroductionResponse {
|
||||
this.introducesOtherIdentity = introducesOtherIdentity;
|
||||
}
|
||||
|
||||
@Nullable
|
||||
public String getMessage() {
|
||||
return message;
|
||||
}
|
||||
|
||||
@@ -4,6 +4,7 @@ import org.briarproject.api.clients.SessionId;
|
||||
import org.briarproject.api.identity.AuthorId;
|
||||
import org.briarproject.api.sync.GroupId;
|
||||
import org.briarproject.api.sync.MessageId;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
|
||||
public class IntroductionResponse extends IntroductionMessage {
|
||||
|
||||
@@ -11,10 +12,10 @@ public class IntroductionResponse extends IntroductionMessage {
|
||||
private final String name;
|
||||
private final boolean accepted;
|
||||
|
||||
public IntroductionResponse(SessionId sessionId, MessageId messageId,
|
||||
GroupId groupId, int role, long time, boolean local, boolean sent,
|
||||
boolean seen, boolean read, AuthorId remoteAuthorId, String name,
|
||||
boolean accepted) {
|
||||
public IntroductionResponse(@NotNull SessionId sessionId,
|
||||
@NotNull MessageId messageId, @NotNull GroupId groupId, int role,
|
||||
long time, boolean local, boolean sent, boolean seen, boolean read,
|
||||
AuthorId remoteAuthorId, String name, boolean accepted) {
|
||||
|
||||
super(sessionId, messageId, groupId, role, time, local, sent, seen,
|
||||
read);
|
||||
|
||||
Reference in New Issue
Block a user