ReviewerAddedEvent: extend event with 'adder'
Several other events (ReviewerDeletedEvent, CommentAddedEvent, etc.) contain the event originator but this information is missing for ReviewerAddedEvent. Change-Id: I6112b898eb7d5a1d06bee5d21eaa1d66d5ff9cc9 Signed-off-by: Jacek Centkowski <jcentkowski@collab.net>
This commit is contained in:
parent
942a39cd53
commit
1d0df4d481
@ -234,6 +234,8 @@ patchSet:: link:json.html#patchSet[patchSet attribute]
|
|||||||
|
|
||||||
reviewer:: link:json.html#account[account attribute]
|
reviewer:: link:json.html#account[account attribute]
|
||||||
|
|
||||||
|
adder:: user that added the reviewer as link:json.html#account[account attribute]
|
||||||
|
|
||||||
eventCreatedOn:: Time in seconds since the UNIX epoch when this event was
|
eventCreatedOn:: Time in seconds since the UNIX epoch when this event was
|
||||||
created.
|
created.
|
||||||
|
|
||||||
|
@ -21,6 +21,7 @@ import com.google.gerrit.server.data.AccountAttribute;
|
|||||||
public class ReviewerAddedEvent extends PatchSetEvent {
|
public class ReviewerAddedEvent extends PatchSetEvent {
|
||||||
static final String TYPE = "reviewer-added";
|
static final String TYPE = "reviewer-added";
|
||||||
public Supplier<AccountAttribute> reviewer;
|
public Supplier<AccountAttribute> reviewer;
|
||||||
|
public Supplier<AccountAttribute> adder;
|
||||||
|
|
||||||
public ReviewerAddedEvent(Change change) {
|
public ReviewerAddedEvent(Change change) {
|
||||||
super(TYPE, change);
|
super(TYPE, change);
|
||||||
|
@ -317,6 +317,7 @@ public class StreamEventsApiListener
|
|||||||
|
|
||||||
event.change = changeAttributeSupplier(change, notes);
|
event.change = changeAttributeSupplier(change, notes);
|
||||||
event.patchSet = patchSetAttributeSupplier(change, psUtil.current(notes));
|
event.patchSet = patchSetAttributeSupplier(change, psUtil.current(notes));
|
||||||
|
event.adder = accountAttributeSupplier(ev.getWho());
|
||||||
for (AccountInfo reviewer : ev.getReviewers()) {
|
for (AccountInfo reviewer : ev.getReviewers()) {
|
||||||
event.reviewer = accountAttributeSupplier(reviewer);
|
event.reviewer = accountAttributeSupplier(reviewer);
|
||||||
dispatcher.run(d -> d.postEvent(event));
|
dispatcher.run(d -> d.postEvent(event));
|
||||||
|
Loading…
Reference in New Issue
Block a user