From 1821d8cb06ff1a0951ac3eba3da0ebddaebaa866 Mon Sep 17 00:00:00 2001 From: thunder2 Date: Thu, 8 Sep 2011 13:17:49 +0000 Subject: [PATCH] Set own status initially to online. git-svn-id: http://svn.code.sf.net/p/retroshare/code/trunk@4592 b45a01b8-16f6-495d-af2f-9b41ad6348cc --- libretroshare/src/services/p3statusservice.cc | 11 ++++++++++- retroshare-gui/src/gui/common/AvatarWidget.cpp | 2 +- 2 files changed, 11 insertions(+), 2 deletions(-) diff --git a/libretroshare/src/services/p3statusservice.cc b/libretroshare/src/services/p3statusservice.cc index 72c2cef5b..ae3419f46 100644 --- a/libretroshare/src/services/p3statusservice.cc +++ b/libretroshare/src/services/p3statusservice.cc @@ -70,7 +70,16 @@ bool p3StatusService::getOwnStatus(StatusInfo& statusInfo) if (it == mStatusInfoMap.end()){ std::cerr << "p3StatusService::saveList() :" << "Did not find your status" << ownId << std::endl; - return false; + + // own status not set, set it to online + statusInfo.id = ownId; + statusInfo.status = RS_STATUS_ONLINE; + + std::pair pr(ownId, statusInfo); + mStatusInfoMap.insert(pr); + IndicateConfigChanged(); + + return true; } statusInfo = it->second; diff --git a/retroshare-gui/src/gui/common/AvatarWidget.cpp b/retroshare-gui/src/gui/common/AvatarWidget.cpp index 24d6dd1a9..32418ce40 100644 --- a/retroshare-gui/src/gui/common/AvatarWidget.cpp +++ b/retroshare-gui/src/gui/common/AvatarWidget.cpp @@ -150,10 +150,10 @@ void AvatarWidget::refreshStatus() { StatusInfo statusInfo; - // No check of return value. Non existing status info is handled as offline. if (mFlag.isOwnId) { rsStatus->getOwnStatus(statusInfo); } else { + // No check of return value. Non existing status info is handled as offline. rsStatus->getStatus(mId, statusInfo); } updateStatus(QString::fromStdString(statusInfo.id), statusInfo.status);