mirror of
https://github.com/darksaid98/Carbon.git
synced 2026-12-01 14:38:48 +00:00
Fix format getting and message parsing
This commit is contained in:
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();
|
||||
}
|
||||
|
||||
+1
-1
@@ -304,7 +304,7 @@ public class CarbonChatChannel implements ChatChannel {
|
||||
@Override
|
||||
@Nullable
|
||||
public String format(final @NonNull String group) {
|
||||
return this.options().formats().get("formats." + group);
|
||||
return this.options().format(group);
|
||||
}
|
||||
|
||||
private boolean isUserSpying(final @NonNull ChatUser sender, final @NonNull ChatUser target) {
|
||||
|
||||
Reference in new issue
Block a user