mirror of
https://github.com/RetroShare/RetroShare.git
synced 2025-12-14 16:18:48 -05:00
removed offline status msg
git-svn-id: http://svn.code.sf.net/p/retroshare/code/trunk@2729 b45a01b8-16f6-495d-af2f-9b41ad6348cc
This commit is contained in:
parent
9fb3770066
commit
a5bc5d7aa2
4 changed files with 61 additions and 24 deletions
|
|
@ -127,6 +127,7 @@ bool p3StatusService::getStatus(std::list<StatusInfo>& statusInfo)
|
|||
for(mit = mStatusInfoMap.begin(); mit != mStatusInfoMap.end(); mit++){
|
||||
statusInfo.push_back(mit->second);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
return true;
|
||||
|
|
@ -142,18 +143,25 @@ bool p3StatusService::sendStatus(StatusInfo& statusInfo)
|
|||
if(statusInfo.id != mConnMgr->getOwnId())
|
||||
return false;
|
||||
|
||||
mStatusInfoMap[statusInfo.id] = statusInfo;
|
||||
// If your id is not set, set it
|
||||
if(mStatusInfoMap.find(statusInfo.id) == mStatusInfoMap.end()){
|
||||
|
||||
std::pair<std::string, StatusInfo> pr(statusInfo.id, statusInfo);
|
||||
mStatusInfoMap.insert(pr);
|
||||
IndicateConfigChanged();
|
||||
}else
|
||||
if(mStatusInfoMap[statusInfo.id].status != statusInfo.status){
|
||||
|
||||
IndicateConfigChanged();
|
||||
mStatusInfoMap[statusInfo.id] = statusInfo;
|
||||
}
|
||||
|
||||
|
||||
mConnMgr->getOnlineList(onlineList);
|
||||
}
|
||||
|
||||
|
||||
|
||||
//statusItem->PeerId(statusInfo.id);
|
||||
|
||||
std::list<std::string>::iterator it;
|
||||
|
||||
|
||||
|
||||
#ifdef STATUS_DEBUG
|
||||
std::cerr << "p3StatusService::sendStatus() " << std::endl;
|
||||
std::cerr << statusInfo;
|
||||
|
|
@ -252,25 +260,27 @@ bool p3StatusService::loadList(std::list<RsItem*> load){
|
|||
|
||||
// load your status from last rs session
|
||||
StatusInfo own_info;
|
||||
std::list<RsItem*>::iterator it = load.begin();
|
||||
std::list<RsItem*>::const_iterator it = load.begin();
|
||||
|
||||
if(it == load.end()){
|
||||
std::cerr << "p3StatusService::loadList(): Failed to load " << std::endl;
|
||||
return false;
|
||||
}
|
||||
|
||||
for(; it != load.end(); it++){
|
||||
RsStatusItem* own_status = dynamic_cast<RsStatusItem* >(*it);
|
||||
|
||||
|
||||
if(own_status != NULL){
|
||||
|
||||
own_info.id = own_status->PeerId();
|
||||
own_info.id = mConnMgr->getOwnId();
|
||||
own_info.status = own_status->status;
|
||||
own_info.time_stamp = own_status->sendTime;
|
||||
delete own_status;
|
||||
|
||||
{
|
||||
RsStackMutex stack(mStatusMtx);
|
||||
std::pair<std::string, StatusInfo> pr(own_info.id, own_info);
|
||||
std::pair<std::string, StatusInfo> pr(mConnMgr->getOwnId(), own_info);
|
||||
mStatusInfoMap.insert(pr);
|
||||
}
|
||||
|
||||
|
|
@ -280,6 +290,7 @@ bool p3StatusService::loadList(std::list<RsItem*> load){
|
|||
<< std::endl;
|
||||
}
|
||||
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -54,6 +54,9 @@ virtual int status();
|
|||
|
||||
/********* RsStatus ***********/
|
||||
|
||||
/**
|
||||
* Status is set to offline as default if no info received from relevant peer
|
||||
*/
|
||||
virtual bool getStatus(std::list<StatusInfo>& statusInfo);
|
||||
virtual bool sendStatus(StatusInfo& statusInfo);
|
||||
virtual bool statusAvailable();
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue