Let IntroductionResponse know if introduction can succeed

and use this information in the android UI for showing that the user
needs to wait or not.
This commit is contained in:
Torsten Grote
2019-03-26 14:58:59 -03:00
parent 3b4a92f66c
commit d40cfd30a2
7 changed files with 34 additions and 14 deletions

View File

@@ -20,16 +20,18 @@ public class IntroductionResponse extends ConversationResponse {
private final Author introducedAuthor;
private final AuthorInfo introducedAuthorInfo;
private final Role ourRole;
private final boolean canSucceed;
public IntroductionResponse(MessageId messageId, GroupId groupId, long time,
boolean local, boolean read, boolean sent, boolean seen,
SessionId sessionId, boolean accepted, Author author,
AuthorInfo introducedAuthorInfo, Role role) {
AuthorInfo introducedAuthorInfo, Role role, boolean canSucceed) {
super(messageId, groupId, time, local, read, sent, seen, sessionId,
accepted);
this.introducedAuthor = author;
this.introducedAuthorInfo = introducedAuthorInfo;
this.ourRole = role;
this.canSucceed = canSucceed;
}
public Author getIntroducedAuthor() {
@@ -40,6 +42,10 @@ public class IntroductionResponse extends ConversationResponse {
return introducedAuthorInfo;
}
public boolean canSucceed() {
return canSucceed;
}
public boolean isIntroducer() {
return ourRole == INTRODUCER;
}
@@ -48,4 +54,5 @@ public class IntroductionResponse extends ConversationResponse {
public <T> T accept(ConversationMessageVisitor<T> v) {
return v.visitIntroductionResponse(this);
}
}