mirror of
https://github.com/RetroShare/RetroShare.git
synced 2024-10-01 02:35:48 -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
@ -740,18 +740,26 @@ bool p3Channels::locked_eventDuplicateMsg(GroupInfo *grp, RsDistribMsg *msg, std
|
||||
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::iterator mit1, mit2;
|
||||
std::list<RsChannelReadStatus*>::iterator lit = mReadStatus.begin();
|
||||
|
||||
if(cit != mMsgReadStatus.end()){
|
||||
mit1 = cit->second.find(msgId);
|
||||
for(;lit != mReadStatus.end();lit++){
|
||||
|
||||
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)
|
||||
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);
|
||||
}
|
||||
|
||||
if(cit != mMsgReadStatus.end()){
|
||||
if(lit != mReadStatus.end()){
|
||||
|
||||
if(mit1 != cit->second.end())
|
||||
mit1->second |= (CHANNEL_MSG_STATUS_MASK &
|
||||
(*lit)->msgReadStatus[msgId] |= (CHANNEL_MSG_STATUS_MASK &
|
||||
CHANNEL_MSG_STATUS_DOWLOADED);
|
||||
|
||||
}
|
||||
|
||||
IndicateConfigChanged();
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user