From 753804eee86e52048ccd212e3836bf90a2ffcf8d Mon Sep 17 00:00:00 2001 From: chrisparker126 Date: Fri, 8 Apr 2011 22:08:12 +0000 Subject: [PATCH] for each channel msg post download request is now only called once. also added logic to deal with case where auto dl has been disabled then re-enabled after a manual download git-svn-id: http://svn.code.sf.net/p/retroshare/code/trunk@4137 b45a01b8-16f6-495d-af2f-9b41ad6348cc --- libretroshare/src/services/p3channels.cc | 22 ++++++++++++++++------ 1 file changed, 16 insertions(+), 6 deletions(-) diff --git a/libretroshare/src/services/p3channels.cc b/libretroshare/src/services/p3channels.cc index 742bc583c..281c8f9a0 100644 --- a/libretroshare/src/services/p3channels.cc +++ b/libretroshare/src/services/p3channels.cc @@ -752,6 +752,22 @@ bool p3Channels::locked_eventDuplicateMsg(GroupInfo *grp, RsDistribMsg *msg, std break; } + mit2 = mChannelStatus.find(grpId); + + if(mit2 != mChannelStatus.end()) + { + if(!(mit2->second & RS_CHAN_STATUS_AUTO_DL)){ + + if(lit != mReadStatus.end()){ + + if(( mit1=(*lit)->msgReadStatus.find(msgId)) != (*lit)->msgReadStatus.end()) + (*lit)->msgReadStatus[msgId] |= (CHANNEL_MSG_STATUS_MASK & CHANNEL_MSG_STATUS_DOWLOADED); + + } + return false; + } + } + if(lit != mReadStatus.end()){ if(( mit1=(*lit)->msgReadStatus.find(msgId)) != (*lit)->msgReadStatus.end()){ @@ -763,13 +779,7 @@ bool p3Channels::locked_eventDuplicateMsg(GroupInfo *grp, RsDistribMsg *msg, std } } - mit2 = mChannelStatus.find(grpId); - if(mit2 != mChannelStatus.end()) - { - if(!(mit2->second & RS_CHAN_STATUS_AUTO_DL)) - return false; - } /* request the files * NB: This will result in duplicates.