Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove moderator right click option "fetch game chat history" #12781

Merged
merged 1 commit into from
Jul 26, 2024
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
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