mirror of
https://github.com/Sheldan/abstracto.git
synced 2026-03-21 04:48:44 +00:00
[AB-174] fixing being unable to snooze unreminded reminders
changing new line handling for command parameters
This commit is contained in:
@@ -174,7 +174,7 @@ public class RemindServiceBean implements ReminderService {
|
||||
@Override
|
||||
public void snoozeReminder(Long reminderId, AUserInAServer user, Duration newDuration) {
|
||||
Reminder reminder = reminderManagementService.getReminderByAndByUser(user, reminderId).orElseThrow(() -> new ReminderNotFoundException(reminderId));
|
||||
if(reminder.getTargetDate().isAfter(Instant.now())) {
|
||||
if(reminder.getTargetDate().isAfter(Instant.now()) && !reminder.isReminded()) {
|
||||
throw new NotPossibleToSnoozeException();
|
||||
}
|
||||
log.info("Snoozing reminder {} to be executed in {}.", reminderId, newDuration);
|
||||
|
||||
@@ -11,7 +11,7 @@ import java.util.regex.Pattern;
|
||||
@Getter
|
||||
public class UnParsedCommandParameter {
|
||||
|
||||
private static Pattern SPLIT_REGEX = Pattern.compile("\"([^\"]*)\"|(\\S+\\n*)");
|
||||
private static Pattern SPLIT_REGEX = Pattern.compile("\"([^\"]*)\"|([\\S\\n]+)");
|
||||
|
||||
public UnParsedCommandParameter(String parameters, Message message) {
|
||||
this.parameters = new ArrayList<>();
|
||||
|
||||
Reference in New Issue
Block a user