mirror of
https://github.com/RetroShare/RetroShare.git
synced 2025-08-14 17:15:47 -04:00
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:
parent
76fdbce10d
commit
7fd2b214d5
1 changed files with 11 additions and 3 deletions
|
@ -215,7 +215,15 @@ void ChatLobbyDialog::init()
|
||||||
rsMsgs->getIdentityForChatLobby(lobbyId, gxs_id);
|
rsMsgs->getIdentityForChatLobby(lobbyId, gxs_id);
|
||||||
|
|
||||||
RsIdentityDetails details ;
|
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->setName(QString::fromUtf8(details.mNickname.c_str()));
|
||||||
//ui.chatWidget->addToolsAction(ui.actionChangeNickname);
|
//ui.chatWidget->addToolsAction(ui.actionChangeNickname);
|
||||||
|
@ -286,7 +294,7 @@ void ChatLobbyDialog::setIdentity(const RsGxsId& gxs_id)
|
||||||
{
|
{
|
||||||
rsMsgs->setIdentityForChatLobby(lobbyId, gxs_id) ;
|
rsMsgs->setIdentityForChatLobby(lobbyId, gxs_id) ;
|
||||||
|
|
||||||
// get new nick name
|
// get new nick name
|
||||||
RsGxsId newid;
|
RsGxsId newid;
|
||||||
|
|
||||||
if (rsMsgs->getIdentityForChatLobby(lobbyId, newid))
|
if (rsMsgs->getIdentityForChatLobby(lobbyId, newid))
|
||||||
|
@ -295,7 +303,7 @@ void ChatLobbyDialog::setIdentity(const RsGxsId& gxs_id)
|
||||||
rsIdentity->getIdDetails(gxs_id,details) ;
|
rsIdentity->getIdDetails(gxs_id,details) ;
|
||||||
|
|
||||||
ui.chatWidget->setName(QString::fromUtf8(details.mNickname.c_str()));
|
ui.chatWidget->setName(QString::fromUtf8(details.mNickname.c_str()));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue