mirror of
https://github.com/RetroShare/RetroShare.git
synced 2024-12-30 09:56:14 -05:00
set some default value for _default_identity if no value comes from LoadList
git-svn-id: http://svn.code.sf.net/p/retroshare/code/trunk@7995 b45a01b8-16f6-495d-af2f-9b41ad6348cc
This commit is contained in:
parent
cdf7de317d
commit
5e15fdf2d0
@ -1818,6 +1818,7 @@ void DistributedChatService::addToSaveList(std::list<RsItem*>& list) const
|
||||
bool DistributedChatService::processLoadListItem(const RsItem *item)
|
||||
{
|
||||
const RsConfigKeyValueSet *vitem = NULL ;
|
||||
_default_identity.clear() ;
|
||||
|
||||
if(NULL != (vitem = dynamic_cast<const RsConfigKeyValueSet*>(item)))
|
||||
for(std::list<RsTlvKeyValue>::const_iterator kit = vitem->tlvkvs.pairs.begin(); kit != vitem->tlvkvs.pairs.end(); ++kit)
|
||||
@ -1844,6 +1845,14 @@ bool DistributedChatService::processLoadListItem(const RsItem *item)
|
||||
return true ;
|
||||
}
|
||||
|
||||
if(_default_identity.isNull())
|
||||
{
|
||||
std::list<RsGxsId> own_ids ;
|
||||
rsIdentity->getOwnIds(own_ids) ;
|
||||
|
||||
if(!own_ids.empty())
|
||||
_default_identity = own_ids.front() ;
|
||||
}
|
||||
return false ;
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user