From 5e15fdf2d0d20e3312b0e62d445f0c08f1b56489 Mon Sep 17 00:00:00 2001 From: csoler Date: Sun, 8 Mar 2015 10:07:09 +0000 Subject: [PATCH] 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 --- libretroshare/src/chat/distributedchat.cc | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/libretroshare/src/chat/distributedchat.cc b/libretroshare/src/chat/distributedchat.cc index f52ab56e9..a7b4e0734 100644 --- a/libretroshare/src/chat/distributedchat.cc +++ b/libretroshare/src/chat/distributedchat.cc @@ -1818,6 +1818,7 @@ void DistributedChatService::addToSaveList(std::list& list) const bool DistributedChatService::processLoadListItem(const RsItem *item) { const RsConfigKeyValueSet *vitem = NULL ; + _default_identity.clear() ; if(NULL != (vitem = dynamic_cast(item))) for(std::list::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 own_ids ; + rsIdentity->getOwnIds(own_ids) ; + + if(!own_ids.empty()) + _default_identity = own_ids.front() ; + } return false ; }