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:
csoler 2015-03-08 10:07:09 +00:00
parent cdf7de317d
commit 5e15fdf2d0

View File

@ -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 ;
}