force loading of own ID to get a proper name to display in chat lobby dialog

git-svn-id: http://svn.code.sf.net/p/retroshare/code/trunk@8259 b45a01b8-16f6-495d-af2f-9b41ad6348cc
This commit is contained in:
csoler 2015-05-15 16:15:45 +00:00
parent 76fdbce10d
commit 7fd2b214d5

View File

@ -215,7 +215,15 @@ void ChatLobbyDialog::init()
rsMsgs->getIdentityForChatLobby(lobbyId, gxs_id);
RsIdentityDetails details ;
rsIdentity->getIdDetails(gxs_id,details) ;
// This lets the backend some time to load our own identity in cache.
// It will only loop for at most 1 second the first time.
for(int i=0;i<3;++i)
if(rsIdentity->getIdDetails(gxs_id,details))
break ;
else
usleep(1000*300) ;
ui.chatWidget->setName(QString::fromUtf8(details.mNickname.c_str()));
//ui.chatWidget->addToolsAction(ui.actionChangeNickname);
@ -286,7 +294,7 @@ void ChatLobbyDialog::setIdentity(const RsGxsId& gxs_id)
{
rsMsgs->setIdentityForChatLobby(lobbyId, gxs_id) ;
// get new nick name
// get new nick name
RsGxsId newid;
if (rsMsgs->getIdentityForChatLobby(lobbyId, newid))
@ -295,7 +303,7 @@ void ChatLobbyDialog::setIdentity(const RsGxsId& gxs_id)
rsIdentity->getIdDetails(gxs_id,details) ;
ui.chatWidget->setName(QString::fromUtf8(details.mNickname.c_str()));
}
}
}
/**