Skip to content

Commit

Permalink
Remove moderator right click option "fetch game chat history" (#12781)
Browse files Browse the repository at this point in the history
We are no longer uploading chat messages from hosted (bot or player)
games to lobby. This update removes the 'fetch game chat history'
feature since that data will always be blank going forward.
  • Loading branch information
DanVanAtta authored Jul 26, 2024
1 parent d3186d4 commit aeb3e6d
Show file tree
Hide file tree
Showing 4 changed files with 0 additions and 101 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
import games.strategy.engine.framework.GameProcess;
import games.strategy.engine.framework.startup.ui.ServerOptions;
import games.strategy.engine.lobby.client.login.LoginResult;
import games.strategy.engine.lobby.client.ui.action.FetchChatHistory;
import games.strategy.engine.lobby.client.ui.action.ShowPlayersAction;
import games.strategy.triplea.settings.ClientSetting;
import java.awt.BorderLayout;
Expand Down Expand Up @@ -194,7 +193,6 @@ private void mouseOnGamesList(final MouseEvent mouseEvent) {
if (loginResult.isModerator()) {
menu.addSeparator();
List.of(
SwingAction.of("Show Chat History", e -> showChatHistory()),
SwingAction.of("Boot Game", e -> bootGame()),
SwingAction.of("Shutdown", e -> shutdown()))
.forEach(menu::add);
Expand Down Expand Up @@ -234,21 +232,6 @@ private void hostGame() {
ClientSetting.lobbyUri.getValueOrThrow());
}

private void showChatHistory() {
final int selectedIndex = gameTable.getSelectedRow();
if (selectedIndex == -1) {
return;
}

FetchChatHistory.builder()
.parentWindow(parent)
.gameId(gameTableModel.getGameIdForRow(gameTable.convertRowIndexToModel(selectedIndex)))
.gameHostName(gameTableModel.get(selectedIndex).getHostedBy().getName())
.playerToLobbyConnection(playerToLobbyConnection)
.build()
.fetchAndShowChatHistory();
}

private void bootGame() {
final int selectedIndex = gameTable.getSelectedRow();
if (selectedIndex == -1) {
Expand Down

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@

import feign.RequestLine;
import java.net.URI;
import java.util.List;
import org.triplea.domain.data.ApiKey;
import org.triplea.domain.data.PlayerChatId;
import org.triplea.http.client.HttpClient;
Expand All @@ -13,7 +12,6 @@ public interface ModeratorLobbyClient {
String DISCONNECT_PLAYER_PATH = "/lobby/moderator/disconnect-player";
String BAN_PLAYER_PATH = "/lobby/moderator/ban-player";
String MUTE_USER = "/lobby/moderator/mute-player";
String FETCH_GAME_CHAT_HISTORY = "/lobby/moderator/fetch-game-chat-history";

static ModeratorLobbyClient newClient(final URI lobbyUri, final ApiKey apiKey) {
return HttpClient.newClient(
Expand All @@ -26,9 +24,6 @@ static ModeratorLobbyClient newClient(final URI lobbyUri, final ApiKey apiKey) {
@RequestLine("POST " + ModeratorLobbyClient.DISCONNECT_PLAYER_PATH)
void disconnectPlayer(String value);

@RequestLine("POST " + ModeratorLobbyClient.FETCH_GAME_CHAT_HISTORY)
List<ChatHistoryMessage> fetchChatHistoryForGame(String gameId);

@RequestLine("POST " + ModeratorLobbyClient.MUTE_USER)
void muteUser(MuteUserRequest muteUserRequest);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@
import org.triplea.http.client.lobby.game.lobby.watcher.GameListingClient;
import org.triplea.http.client.lobby.game.lobby.watcher.LobbyGameListing;
import org.triplea.http.client.lobby.moderator.BanPlayerRequest;
import org.triplea.http.client.lobby.moderator.ChatHistoryMessage;
import org.triplea.http.client.lobby.moderator.PlayerSummary;
import org.triplea.http.client.lobby.moderator.toolbox.ModeratorToolboxClient;
import org.triplea.http.client.web.socket.GenericWebSocketClient;
Expand Down Expand Up @@ -140,10 +139,6 @@ public void mutePlayer(final PlayerChatId playerChatId, final long minutes) {
httpLobbyClient.getModeratorLobbyClient().muteUser(playerChatId, minutes);
}

public List<ChatHistoryMessage> fetchChatHistoryForGame(final String gameId) {
return httpLobbyClient.getModeratorLobbyClient().fetchChatHistoryForGame(gameId);
}

public Collection<String> fetchPlayersInGame(final String gameId) {
return httpLobbyClient.getPlayerLobbyActionsClient().fetchPlayersInGame(gameId);
}
Expand Down

0 comments on commit aeb3e6d

Please sign in to comment.