Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions src/main/java/world/bentobox/chat/listeners/ChatListener.java
Original file line number Diff line number Diff line change
Expand Up @@ -148,8 +148,8 @@ public void islandChat(Island i, Player player, String message) {
// Send message to island
.forEach(u -> u.sendMessage("chat.island-chat.syntax", TextVariables.NAME, player.getName(), MESSAGE, message));
// Log if required
if (addon.getSettings().isLogTeamChats()) {
addon.log("[Team Chat Log] " + player.getName() + ": " + message);
if (addon.getSettings().isLogIslandChats()) {
addon.log("[Island Chat Log] " + player.getName() + ": " + message);
}
// Spy if required
Bukkit.getOnlinePlayers().stream()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -321,16 +321,16 @@ public void testTeamChatDoesNotLogWhenDisabled() {

@Test
public void testIslandChatLogsWhenEnabled() {
when(settings.isLogTeamChats()).thenReturn(true);
when(settings.isLogIslandChats()).thenReturn(true);
mockedBukkit.when(org.bukkit.Bukkit::getOnlinePlayers).thenReturn(Collections.emptyList());

listener.islandChat(island, player, "island log message");
verify(addon).log("[Team Chat Log] tastybento: island log message");
verify(addon).log("[Island Chat Log] tastybento: island log message");
}

@Test
public void testIslandChatDoesNotLogWhenDisabled() {
when(settings.isLogTeamChats()).thenReturn(false);
when(settings.isLogIslandChats()).thenReturn(false);
mockedBukkit.when(org.bukkit.Bukkit::getOnlinePlayers).thenReturn(Collections.emptyList());

listener.islandChat(island, player, "island silent message");
Expand Down
Loading