BatchUpdate: Add more helper methods

Add new helper methods:

- getAccount
- getAccountId
- getIdentifiedUser

which will reduce the amount of code at call sites, for example:

  ctx.getAccount();

instead of:

  ctx.getUser().asIdentifiedUser().getAccount();

Change-Id: I946002e1cf70a77bc1fe3879edf5717ecac77fb7
This commit is contained in:
David Pursehouse
2016-07-13 13:59:47 +09:00
parent ef55d3a65c
commit ec7d18eedc
21 changed files with 64 additions and 47 deletions

View File

@@ -119,7 +119,7 @@ public class PutTopic implements RestModifyView<ChangeResource, Input>,
new ChangeMessage.Key(
change.getId(),
ChangeUtil.messageUUID(ctx.getDb())),
ctx.getUser().getAccountId(), ctx.getWhen(),
ctx.getAccountId(), ctx.getWhen(),
change.currentPatchSetId());
cmsg.setMessage(summary);
cmUtil.addChangeMessage(ctx.getDb(), update, cmsg);
@@ -130,7 +130,7 @@ public class PutTopic implements RestModifyView<ChangeResource, Input>,
public void postUpdate(Context ctx) {
if (change != null) {
topicEdited.fire(change,
ctx.getUser().asIdentifiedUser().getAccount(),
ctx.getAccount(),
oldTopicName,
ctx.getWhen());
}