mirror of
https://github.com/RetroShare/RetroShare.git
synced 2025-06-24 14:20:44 -04:00
for each channel msg post download request is now only called once.
git-svn-id: http://svn.code.sf.net/p/retroshare/code/trunk@4136 b45a01b8-16f6-495d-af2f-9b41ad6348cc
This commit is contained in:
parent
05ed2bec88
commit
bff095198c
1 changed files with 18 additions and 8 deletions
|
@ -740,18 +740,26 @@ bool p3Channels::locked_eventDuplicateMsg(GroupInfo *grp, RsDistribMsg *msg, std
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
// check if msg has done download already
|
// return if msg has d download already
|
||||||
|
|
||||||
chanStatMap::iterator cit = mMsgReadStatus.find(grpId);
|
|
||||||
statMap MsgMap;
|
statMap MsgMap;
|
||||||
statMap::iterator mit1, mit2;
|
statMap::iterator mit1, mit2;
|
||||||
|
std::list<RsChannelReadStatus*>::iterator lit = mReadStatus.begin();
|
||||||
|
|
||||||
if(cit != mMsgReadStatus.end()){
|
for(;lit != mReadStatus.end();lit++){
|
||||||
mit1 = cit->second.find(msgId);
|
|
||||||
|
|
||||||
if(mit1 != cit->second.end()){
|
if((*lit)->channelId == grpId)
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
|
if(lit != mReadStatus.end()){
|
||||||
|
|
||||||
|
if(( mit1=(*lit)->msgReadStatus.find(msgId)) != (*lit)->msgReadStatus.end()){
|
||||||
if(mit1->second & CHANNEL_MSG_STATUS_DOWLOADED)
|
if(mit1->second & CHANNEL_MSG_STATUS_DOWLOADED)
|
||||||
return false;
|
return false;
|
||||||
|
}else{
|
||||||
|
// create an entry for msg id
|
||||||
|
(*lit)->msgReadStatus[msgId] = ~CHANNEL_MSG_STATUS_MASK;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -850,13 +858,15 @@ bool p3Channels::locked_eventDuplicateMsg(GroupInfo *grp, RsDistribMsg *msg, std
|
||||||
localpath, flags, srcIds);
|
localpath, flags, srcIds);
|
||||||
}
|
}
|
||||||
|
|
||||||
if(cit != mMsgReadStatus.end()){
|
if(lit != mReadStatus.end()){
|
||||||
|
|
||||||
if(mit1 != cit->second.end())
|
(*lit)->msgReadStatus[msgId] |= (CHANNEL_MSG_STATUS_MASK &
|
||||||
mit1->second |= (CHANNEL_MSG_STATUS_MASK &
|
|
||||||
CHANNEL_MSG_STATUS_DOWLOADED);
|
CHANNEL_MSG_STATUS_DOWLOADED);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
IndicateConfigChanged();
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue