Skip to content

Commit 45b9d4e

Browse files
Copilottastybento
andauthored
Fix island chat to use isLogIslandChats() and [Island Chat Log] prefix
Agent-Logs-Url: https://github.com/BentoBoxWorld/Chat/sessions/12e3f697-a2ad-4956-a392-972c6517d421 Co-authored-by: tastybento <4407265+tastybento@users.noreply.github.com>
1 parent cf8d83a commit 45b9d4e

2 files changed

Lines changed: 5 additions & 5 deletions

File tree

src/main/java/world/bentobox/chat/listeners/ChatListener.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -148,8 +148,8 @@ public void islandChat(Island i, Player player, String message) {
148148
// Send message to island
149149
.forEach(u -> u.sendMessage("chat.island-chat.syntax", TextVariables.NAME, player.getName(), MESSAGE, message));
150150
// Log if required
151-
if (addon.getSettings().isLogTeamChats()) {
152-
addon.log("[Team Chat Log] " + player.getName() + ": " + message);
151+
if (addon.getSettings().isLogIslandChats()) {
152+
addon.log("[Island Chat Log] " + player.getName() + ": " + message);
153153
}
154154
// Spy if required
155155
Bukkit.getOnlinePlayers().stream()

src/test/java/world/bentobox/chat/listeners/ChatListenerTest.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -321,16 +321,16 @@ public void testTeamChatDoesNotLogWhenDisabled() {
321321

322322
@Test
323323
public void testIslandChatLogsWhenEnabled() {
324-
when(settings.isLogTeamChats()).thenReturn(true);
324+
when(settings.isLogIslandChats()).thenReturn(true);
325325
mockedBukkit.when(org.bukkit.Bukkit::getOnlinePlayers).thenReturn(Collections.emptyList());
326326

327327
listener.islandChat(island, player, "island log message");
328-
verify(addon).log("[Team Chat Log] tastybento: island log message");
328+
verify(addon).log("[Island Chat Log] tastybento: island log message");
329329
}
330330

331331
@Test
332332
public void testIslandChatDoesNotLogWhenDisabled() {
333-
when(settings.isLogTeamChats()).thenReturn(false);
333+
when(settings.isLogIslandChats()).thenReturn(false);
334334
mockedBukkit.when(org.bukkit.Bukkit::getOnlinePlayers).thenReturn(Collections.emptyList());
335335

336336
listener.islandChat(island, player, "island silent message");

0 commit comments

Comments
 (0)