Skip to content

Commit

Permalink
wesnothd: Only disclose the number of online admins to admins using a…
Browse files Browse the repository at this point in the history
…dminmsg

(cherry-picked from commit be41a69)
  • Loading branch information
irydacea committed Oct 7, 2018
1 parent 0c5a47d commit b14b1e9
Showing 1 changed file with 12 additions and 3 deletions.
15 changes: 12 additions & 3 deletions src/server/server.cpp
Expand Up @@ -2229,12 +2229,21 @@ void server::adminmsg_handler(
}
}

if(n == 0) {
*out << "Sorry, no admin available right now. But your message got logged.";
bool is_admin = false;

for(const auto& player : player_connections_) {
if(issuer_name == player.info().name() && player.info().is_moderator()) {
is_admin = true;
break;
}
}

if(!is_admin) {
*out << "Your report has been logged and sent to the server administrators. Thanks!";
return;
}

*out << "Message sent to " << n << " admins.";
*out << "Your report has been logged and sent to " << n << " online administrators. Thanks!";
}

void server::pm_handler(
Expand Down

0 comments on commit b14b1e9

Please sign in to comment.