2012-06-26 15:52:01 -04:00
|
|
|
#ifndef RSGXSMETA_H
|
|
|
|
#define RSGXSMETA_H
|
|
|
|
|
2012-08-06 17:00:38 -04:00
|
|
|
/*
|
|
|
|
* libretroshare/src/gxs: rsgxsdata.h
|
|
|
|
*
|
|
|
|
* Gxs Data types used to specific services
|
|
|
|
*
|
|
|
|
* Copyright 2012-2012 by Christopher Evi-Parker, Robert Fernie
|
|
|
|
*
|
|
|
|
* This library is free software; you can redistribute it and/or
|
|
|
|
* modify it under the terms of the GNU Library General Public
|
|
|
|
* License Version 2 as published by the Free Software Foundation.
|
|
|
|
*
|
|
|
|
* This library is distributed in the hope that it will be useful,
|
|
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
|
|
|
* Library General Public License for more details.
|
|
|
|
*
|
|
|
|
* You should have received a copy of the GNU Library General Public
|
|
|
|
* License along with this library; if not, write to the Free Software
|
|
|
|
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
|
|
|
|
* USA.
|
|
|
|
*
|
|
|
|
* Please report all bugs and problems to "retroshare@lunamutt.com".
|
|
|
|
*
|
|
|
|
*/
|
|
|
|
|
2012-06-26 15:52:01 -04:00
|
|
|
#include <string>
|
|
|
|
|
|
|
|
#include "serialiser/rsserial.h"
|
|
|
|
#include "serialiser/rstlvtypes.h"
|
|
|
|
#include "serialiser/rstlvkeys.h"
|
2012-07-26 17:48:54 -04:00
|
|
|
#include "serialiser/rsgxsitems.h"
|
2012-06-26 15:52:01 -04:00
|
|
|
|
2012-07-22 17:38:15 -04:00
|
|
|
typedef std::string RsGxsGroupId;
|
|
|
|
typedef std::string RsGxsMessageId;
|
|
|
|
typedef std::pair<RsGxsGroupId, RsGxsMessageId> RsGxsGrpMsgIdPair;
|
|
|
|
|
2012-07-26 17:48:54 -04:00
|
|
|
class RsGroupMetaData;
|
|
|
|
class RsMsgMetaData;
|
2012-07-22 17:38:15 -04:00
|
|
|
|
2012-06-26 15:52:01 -04:00
|
|
|
class RsGxsGrpMetaData
|
|
|
|
{
|
|
|
|
public:
|
|
|
|
|
|
|
|
RsGxsGrpMetaData();
|
|
|
|
bool deserialise(void *data, uint32_t &pktsize);
|
|
|
|
bool serialise(void* data, uint32_t &pktsize);
|
|
|
|
uint32_t serial_size();
|
2012-06-28 17:22:55 -04:00
|
|
|
void clear();
|
2012-07-26 17:48:54 -04:00
|
|
|
void operator =(const RsGroupMetaData& rMeta);
|
2012-06-26 15:52:01 -04:00
|
|
|
|
2012-07-22 17:38:15 -04:00
|
|
|
RsGxsGroupId mGroupId;
|
|
|
|
RsGxsGroupId mOrigGrpId;
|
2012-06-26 15:52:01 -04:00
|
|
|
std::string mGroupName;
|
|
|
|
uint32_t mGroupFlags;
|
|
|
|
uint32_t mPublishTs;
|
2012-08-26 10:02:47 -04:00
|
|
|
uint32_t mSignFlags;
|
2012-06-26 15:52:01 -04:00
|
|
|
std::string mAuthorId;
|
|
|
|
|
|
|
|
|
2012-10-01 16:57:56 -04:00
|
|
|
RsTlvKeySignatureSet signSet;
|
2012-06-26 15:52:01 -04:00
|
|
|
RsTlvSecurityKeySet keys;
|
|
|
|
|
2012-08-18 06:01:35 -04:00
|
|
|
std::string mServiceString;
|
2012-06-26 15:52:01 -04:00
|
|
|
|
|
|
|
// BELOW HERE IS LOCAL DATA, THAT IS NOT FROM MSG.
|
|
|
|
|
|
|
|
uint32_t mSubscribeFlags;
|
|
|
|
|
|
|
|
uint32_t mPop; // HOW DO WE DO THIS NOW.
|
|
|
|
uint32_t mMsgCount; // ???
|
|
|
|
time_t mLastPost; // ???
|
|
|
|
|
|
|
|
uint32_t mGroupStatus;
|
|
|
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
class RsGxsMsgMetaData
|
|
|
|
{
|
|
|
|
public:
|
|
|
|
|
|
|
|
RsGxsMsgMetaData();
|
|
|
|
bool deserialise(void *data, uint32_t *size);
|
|
|
|
bool serialise(void* data, uint32_t *size);
|
|
|
|
uint32_t serial_size();
|
2012-06-28 17:22:55 -04:00
|
|
|
void clear();
|
2012-07-26 17:48:54 -04:00
|
|
|
void operator =(const RsMsgMetaData& rMeta);
|
2012-06-26 15:52:01 -04:00
|
|
|
|
2012-07-22 17:38:15 -04:00
|
|
|
RsGxsGroupId mGroupId;
|
|
|
|
RsGxsMessageId mMsgId;
|
2012-06-26 15:52:01 -04:00
|
|
|
|
2012-07-22 17:38:15 -04:00
|
|
|
RsGxsMessageId mThreadId;
|
|
|
|
RsGxsMessageId mParentId;
|
|
|
|
RsGxsMessageId mOrigMsgId;
|
2012-06-26 15:52:01 -04:00
|
|
|
std::string mAuthorId;
|
|
|
|
|
2012-10-01 16:57:56 -04:00
|
|
|
RsTlvKeySignatureSet signSet;
|
2012-06-26 15:52:01 -04:00
|
|
|
|
2012-08-18 06:01:35 -04:00
|
|
|
std::string mServiceString;
|
|
|
|
|
2012-06-26 15:52:01 -04:00
|
|
|
std::string mMsgName;
|
|
|
|
time_t mPublishTs;
|
|
|
|
uint32_t mMsgFlags; // Whats this for?
|
|
|
|
|
|
|
|
// BELOW HERE IS LOCAL DATA, THAT IS NOT FROM MSG.
|
|
|
|
// normally READ / UNREAD flags. LOCAL Data.
|
2012-10-21 15:45:35 -04:00
|
|
|
|
2012-06-26 15:52:01 -04:00
|
|
|
uint32_t mMsgStatus;
|
|
|
|
time_t mChildTs;
|
|
|
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
#endif // RSGXSMETA_H
|