mirror of
https://github.com/DiscordSRV/Ascension.git
synced 2025-02-28 03:42:46 +01:00
Case-insensitive check for game channel owner name comparison, added some comments
This commit is contained in:
parent
da8ba3d3a6
commit
02121a61f9
@ -183,19 +183,23 @@ public class ChannelConfigHelper {
|
|||||||
public BaseChannelConfig get(String ownerName, String channelName) {
|
public BaseChannelConfig get(String ownerName, String channelName) {
|
||||||
if (ownerName != null) {
|
if (ownerName != null) {
|
||||||
ownerName = ownerName.toLowerCase(Locale.ROOT);
|
ownerName = ownerName.toLowerCase(Locale.ROOT);
|
||||||
|
|
||||||
|
// Check if there is a channel defined like this: "owner:channel"
|
||||||
BaseChannelConfig config = findChannel(ownerName + ":" + channelName);
|
BaseChannelConfig config = findChannel(ownerName + ":" + channelName);
|
||||||
if (config != null) {
|
if (config != null) {
|
||||||
return config;
|
return config;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Check if this owner has the highest priority for this channel name
|
||||||
GameChannel gameChannel = nameToChannelCache.get(channelName);
|
GameChannel gameChannel = nameToChannelCache.get(channelName);
|
||||||
if (gameChannel != null && gameChannel.getOwnerName().equals(ownerName)) {
|
if (gameChannel != null && gameChannel.getOwnerName().equalsIgnoreCase(ownerName)) {
|
||||||
config = findChannel(channelName);
|
config = findChannel(channelName);
|
||||||
return config;
|
return config;
|
||||||
}
|
}
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Get the highest priority owner for this channel name and relookup
|
||||||
GameChannel gameChannel = nameToChannelCache.get(channelName);
|
GameChannel gameChannel = nameToChannelCache.get(channelName);
|
||||||
return gameChannel != null ? get(gameChannel) : null;
|
return gameChannel != null ? get(gameChannel) : null;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user