throw new AccessViolationException("Can't move topics between sections");
}
}
}
Poll newPoll = null;
if (preparedTopic.getSection().isPollPostAllowed() && form.getPoll() != null && tmpl.isModeratorSession()) {
newPoll = buildNewPoll(message, form);
}
String newText;
if (form.getMsg() != null) {
newText = form.getMsg();
} else {
newText = msgbaseDao.getMessageText(message.getId()).getText();
}
if (form.getEditorBonus() != null) {
ImmutableSet<Integer> editors = editHistoryService.getEditors(message, editInfoList);
for (int userid : form.getEditorBonus().keySet()) {
if (!editors.contains(userid)) {
errors.reject("editorBonus", "некорректный корректор?!");
}
}
}
if (!preview && !errors.hasErrors() && ipBlockInfo.isCaptchaRequired()) {
captcha.checkCaptcha(request, errors);
}
if (!preview && !errors.hasErrors()) {
boolean changed = topicService.updateAndCommit(
newMsg,
message,
user,
newTags,
newText,
commit,
changeGroupId,
form.getBonus(),
newPoll!=null?newPoll.getVariants():null,
form.isMultiselect(),
form.getEditorBonus()
);
if (changed || commit || publish) {