Added Phenom's patch AddGxsIdDeleting_v0.6_7328.patch

Changed some context menu icons for GxsGroupFrameDialog

git-svn-id: http://svn.code.sf.net/p/retroshare/code/trunk@7337 b45a01b8-16f6-495d-af2f-9b41ad6348cc
This commit is contained in:
defnax 2014-05-06 17:15:20 +00:00
parent d2bd938e82
commit a9dcd24ba7
17 changed files with 275 additions and 71 deletions

View file

@ -53,13 +53,13 @@
#define MSG_CLEANUP_PERIOD 60*5 // 5 minutes
#define INTEGRITY_CHECK_PERIOD 60*30 // 30 minutes
RsGenExchange::RsGenExchange(RsGeneralDataService *gds, RsNetworkExchangeService *ns,
RsSerialType *serviceSerialiser, uint16_t servType, RsGixs* gixs,
uint32_t authenPolicy, uint32_t messageStorePeriod)
: mGenMtx("GenExchange"),
mDataStore(gds),
mNetService(ns),
mSerialiser(serviceSerialiser),
RsGenExchange::RsGenExchange(RsGeneralDataService *gds, RsNetworkExchangeService *ns,
RsSerialType *serviceSerialiser, uint16_t servType, RsGixs* gixs,
uint32_t authenPolicy, uint32_t messageStorePeriod)
: mGenMtx("GenExchange"),
mDataStore(gds),
mNetService(ns),
mSerialiser(serviceSerialiser),
mServType(servType),
mGixs(gixs),
mAuthenPolicy(authenPolicy),
@ -130,12 +130,14 @@ void RsGenExchange::tick()
publishGrps();
publishMsgs();
processGroupUpdatePublish();
processRecvdData();
if(!mNotifications.empty())
processGroupUpdatePublish();
processGroupDelete();
processRecvdData();
if(!mNotifications.empty())
{
notifyChanges(mNotifications);
mNotifications.clear();
@ -1029,18 +1031,18 @@ bool RsGenExchange::subscribeToGroup(uint32_t& token, const RsGxsGroupId& grpId,
setGroupSubscribeFlags(token, grpId, GXS_SERV::GROUP_SUBSCRIBE_NOT_SUBSCRIBED,
(GXS_SERV::GROUP_SUBSCRIBE_SUBSCRIBED | GXS_SERV::GROUP_SUBSCRIBE_NOT_SUBSCRIBED));
return true;
}
bool RsGenExchange::getGroupStatistic(const uint32_t& token, GxsGroupStatistic& stats)
{
return false;
}
bool RsGenExchange::getServiceStatistic(const uint32_t& token, GxsServiceStatistic& stats)
{
return false;
}
return true;
}
bool RsGenExchange::getGroupStatistic(const uint32_t& /*token*/, GxsGroupStatistic& /*stats*/)
{
return false;
}
bool RsGenExchange::getServiceStatistic(const uint32_t& /*token*/, GxsServiceStatistic& /*stats*/)
{
return false;
}
bool RsGenExchange::updated(bool willCallGrpChanged, bool willCallMsgChanged)
{
@ -1457,12 +1459,23 @@ void RsGenExchange::updateGroup(uint32_t& token, RsGxsGrpItem* grpItem)
#ifdef GEN_EXCH_DEBUG
std::cerr << "RsGenExchange::updateGroup() token: " << token;
std::cerr << std::endl;
#endif
}
void RsGenExchange::publishMsg(uint32_t& token, RsGxsMsgItem *msgItem)
{
#endif
}
void RsGenExchange::deleteGroup(uint32_t& token, RsGxsGrpItem* grpItem)
{
RsStackMutex stack(mGenMtx);
token = mDataAccess->generatePublicToken();
mGroupDeletePublish.push_back(GroupDeletePublish(grpItem, token));
#ifdef GEN_EXCH_DEBUG
std::cerr << "RsGenExchange::deleteGroup() token: " << token;
std::cerr << std::endl;
#endif
}
void RsGenExchange::publishMsg(uint32_t& token, RsGxsMsgItem *msgItem)
{
RsStackMutex stack(mGenMtx);
token = mDataAccess->generatePublicToken();
mMsgsToPublish.insert(std::make_pair(token, msgItem));
@ -1944,12 +1957,60 @@ void RsGenExchange::processGroupUpdatePublish()
delete meta;
}
mGroupUpdatePublish.clear();
}
bool RsGenExchange::checkKeys(const RsTlvSecurityKeySet& keySet)
{
mGroupUpdatePublish.clear();
}
void RsGenExchange::processGroupDelete()
{
RsStackMutex stack(mGenMtx);
// get keys for group delete publish
typedef std::pair<bool, RsGxsGroupId> GrpNote;
std::map<uint32_t, GrpNote> toNotify;
std::vector<GroupDeletePublish>::iterator vit = mGroupDeletePublish.begin();
for(; vit != mGroupDeletePublish.end(); vit++)
{
GroupDeletePublish& gdp = *vit;
uint32_t token = gdp.mToken;
const RsGxsGroupId& groupId = gdp.grpItem->meta.mGroupId;
std::vector<RsGxsGroupId> gprIds;
gprIds.push_back(groupId);
mDataStore->removeGroups(gprIds);
toNotify.insert(std::make_pair(
token, GrpNote(true, RsGxsGroupId())));
}
std::list<RsGxsGroupId> grpDeleted;
std::map<uint32_t, GrpNote>::iterator mit = toNotify.begin();
for(; mit != toNotify.end(); mit++)
{
GrpNote& note = mit->second;
uint8_t status = note.first ? RsTokenService::GXS_REQUEST_V2_STATUS_COMPLETE
: RsTokenService::GXS_REQUEST_V2_STATUS_FAILED;
mGrpNotify.insert(std::make_pair(mit->first, note.second));
mDataAccess->updatePublicRequestStatus(mit->first, status);
if(note.first)
grpDeleted.push_back(note.second);
}
if(!grpDeleted.empty())
{
RsGxsGroupChange* gc = new RsGxsGroupChange(RsGxsNotify::TYPE_PUBLISH);
gc->mGrpIdList = grpDeleted;
mNotifications.push_back(gc);
}
mGroupDeletePublish.clear();
}
bool RsGenExchange::checkKeys(const RsTlvSecurityKeySet& keySet)
{
typedef std::map<std::string, RsTlvSecurityKey> keyMap;
const keyMap& allKeys = keySet.keys;
keyMap::const_iterator cit = allKeys.begin();

View file

@ -526,22 +526,30 @@ protected:
* Ownership of item passes to this rsgenexchange \n
* @param token
* @param grpItem
*/
void publishGroup(uint32_t& token, RsGxsGrpItem* grpItem);
/*!
* Updates an existing group item \n
* This will induce a related change message \n
*/
void publishGroup(uint32_t& token, RsGxsGrpItem* grpItem);
/*!
* Updates an existing group item \n
* This will induce a related change message \n
* Ownership of item passes to this rsgenexchange \n
* @param token
* @param grpItem
*/
void updateGroup(uint32_t& token, RsGxsGrpItem* grpItem);
public:
/*!
* Enables publication of a message item \n
*/
void updateGroup(uint32_t& token, RsGxsGrpItem* grpItem);
/*!
* Deletes an existing group item \n
* This will induce a related change message \n
* Ownership of item passes to this rsgenexchange \n
* @param token
* @param grpItem
*/
void deleteGroup(uint32_t& token, RsGxsGrpItem* grpItem);
public:
/*!
* Enables publication of a message item \n
* Setting mOrigMsgId meta member to blank \n
* leads to this msg being an original msg \n
* if mOrigMsgId is not blank the msgId then this msg is \n
@ -651,12 +659,14 @@ private:
void processRecvdGroups();
void publishGrps();
void processGroupUpdatePublish();
void publishMsgs();
/*!
void processGroupUpdatePublish();
void processGroupDelete();
void publishMsgs();
/*!
* processes msg local meta changes
*/
void processMsgMetaChanges();
@ -864,9 +874,11 @@ private:
private:
std::vector<GroupUpdate> mGroupUpdates, mPeersGroupUpdate;
std::vector<GroupUpdatePublish> mGroupUpdatePublish;
};
#endif // RSGENEXCHANGE_H
std::vector<GroupUpdatePublish> mGroupUpdatePublish;
std::vector<GroupDeletePublish> mGroupDeletePublish;
};
#endif // RSGENEXCHANGE_H

View file

@ -148,4 +148,13 @@ public:
uint32_t mToken;
};
class GroupDeletePublish
{
public:
GroupDeletePublish(RsGxsGrpItem* item, uint32_t token)
: grpItem(item), mToken(token) {}
RsGxsGrpItem* grpItem;
uint32_t mToken;
};
#endif /* GXSUTIL_H_ */