Add api portion of resolvable comments

With this change, the unresolved field of a comment is now set by the
value supplied in the request body. If no value is supplied, the value
of the parent is used, and if no parent exists then comments default to
unresolved=false.

Change-Id: I4d2e16e42a78473b78b4e5b044687df4c5554963
This commit is contained in:
Kasper Nilsson
2016-12-20 14:13:21 -08:00
parent e6bb34fbf0
commit 7ec3036ab1
11 changed files with 156 additions and 52 deletions

View File

@@ -124,6 +124,7 @@ public final class PatchLineComment {
plc.setRevId(new RevId(c.revId));
plc.setStatus(status);
plc.setRealAuthor(c.getRealAuthor().getId());
plc.setUnresolved(c.unresolved);
return plc;
}
@@ -323,6 +324,14 @@ public final class PatchLineComment {
return tag;
}
public void setUnresolved(Boolean unresolved) {
this.unresolved = unresolved;
}
public Boolean getUnresolved() {
return unresolved;
}
public Comment asComment(String serverId) {
Comment c = new Comment(key.asCommentKey(), author, writtenOn, side,
message, serverId, unresolved);
@@ -349,7 +358,8 @@ public final class PatchLineComment {
&& Objects.equals(parentUuid, c.getParentUuid())
&& Objects.equals(range, c.getRange())
&& Objects.equals(revId, c.getRevId())
&& Objects.equals(tag, c.getTag());
&& Objects.equals(tag, c.getTag())
&& Objects.equals(unresolved, c.getUnresolved());
}
return false;
}