-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
dd784d0
commit a68a30b
Showing
9 changed files
with
86 additions
and
45 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,3 @@ | ||
group = "fi.fabianadrian" | ||
version = "2.0.0" | ||
version = "2.1.0" | ||
description = "A simple plugin that forwards chat messages to a webhook." |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
20 changes: 8 additions & 12 deletions
20
...rc/main/java/fi/fabianadrian/webhookchatlogger/common/config/WebhookChatLoggerConfig.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
30 changes: 30 additions & 0 deletions
30
...ava/fi/fabianadrian/webhookchatlogger/common/config/section/PlaceholderConfigSection.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
package fi.fabianadrian.webhookchatlogger.common.config.section; | ||
|
||
import space.arim.dazzleconf.annote.ConfComments; | ||
import space.arim.dazzleconf.annote.ConfDefault; | ||
import space.arim.dazzleconf.sorter.AnnotationBasedSorter; | ||
|
||
import java.time.ZoneId; | ||
|
||
public interface PlaceholderConfigSection { | ||
|
||
@AnnotationBasedSorter.Order(0) | ||
@ConfDefault.DefaultString("HH:mm:ss") | ||
@ConfComments({ | ||
"Format for the <timestamp> placeholder." | ||
}) | ||
String timestampFormat(); | ||
|
||
@AnnotationBasedSorter.Order(1) | ||
@ConfDefault.DefaultString("default") | ||
@ConfComments({ | ||
"The timezone used in <timestamp> placeholder.", | ||
"Set to 'default' to use the server timezone." | ||
}) | ||
ZoneId timeZone(); | ||
|
||
@AnnotationBasedSorter.Order(2) | ||
@ConfDefault.DefaultString("[Cancelled] ") | ||
@ConfComments("The text used in <cancelled> placeholder.") | ||
String cancelled(); | ||
} |
26 changes: 0 additions & 26 deletions
26
...i/fabianadrian/webhookchatlogger/common/config/serializer/SimpleDateFormatSerializer.java
This file was deleted.
Oops, something went wrong.
31 changes: 31 additions & 0 deletions
31
...ain/java/fi/fabianadrian/webhookchatlogger/common/config/serializer/ZoneIdSerializer.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
package fi.fabianadrian.webhookchatlogger.common.config.serializer; | ||
|
||
import space.arim.dazzleconf.error.BadValueException; | ||
import space.arim.dazzleconf.serialiser.Decomposer; | ||
import space.arim.dazzleconf.serialiser.FlexibleType; | ||
import space.arim.dazzleconf.serialiser.ValueSerialiser; | ||
|
||
import java.time.ZoneId; | ||
|
||
public class ZoneIdSerializer implements ValueSerialiser<ZoneId> { | ||
@Override | ||
public Class<ZoneId> getTargetClass() { | ||
return ZoneId.class; | ||
} | ||
|
||
@Override | ||
public ZoneId deserialise(FlexibleType flexibleType) throws BadValueException { | ||
String string = flexibleType.getString(); | ||
|
||
if ("default".equalsIgnoreCase(string) || string.isBlank()) { | ||
return ZoneId.systemDefault(); | ||
} | ||
|
||
return ZoneId.of(string); | ||
} | ||
|
||
@Override | ||
public Object serialise(ZoneId zoneId, Decomposer decomposer) { | ||
return zoneId.getId(); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters