mirror of
https://github.com/RetroShare/RetroShare.git
synced 2025-07-25 23:45:49 -04:00
fixed merge with upstream/master
This commit is contained in:
commit
2bab688dec
99 changed files with 4868 additions and 904 deletions
|
@ -54,6 +54,82 @@ public:
|
|||
RsMsgMetaData meta;
|
||||
};
|
||||
|
||||
// We should make these items templates or generic classes so that each GXS service will handle them on its own.
|
||||
|
||||
static const uint8_t RS_PKT_SUBTYPE_GXS_SUBSTRING_SEARCH_ITEM = 0x20 ;
|
||||
static const uint8_t RS_PKT_SUBTYPE_GXS_GROUP_SEARCH_ITEM = 0x21 ;
|
||||
static const uint8_t RS_PKT_SUBTYPE_GXS_GROUP_SUMMARY_ITEM = 0x22 ;
|
||||
static const uint8_t RS_PKT_SUBTYPE_GXS_GROUP_DATA_ITEM = 0x23 ;
|
||||
|
||||
class RsGxsTurtleSubStringSearchItem: public RsItem
|
||||
{
|
||||
public:
|
||||
RsGxsTurtleSubStringSearchItem(uint16_t service): RsItem(RS_PKT_VERSION_SERVICE,service,RS_PKT_SUBTYPE_GXS_SUBSTRING_SEARCH_ITEM) {}
|
||||
virtual ~RsGxsTurtleSubStringSearchItem() {}
|
||||
|
||||
std::string match_string ; // string to match
|
||||
|
||||
std::string GetKeywords() { return match_string; }
|
||||
void clear() { match_string.clear() ; }
|
||||
|
||||
protected:
|
||||
void serial_process(RsGenericSerializer::SerializeJob j,RsGenericSerializer::SerializeContext& ctx);
|
||||
};
|
||||
|
||||
class RsGxsTurtleGroupSearchItem: public RsItem
|
||||
{
|
||||
public:
|
||||
RsGxsTurtleGroupSearchItem(uint16_t service): RsItem(RS_PKT_VERSION_SERVICE,service,RS_PKT_SUBTYPE_GXS_GROUP_SEARCH_ITEM) {}
|
||||
virtual ~RsGxsTurtleGroupSearchItem() {}
|
||||
|
||||
uint16_t service_id ; // searvice to search
|
||||
Sha1CheckSum hashed_group_id ; // the group ID is hashed in order to keep it private.
|
||||
|
||||
std::string GetKeywords() { return std::string("Group request for [hashed] ")+hashed_group_id.toStdString() ; }
|
||||
void clear() { hashed_group_id.clear() ; }
|
||||
|
||||
protected:
|
||||
void serial_process(RsGenericSerializer::SerializeJob j,RsGenericSerializer::SerializeContext& ctx);
|
||||
};
|
||||
|
||||
struct TurtleGxsInfo
|
||||
{
|
||||
uint16_t service_id ;
|
||||
RsGxsGroupId group_id ;
|
||||
RsGxsId author;
|
||||
std::string name ;
|
||||
std::string description ;
|
||||
time_t last_post ;
|
||||
uint32_t number_of_posts ;
|
||||
};
|
||||
|
||||
class RsTurtleGxsSearchResultGroupSummaryItem: public RsItem
|
||||
{
|
||||
public:
|
||||
RsTurtleGxsSearchResultGroupSummaryItem(uint16_t service) : RsItem(RS_PKT_VERSION_SERVICE,service,RS_PKT_SUBTYPE_GXS_GROUP_SUMMARY_ITEM){}
|
||||
virtual ~RsTurtleGxsSearchResultGroupSummaryItem() {}
|
||||
|
||||
std::list<TurtleGxsInfo> result ;
|
||||
|
||||
void clear() { result.clear() ; }
|
||||
protected:
|
||||
void serial_process(RsGenericSerializer::SerializeJob j,RsGenericSerializer::SerializeContext& ctx);
|
||||
};
|
||||
|
||||
class RsTurtleGxsSearchResultGroupDataItem: public RsItem
|
||||
{
|
||||
public:
|
||||
RsTurtleGxsSearchResultGroupDataItem(uint16_t service) : RsItem(RS_PKT_VERSION_SERVICE,service,RS_PKT_SUBTYPE_GXS_GROUP_DATA_ITEM){}
|
||||
virtual ~RsTurtleGxsSearchResultGroupDataItem() {}
|
||||
|
||||
unsigned char *encrypted_nxs_group_data; // data is encrypted with group ID. Only the requester, or anyone who already know the group id can decrypt.
|
||||
uint32_t encrypted_nxs_group_data_len ;
|
||||
|
||||
void clear() { free(encrypted_nxs_group_data); encrypted_nxs_group_data=NULL; encrypted_nxs_group_data_len=0; }
|
||||
protected:
|
||||
void serial_process(RsGenericSerializer::SerializeJob j,RsGenericSerializer::SerializeContext& ctx);
|
||||
};
|
||||
|
||||
|
||||
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue