Set own status initially to online.

git-svn-id: http://svn.code.sf.net/p/retroshare/code/trunk@4592 b45a01b8-16f6-495d-af2f-9b41ad6348cc
This commit is contained in:
thunder2 2011-09-08 13:17:49 +00:00
parent a34c482db1
commit 1821d8cb06
2 changed files with 11 additions and 2 deletions

View File

@ -70,7 +70,16 @@ bool p3StatusService::getOwnStatus(StatusInfo& statusInfo)
if (it == mStatusInfoMap.end()){ if (it == mStatusInfoMap.end()){
std::cerr << "p3StatusService::saveList() :" << "Did not find your status" << ownId << std::endl; 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<std::string, StatusInfo> pr(ownId, statusInfo);
mStatusInfoMap.insert(pr);
IndicateConfigChanged();
return true;
} }
statusInfo = it->second; statusInfo = it->second;

View File

@ -150,10 +150,10 @@ void AvatarWidget::refreshStatus()
{ {
StatusInfo statusInfo; StatusInfo statusInfo;
// No check of return value. Non existing status info is handled as offline.
if (mFlag.isOwnId) { if (mFlag.isOwnId) {
rsStatus->getOwnStatus(statusInfo); rsStatus->getOwnStatus(statusInfo);
} else { } else {
// No check of return value. Non existing status info is handled as offline.
rsStatus->getStatus(mId, statusInfo); rsStatus->getStatus(mId, statusInfo);
} }
updateStatus(QString::fromStdString(statusInfo.id), statusInfo.status); updateStatus(QString::fromStdString(statusInfo.id), statusInfo.status);