mirror of
https://github.com/RetroShare/RetroShare.git
synced 2025-05-07 00:25:16 -04:00
about 70% done with PhotoDialog
- can add album (with thumbnail!) - add photo (with photo!) - can subscribe, but not added to ui yet need to try some dummy msgs and bring up gxs_net git-svn-id: http://svn.code.sf.net/p/retroshare/code/branches/v0.5-gxs-b1@5549 b45a01b8-16f6-495d-af2f-9b41ad6348cc
This commit is contained in:
parent
088e7d61fc
commit
9f20c75f83
33 changed files with 1493 additions and 311 deletions
|
@ -632,6 +632,9 @@ void RsGenExchange::publishGrps()
|
|||
size = grp->metaData->serial_size();
|
||||
char mData[size];
|
||||
grp->metaData->mGroupId = grp->grpId;
|
||||
|
||||
// indicate user is admin through local subscribe flag
|
||||
grp->metaData->mSubscribeFlags = GXS_SERV::GROUP_SUBSCRIBE_ADMIN;
|
||||
ok = grp->metaData->serialise(mData, size);
|
||||
grp->meta.setBinData(mData, size);
|
||||
|
||||
|
|
|
@ -54,11 +54,11 @@ namespace GXS_SERV {
|
|||
|
||||
// Subscription Flags. (LOCAL)
|
||||
|
||||
static const uint32_t RSGXS_GROUP_SUBSCRIBE_ADMIN = 0x00000001;
|
||||
static const uint32_t RSGXS_GROUP_SUBSCRIBE_PUBLISH = 0x00000002;
|
||||
static const uint32_t RSGXS_GROUP_SUBSCRIBE_SUBSCRIBED = 0x00000004;
|
||||
static const uint32_t RSGXS_GROUP_SUBSCRIBE_MONITOR = 0x00000008;
|
||||
static const uint32_t RSGXS_GROUP_SUBSCRIBE_MASK = 0x0000000f;
|
||||
static const uint32_t GROUP_SUBSCRIBE_ADMIN = 0x00000001;
|
||||
static const uint32_t GROUP_SUBSCRIBE_PUBLISH = 0x00000002;
|
||||
static const uint32_t GROUP_SUBSCRIBE_SUBSCRIBED = 0x00000004;
|
||||
static const uint32_t GROUP_SUBSCRIBE_MONITOR = 0x00000008;
|
||||
static const uint32_t GROUP_SUBSCRIBE_MASK = 0x0000000f;
|
||||
|
||||
}
|
||||
|
||||
|
|
|
@ -98,7 +98,7 @@ void RsGxsNetService::syncWithPeers()
|
|||
{
|
||||
RsGxsGrpMetaData* meta = mit->second;
|
||||
|
||||
if(meta->mSubscribeFlags & GXS_SERV::RSGXS_GROUP_SUBSCRIBE_MASK)
|
||||
if(meta->mSubscribeFlags & GXS_SERV::GROUP_SUBSCRIBE_MASK)
|
||||
grpIds.push_back(mit->first);
|
||||
}
|
||||
|
||||
|
|
|
@ -254,24 +254,29 @@ public:
|
|||
|
||||
/* details are updated in album - to choose Album ID, and storage path */
|
||||
|
||||
/*!
|
||||
* This RsGenExchange service will be alerted to this album as \n
|
||||
* a new album. Do not keep the submitted album as representative, wait for
|
||||
* notification telling of successful submission
|
||||
* @param album The album to be submitted
|
||||
* @return false if submission failed
|
||||
*/
|
||||
virtual bool submitAlbumDetails(uint32_t& token, RsPhotoAlbum &album) = 0;
|
||||
/*!
|
||||
* submits album, which returns a token that needs
|
||||
* to be acknowledge to get album grp id
|
||||
* @param token token to redeem for acknowledgement
|
||||
* @param album album to be submitted
|
||||
*/
|
||||
virtual bool submitAlbumDetails(uint32_t& token, RsPhotoAlbum &album) = 0;
|
||||
|
||||
/*!
|
||||
* This RsGenExchange service will be alerted to this photo as \n
|
||||
* a new photo. Do not keep the submitted photo as representative, wait for new photo
|
||||
* returned
|
||||
* @param photo photo to submit
|
||||
* @return
|
||||
*/
|
||||
virtual bool submitPhoto(uint32_t& token, RsPhotoPhoto &photo) = 0;
|
||||
/*!
|
||||
* submits photo, which returns a token that needs
|
||||
* to be acknowledge to get photo msg-grp id pair
|
||||
* @param token token to redeem for acknowledgement
|
||||
* @param photo photo to be submitted
|
||||
*/
|
||||
virtual bool submitPhoto(uint32_t& token, RsPhotoPhoto &photo) = 0;
|
||||
|
||||
/*!
|
||||
* subscribes to group, and returns token which can be used
|
||||
* to be acknowledged to get group Id
|
||||
* @param token token to redeem for acknowledgement
|
||||
* @param grpId the id of the group to subscribe to
|
||||
*/
|
||||
virtual bool subscribeToAlbum(uint32_t& token, const RsGxsGroupId& grpId) = 0;
|
||||
|
||||
/*!
|
||||
* This allows the client service to acknowledge that their msgs has
|
||||
|
@ -282,6 +287,8 @@ public:
|
|||
*/
|
||||
virtual bool acknowledgeMsg(const uint32_t& token, std::pair<RsGxsGroupId, RsGxsMessageId>& msgId) = 0;
|
||||
|
||||
|
||||
|
||||
/*!
|
||||
* This allows the client service to acknowledge that their grps has
|
||||
* been created/modified and retrieve the create/modified grp ids
|
||||
|
|
|
@ -2295,6 +2295,10 @@ int RsServer::StartupRetroShare()
|
|||
// start up gxs core server
|
||||
createThread(*mGxsCore);
|
||||
|
||||
|
||||
// create some dummy items
|
||||
|
||||
|
||||
#endif
|
||||
|
||||
#ifdef ENABLE_GXS_SERVICES
|
||||
|
|
|
@ -1,5 +1,6 @@
|
|||
#include "p3photoserviceV2.h"
|
||||
#include "serialiser/rsphotov2items.h"
|
||||
#include "gxs/rsgxsflags.h"
|
||||
|
||||
RsPhotoV2 *rsPhotoV2 = NULL;
|
||||
|
||||
|
@ -7,6 +8,7 @@ p3PhotoServiceV2::p3PhotoServiceV2(RsGeneralDataService* gds, RsNetworkExchangeS
|
|||
: RsGenExchange(gds, nes, new RsGxsPhotoSerialiser(), RS_SERVICE_TYPE_PHOTO)
|
||||
{
|
||||
|
||||
|
||||
}
|
||||
|
||||
bool p3PhotoServiceV2::updated()
|
||||
|
@ -146,6 +148,13 @@ bool p3PhotoServiceV2::submitAlbumDetails(uint32_t& token, RsPhotoAlbum& album)
|
|||
return true;
|
||||
}
|
||||
|
||||
bool p3PhotoServiceV2::subscribeToAlbum(uint32_t &token, const RsGxsGroupId &grpId)
|
||||
{
|
||||
|
||||
RsGenExchange::setGroupSubscribeFlag(token, grpId, GXS_SERV::GROUP_SUBSCRIBE_SUBSCRIBED);
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
|
||||
void p3PhotoServiceV2::notifyChanges(std::vector<RsGxsNotify*>& changes)
|
||||
|
|
|
@ -39,7 +39,7 @@ public:
|
|||
public:
|
||||
|
||||
/*!
|
||||
* @return
|
||||
* @return true if a change has occured
|
||||
*/
|
||||
bool updated();
|
||||
|
||||
|
@ -78,9 +78,30 @@ public:
|
|||
|
||||
/** Modifications **/
|
||||
|
||||
/*!
|
||||
* submits album, which returns a token that needs
|
||||
* to be acknowledge to get album grp id
|
||||
* @param token token to redeem for acknowledgement
|
||||
* @param album album to be submitted
|
||||
*/
|
||||
bool submitAlbumDetails(uint32_t& token, RsPhotoAlbum &album);
|
||||
|
||||
/*!
|
||||
* submits photo, which returns a token that needs
|
||||
* to be acknowledge to get photo msg-grp id pair
|
||||
* @param token token to redeem for acknowledgement
|
||||
* @param photo photo to be submitted
|
||||
*/
|
||||
bool submitPhoto(uint32_t& token, RsPhotoPhoto &photo);
|
||||
|
||||
/*!
|
||||
* subscribes to group, and returns token which can be used
|
||||
* to be acknowledged to get group Id
|
||||
* @param token token to redeem for acknowledgement
|
||||
* @param grpId the id of the group to subscribe to
|
||||
*/
|
||||
bool subscribeToAlbum(uint32_t& token, const RsGxsGroupId& grpId);
|
||||
|
||||
/*!
|
||||
* This allows the client service to acknowledge that their msgs has
|
||||
* been created/modified and retrieve the create/modified msg ids
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue