Only show Introduction Accept Information if success is still possible

This commit is contained in:
Torsten Grote
2018-04-28 11:27:43 -03:00
parent ebf73716bb
commit 1aec948f18
9 changed files with 43 additions and 10 deletions

View File

@@ -22,7 +22,7 @@ public class IntroductionRequest extends IntroductionResponse {
@Nullable String message, boolean answered, boolean exists) {
super(sessionId, messageId, groupId, role, time, local, sent, seen,
read, name, accepted);
read, name, accepted, false);
this.message = message;
this.answered = answered;
@@ -41,4 +41,11 @@ public class IntroductionRequest extends IntroductionResponse {
public boolean contactExists() {
return exists;
}
@Override
public boolean isSuccessPossible() {
// TODO fix this IntroductionMessage mess
throw new AssertionError();
}
}

View File

@@ -12,16 +12,18 @@ import javax.annotation.concurrent.Immutable;
public class IntroductionResponse extends IntroductionMessage {
private final String name;
private final boolean accepted;
private final boolean accepted, successPossible;
public IntroductionResponse(SessionId sessionId, MessageId messageId,
GroupId groupId, Role role, long time, boolean local, boolean sent,
boolean seen, boolean read, String name, boolean accepted) {
boolean seen, boolean read, String name, boolean accepted,
boolean successPossible) {
super(sessionId, messageId, groupId, role, time, local, sent, seen,
read);
this.name = name;
this.accepted = accepted;
this.successPossible = successPossible;
}
public String getName() {
@@ -32,4 +34,8 @@ public class IntroductionResponse extends IntroductionMessage {
return accepted;
}
public boolean isSuccessPossible() {
return successPossible;
}
}