summaryrefslogtreecommitdiff
path: root/src/main_gui.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/main_gui.cpp')
-rw-r--r--src/main_gui.cpp15
1 files changed, 1 insertions, 14 deletions
diff --git a/src/main_gui.cpp b/src/main_gui.cpp
index ffa2b7feb..1befb36e7 100644
--- a/src/main_gui.cpp
+++ b/src/main_gui.cpp
@@ -317,22 +317,9 @@ struct MainWindow : Window
case WKC_RETURN: case 'T': // smart chat; send to team if any, otherwise to all
if (_networking) {
const NetworkClientInfo *cio = NetworkFindClientInfoFromIndex(_network_own_client_id);
- bool teamchat = false;
-
if (cio == NULL) break;
- /* Only companies actually playing can speak to team. Eg spectators cannot */
- if (_settings_client.gui.prefer_teamchat && IsValidCompanyID(cio->client_playas)) {
- const NetworkClientInfo *ci;
- FOR_ALL_ACTIVE_CLIENT_INFOS(ci) {
- if (ci->client_playas == cio->client_playas && ci != cio) {
- teamchat = true;
- break;
- }
- }
- }
-
- ShowNetworkChatQueryWindow(teamchat ? DESTTYPE_TEAM : DESTTYPE_BROADCAST, cio->client_playas);
+ ShowNetworkChatQueryWindow(NetworkClientPreferTeamChat(cio) ? DESTTYPE_TEAM : DESTTYPE_BROADCAST, cio->client_playas);
}
break;