fixed bug with default chat lobby identity causing settings to show an empty list. Also fixed up GxsIdChooser

git-svn-id: http://svn.code.sf.net/p/retroshare/code/trunk@8081 b45a01b8-16f6-495d-af2f-9b41ad6348cc
This commit is contained in:
csoler 2015-03-26 21:20:57 +00:00
parent 24c421c0b7
commit 9d2b6faf9c
6 changed files with 31 additions and 8 deletions

View file

@ -1565,9 +1565,27 @@ bool DistributedChatService::setDefaultIdentityForChatLobby(const RsGxsId& nick)
}
bool DistributedChatService::getDefaultIdentityForChatLobby(RsGxsId& nick)
{
RsStackMutex stack(mDistributedChatMtx); /********** STACK LOCKED MTX ******/
nick = _default_identity ;
return true ;
RsStackMutex stack(mDistributedChatMtx); /********** STACK LOCKED MTX ******/
nick = locked_getDefaultIdentity() ;
return true ;
}
RsGxsId DistributedChatService::locked_getDefaultIdentity()
{
if(_default_identity.isNull() && rsIdentity!=NULL)
{
std::list<RsGxsId> own_ids ;
rsIdentity->getOwnIds(own_ids) ;
if(!own_ids.empty())
{
_default_identity = own_ids.front() ;
triggerConfigSave();
}
}
return _default_identity ;
}
bool DistributedChatService::getIdentityForChatLobby(const ChatLobbyId& lobby_id,RsGxsId& nick)
{

View file

@ -130,6 +130,7 @@ class DistributedChatService
bool locked_initLobbyBouncableObject(const ChatLobbyId& id,RsChatLobbyBouncingObject&) ;
void locked_printDebugInfo() const ;
RsGxsId locked_getDefaultIdentity();
static ChatLobbyVirtualPeerId makeVirtualPeerId(ChatLobbyId) ;
static uint64_t makeConnexionChallengeCode(const RsPeerId& peer_id,ChatLobbyId lobby_id,ChatLobbyMsgId msg_id) ;