Added notify of meta changes to RsGenExchange

git-svn-id: http://svn.code.sf.net/p/retroshare/code/trunk@7428 b45a01b8-16f6-495d-af2f-9b41ad6348cc
This commit is contained in:
thunder2 2014-07-04 21:51:17 +00:00
parent 15718cbca9
commit 60a67846b0
15 changed files with 177 additions and 48 deletions

View file

@ -69,9 +69,10 @@ public:
* If receivedChanges is not passed RsGxsNotify changes
* this function does nothing
* @param grpIds returns list of grpIds that have changed
* @param grpIdsMeta returns list of grpIds with meta data changes
* @see updated
*/
virtual void groupsChanged(std::list<RsGxsGroupId>& grpIds) = 0;
virtual void groupsChanged(std::list<RsGxsGroupId>& grpIds, std::list<RsGxsGroupId>& grpIdsMeta) = 0;
/*!
* The msg changed. \n
@ -80,10 +81,10 @@ public:
* If receivedChanges is not passed RsGxsNotify changes
* this function does nothing
* @param msgs returns map of message ids that have changed
* @param msgsMeta returns map of message ids with meta data changes
* @see updated
*/
virtual void msgsChanged(std::map<RsGxsGroupId,
std::vector<RsGxsMessageId> >& msgs) = 0;
virtual void msgsChanged(std::map<RsGxsGroupId, std::vector<RsGxsMessageId> >& msgs, std::map<RsGxsGroupId, std::vector<RsGxsMessageId> >& msgsMeta) = 0;
/*!
* @return handle to token service for this GXS service

View file

@ -84,11 +84,12 @@ public:
* If receivedChanges is not passed RsGxsNotify changes
* this function does nothing
* @param grpIds returns list of grpIds that have changed
* @param grpIdsMeta returns list of grpIds with meta data changes
* @see updated
*/
void groupsChanged(std::list<RsGxsGroupId> &grpIds)
void groupsChanged(std::list<RsGxsGroupId> &grpIds, std::list<RsGxsGroupId>& grpIdsMeta)
{
mGxs->groupsChanged(grpIds);
mGxs->groupsChanged(grpIds, grpIdsMeta);
}
/*!
@ -98,11 +99,12 @@ public:
* If receivedChanges is not passed RsGxsNotify changes
* this function does nothing
* @param msgs returns map of message ids that have changed
* @param msgsMeta returns map of message ids with meta data changes
* @see updated
*/
void msgsChanged(std::map<RsGxsGroupId, std::vector<RsGxsMessageId> > &msgs)
void msgsChanged(std::map<RsGxsGroupId, std::vector<RsGxsMessageId> > &msgs, std::map<RsGxsGroupId, std::vector<RsGxsMessageId> >& msgsMeta)
{
mGxs->msgsChanged(msgs);
mGxs->msgsChanged(msgs, msgsMeta);
}
/*!
* @return handle to token service for this GXS service

View file

@ -31,30 +31,32 @@ public:
/*!
* Relevant to group changes
* TODO: extent to indicate whether a meta change or actual data
*/
class RsGxsGroupChange : public RsGxsNotify
{
public:
RsGxsGroupChange(NotifyType type) : NOTIFY_TYPE(type) {}
RsGxsGroupChange(NotifyType type, bool metaChange) : NOTIFY_TYPE(type), mMetaChange(metaChange) {}
std::list<RsGxsGroupId> mGrpIdList;
NotifyType getType(){ return NOTIFY_TYPE;}
bool metaChange() { return mMetaChange; }
private:
const NotifyType NOTIFY_TYPE;
bool mMetaChange;
};
/*!
* Relevant to message changes
* TODO: extent to indicate whether a meta change or actual data
*/
class RsGxsMsgChange : public RsGxsNotify
{
public:
RsGxsMsgChange(NotifyType type) : NOTIFY_TYPE(type) {}
RsGxsMsgChange(NotifyType type, bool metaChange) : NOTIFY_TYPE(type), mMetaChange(metaChange) {}
std::map<RsGxsGroupId, std::vector<RsGxsMessageId> > msgChangeMap;
NotifyType getType(){ return NOTIFY_TYPE;}
bool metaChange() { return mMetaChange; }
private:
const NotifyType NOTIFY_TYPE;
bool mMetaChange;
};