Fix format getting and message parsing

This commit is contained in:
Draycia committed 2020-09-27 00:12:45 -07:00
1 parent 901e243d1e
commit c79c1bcbee
2 files changed
+16 -3

No files matched your search

@@ -81,10 +81,23 @@ public class ChannelOptions {
return this.contexts;
}
@Nullable
public String format(final String key) {
if (this.formats == null) {
return this.defaultOptions().formats().get(key);
}
final String format = this.formats.get(key);
if (format != null) {
return format;
}
return this.defaultOptions().formats().get(key);
}
@Nullable
public Map<String, String> formats() {
// TODO: properly implement default format inheritence
// TODO: perhaps add an option to make it so overriding any format overrides all?
if (this.formats == null) {
return this.defaultOptions().formats();
}