made GxsNotify for messages with more granularity. Removed RsGxsCircleMsg class that was not used.

This commit is contained in:
csoler 2020-05-03 23:20:13 +02:00
parent efb26ce9c0
commit ce6abe5d66
No known key found for this signature in database
GPG key ID: 7BCA522266C0804C
19 changed files with 217 additions and 284 deletions

View file

@ -657,6 +657,7 @@ void p3GxsTrans::notifyChanges(std::vector<RsGxsNotify*>& changes)
std::cout << "p3GxsTrans::notifyChanges(...)" << std::endl;
#endif
std::list<RsGxsGroupId> grps_to_request;
GxsMsgReq msgs_to_request;
for( auto it = changes.begin(); it != changes.end(); ++it )
{
@ -675,11 +676,8 @@ void p3GxsTrans::notifyChanges(std::vector<RsGxsNotify*>& changes)
#ifdef DEBUG_GXSTRANS
std::cout << "p3GxsTrans::notifyChanges(...) msgChange" << std::endl;
#endif
uint32_t token;
RsTokReqOptions opts; opts.mReqType = GXS_REQUEST_TYPE_MSG_DATA;
RsGenExchange::getTokenService()->requestMsgInfo( token, 0xcaca,
opts, msgChange->msgChangeMap );
GxsTokenQueue::queueRequest(token, MAILS_UPDATE);
msgs_to_request[msgChange->mGroupId].insert(msgChange->mMsgId);
#ifdef DEBUG_GXSTRANS
for( GxsMsgReq::const_iterator it = msgChange->msgChangeMap.begin();
@ -701,6 +699,17 @@ void p3GxsTrans::notifyChanges(std::vector<RsGxsNotify*>& changes)
delete *it;
}
if(!msgs_to_request.empty())
{
uint32_t token;
RsTokReqOptions opts;
opts.mReqType = GXS_REQUEST_TYPE_MSG_DATA;
RsGenExchange::getTokenService()->requestMsgInfo( token, 0xcaca, opts, msgs_to_request);
GxsTokenQueue::queueRequest(token, MAILS_UPDATE);
}
if(!grps_to_request.empty())
requestGroupsData(&grps_to_request);
}