mirror of
https://github.com/RetroShare/RetroShare.git
synced 2025-01-24 14:23:36 -05:00
Implement RsNxsSerialiser::create_item for RsNxsPullRequestItem
This commit is contained in:
parent
e4f25a558d
commit
a374f1dc6b
@ -64,6 +64,12 @@ RsItem *RsNxsSerialiser::create_item(uint16_t service_id,uint8_t item_subtype) c
|
|||||||
if(service_id != SERVICE_TYPE)
|
if(service_id != SERVICE_TYPE)
|
||||||
return NULL ;
|
return NULL ;
|
||||||
|
|
||||||
|
switch(static_cast<RsNxsSubtype>(item_subtype))
|
||||||
|
{
|
||||||
|
case RsNxsSubtype::PULL_REQUEST:
|
||||||
|
return new RsNxsPullRequestItem(static_cast<RsServiceType>(service_id));
|
||||||
|
}
|
||||||
|
|
||||||
switch(item_subtype)
|
switch(item_subtype)
|
||||||
{
|
{
|
||||||
case RS_PKT_SUBTYPE_NXS_SYNC_GRP_REQ_ITEM: return new RsNxsSyncGrpReqItem(SERVICE_TYPE) ;
|
case RS_PKT_SUBTYPE_NXS_SYNC_GRP_REQ_ITEM: return new RsNxsSyncGrpReqItem(SERVICE_TYPE) ;
|
||||||
|
@ -35,8 +35,12 @@
|
|||||||
#include "serialiser/rstlvkeys.h"
|
#include "serialiser/rstlvkeys.h"
|
||||||
#include "gxs/rsgxsdata.h"
|
#include "gxs/rsgxsdata.h"
|
||||||
|
|
||||||
// These items have "flag type" numbers, but this is not used.
|
enum class RsNxsSubtype : uint8_t
|
||||||
|
{
|
||||||
|
PULL_REQUEST = 0x90 /// @see RsNxsPullRequestItem
|
||||||
|
};
|
||||||
|
|
||||||
|
// These items have "flag type" numbers, but this is not used.
|
||||||
// TODO: refactor as C++11 enum class
|
// TODO: refactor as C++11 enum class
|
||||||
const uint8_t RS_PKT_SUBTYPE_NXS_SYNC_GRP_REQ_ITEM = 0x01;
|
const uint8_t RS_PKT_SUBTYPE_NXS_SYNC_GRP_REQ_ITEM = 0x01;
|
||||||
const uint8_t RS_PKT_SUBTYPE_NXS_SYNC_GRP_ITEM = 0x02;
|
const uint8_t RS_PKT_SUBTYPE_NXS_SYNC_GRP_ITEM = 0x02;
|
||||||
@ -50,10 +54,6 @@ const uint8_t RS_PKT_SUBTYPE_NXS_MSG_ITEM = 0x20;
|
|||||||
const uint8_t RS_PKT_SUBTYPE_NXS_TRANSAC_ITEM = 0x40;
|
const uint8_t RS_PKT_SUBTYPE_NXS_TRANSAC_ITEM = 0x40;
|
||||||
const uint8_t RS_PKT_SUBTYPE_NXS_GRP_PUBLISH_KEY_ITEM = 0x80;
|
const uint8_t RS_PKT_SUBTYPE_NXS_GRP_PUBLISH_KEY_ITEM = 0x80;
|
||||||
|
|
||||||
enum class RsNxsSubtype : uint8_t
|
|
||||||
{
|
|
||||||
PULL_REQUEST = 0x90 /// @see RsNxsPullRequestItem
|
|
||||||
};
|
|
||||||
|
|
||||||
#ifdef RS_DEAD_CODE
|
#ifdef RS_DEAD_CODE
|
||||||
// possibility create second service to deal with this functionality
|
// possibility create second service to deal with this functionality
|
||||||
@ -525,8 +525,9 @@ class RsNxsSerialiser : public RsServiceSerializer
|
|||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
|
|
||||||
explicit RsNxsSerialiser(uint16_t servtype) : RsServiceSerializer(servtype), SERVICE_TYPE(servtype) {}
|
explicit RsNxsSerialiser(uint16_t servtype):
|
||||||
virtual ~RsNxsSerialiser() {}
|
RsServiceSerializer(servtype), SERVICE_TYPE(servtype) {}
|
||||||
|
virtual ~RsNxsSerialiser() = default;
|
||||||
|
|
||||||
|
|
||||||
virtual RsItem *create_item(uint16_t service_id,uint8_t item_subtype) const ;
|
virtual RsItem *create_item(uint16_t service_id,uint8_t item_subtype) const ;
|
||||||
|
Loading…
Reference in New Issue
Block a user