mirror of
https://github.com/RetroShare/RetroShare.git
synced 2025-05-18 05:50:39 -04:00
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:
parent
917f9913df
commit
1855d19436
6 changed files with 71 additions and 42 deletions
|
@ -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());
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue