Fix promote / demote command inconsistencies (#609)

This commit is contained in:
Luck 2017-12-14 21:43:44 +00:00
parent 38e75da92f
commit 2e7a08c006
No known key found for this signature in database
GPG Key ID: EFA9B3EC5FD90F8B
2 changed files with 4 additions and 4 deletions

View File

@ -162,7 +162,7 @@ public class UserDemote extends SubCommand<User> {
Message.USER_DEMOTE_SUCCESS.send(sender, user.getFriendlyName(), track.getName(), old, previousGroup.getFriendlyName(), CommandUtils.contextSetToString(context)); Message.USER_DEMOTE_SUCCESS.send(sender, user.getFriendlyName(), track.getName(), old, previousGroup.getFriendlyName(), CommandUtils.contextSetToString(context));
if (!silent) { if (!silent) {
Message.EMPTY.send(sender, CommandUtils.listToArrowSep(track.getGroups(), previousGroup.getFriendlyName(), old, true)); Message.EMPTY.send(sender, CommandUtils.listToArrowSep(track.getGroups(), previousGroup.getName(), old, true));
} }
ExtendedLogEntry.build().actor(sender).acted(user) ExtendedLogEntry.build().actor(sender).acted(user)

View File

@ -116,9 +116,9 @@ public class UserPromote extends SubCommand<User> {
return CommandResult.NO_PERMISSION; return CommandResult.NO_PERMISSION;
} }
user.setPermission(NodeFactory.newBuilder("group." + first).withExtraContext(context).build()); user.setPermission(NodeFactory.newBuilder("group." + nextGroup.getId()).withExtraContext(context).build());
Message.USER_TRACK_ADDED_TO_FIRST.send(sender, user.getFriendlyName(), first, CommandUtils.contextSetToString(context)); Message.USER_TRACK_ADDED_TO_FIRST.send(sender, user.getFriendlyName(), nextGroup.getFriendlyName(), CommandUtils.contextSetToString(context));
ExtendedLogEntry.build().actor(sender).acted(user) ExtendedLogEntry.build().actor(sender).acted(user)
.action("promote", track.getName(), context) .action("promote", track.getName(), context)
@ -174,7 +174,7 @@ public class UserPromote extends SubCommand<User> {
Message.USER_PROMOTE_SUCCESS.send(sender, user.getFriendlyName(), track.getName(), old, nextGroup.getFriendlyName(), CommandUtils.contextSetToString(context)); Message.USER_PROMOTE_SUCCESS.send(sender, user.getFriendlyName(), track.getName(), old, nextGroup.getFriendlyName(), CommandUtils.contextSetToString(context));
if (!silent) { if (!silent) {
Message.EMPTY.send(sender, CommandUtils.listToArrowSep(track.getGroups(), old, nextGroup.getFriendlyName(), false)); Message.EMPTY.send(sender, CommandUtils.listToArrowSep(track.getGroups(), old, nextGroup.getName(), false));
} }
ExtendedLogEntry.build().actor(sender).acted(user) ExtendedLogEntry.build().actor(sender).acted(user)