Skip to content

Commit

Permalink
Connection reject messages weren't translated properly client-side.
Browse files Browse the repository at this point in the history
* Re-use MainWindow::serverDisconnected title strings as to not break the string freeze.
  • Loading branch information
hacst committed Nov 12, 2012
1 parent 09f2ec0 commit 1922df7
Showing 1 changed file with 21 additions and 1 deletion.
22 changes: 21 additions & 1 deletion src/mumble/Messages.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,27 @@ void MainWindow::msgBanList(const MumbleProto::BanList &msg) {

void MainWindow::msgReject(const MumbleProto::Reject &msg) {
rtLast = msg.type();
g.l->log(Log::ServerDisconnected, tr("Server connection rejected: %1.").arg(u8(msg.reason())));

QString reason(u8(msg.reason()));;

switch (rtLast) {
case MumbleProto::Reject_RejectType_InvalidUsername:
reason = tr("Invalid username");
break;
case MumbleProto::Reject_RejectType_UsernameInUse:
reason = tr("Username in use");
break;
case MumbleProto::Reject_RejectType_WrongUserPW:
reason = tr("Wrong certificate or password");
break;
case MumbleProto::Reject_RejectType_WrongServerPW:
reason = tr("Wrong password");
break;
default:
break;
}

g.l->log(Log::ServerDisconnected, tr("Server connection rejected: %1.").arg(reason));
g.l->setIgnore(Log::ServerDisconnected, 1);
}

Expand Down

0 comments on commit 1922df7

Please sign in to comment.