Added check for empty lobby nick name.

Moved notify of lobby nick name change from the gui to p3ChatService.
Added missing mutex locks for p3ChatService::_default_nick_name.
Recompile needed.

git-svn-id: http://svn.code.sf.net/p/retroshare/code/trunk@5184 b45a01b8-16f6-495d-af2f-9b41ad6348cc
This commit is contained in:
thunder2 2012-05-23 22:33:45 +00:00
parent 917f9913df
commit 1855d19436
6 changed files with 71 additions and 42 deletions

View file

@ -138,7 +138,12 @@ void ChatLobbyDialog::processSettings(bool load)
void ChatLobbyDialog::setNickname(const QString &nickname)
{
rsMsgs->setNickNameForChatLobby(lobbyId, nickname.toUtf8().constData());
ui.chatWidget->setName(nickname);
// get new nick name
std::string newNickname;
if (rsMsgs->getNickNameForChatLobby(lobbyId, newNickname)) {
ui.chatWidget->setName(QString::fromUtf8(newNickname.c_str()));
}
}
/**
@ -155,9 +160,7 @@ void ChatLobbyDialog::changeNickname()
rsMsgs->getNickNameForChatLobby(lobbyId, nickName);
dialog.setTextValue(QString::fromUtf8(nickName.c_str()));
if (dialog.exec() == QDialog::Accepted) {
// Informa other peers of change the Nickname, to update their mute list
rsMsgs->sendLobbyStatusPeerChangedNickname(lobbyId, dialog.textValue().toUtf8().constData());
if (dialog.exec() == QDialog::Accepted && !dialog.textValue().isEmpty()) {
setNickname(dialog.textValue());
}
}