2018-05-29 15:08:17 -04:00
|
|
|
/*******************************************************************************
|
|
|
|
* libretroshare/src/rsitems: rsposteditems.h *
|
|
|
|
* *
|
|
|
|
* libretroshare: retroshare core library *
|
|
|
|
* *
|
|
|
|
* Copyright 2012 by Robert Fernie <retroshare@lunamutt.com> *
|
|
|
|
* *
|
|
|
|
* This program is free software: you can redistribute it and/or modify *
|
|
|
|
* it under the terms of the GNU Lesser General Public License as *
|
|
|
|
* published by the Free Software Foundation, either version 3 of the *
|
|
|
|
* License, or (at your option) any later version. *
|
|
|
|
* *
|
|
|
|
* This program 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 Lesser General Public License for more details. *
|
|
|
|
* *
|
|
|
|
* You should have received a copy of the GNU Lesser General Public License *
|
|
|
|
* along with this program. If not, see <https://www.gnu.org/licenses/>. *
|
|
|
|
* *
|
|
|
|
*******************************************************************************/
|
2012-10-17 17:20:57 -04:00
|
|
|
#ifndef RSPOSTEDITEMS_H
|
|
|
|
#define RSPOSTEDITEMS_H
|
|
|
|
|
2017-04-18 15:11:37 -04:00
|
|
|
#include "rsitems/rsserviceids.h"
|
2017-04-26 08:28:25 -04:00
|
|
|
#include "rsitems/rsgxscommentitems.h"
|
|
|
|
#include "rsitems/rsgxsitems.h"
|
2012-10-17 17:20:57 -04:00
|
|
|
|
|
|
|
#include "retroshare/rsposted.h"
|
|
|
|
|
2017-04-27 08:41:31 -04:00
|
|
|
const uint8_t RS_PKT_SUBTYPE_POSTED_GRP_ITEM = 0x02;
|
2012-10-17 17:20:57 -04:00
|
|
|
const uint8_t RS_PKT_SUBTYPE_POSTED_POST_ITEM = 0x03;
|
|
|
|
|
2013-03-11 16:40:28 -04:00
|
|
|
class RsGxsPostedGroupItem : public RsGxsGrpItem
|
2012-10-17 17:20:57 -04:00
|
|
|
{
|
|
|
|
public:
|
2017-04-27 08:41:31 -04:00
|
|
|
RsGxsPostedGroupItem() : RsGxsGrpItem(RS_SERVICE_GXS_TYPE_POSTED, RS_PKT_SUBTYPE_POSTED_GRP_ITEM) {}
|
|
|
|
virtual ~RsGxsPostedGroupItem() {}
|
2012-10-17 17:20:57 -04:00
|
|
|
|
2013-03-11 16:40:28 -04:00
|
|
|
void clear();
|
2017-04-27 08:41:31 -04:00
|
|
|
virtual void serial_process(RsGenericSerializer::SerializeJob j,RsGenericSerializer::SerializeContext& ctx);
|
2012-10-17 17:20:57 -04:00
|
|
|
|
2013-03-11 16:40:28 -04:00
|
|
|
RsPostedGroup mGroup;
|
2012-10-17 17:20:57 -04:00
|
|
|
};
|
|
|
|
|
2013-03-11 16:40:28 -04:00
|
|
|
class RsGxsPostedPostItem : public RsGxsMsgItem
|
2012-10-17 17:20:57 -04:00
|
|
|
{
|
|
|
|
public:
|
2017-04-27 08:41:31 -04:00
|
|
|
RsGxsPostedPostItem() : RsGxsMsgItem(RS_SERVICE_GXS_TYPE_POSTED, RS_PKT_SUBTYPE_POSTED_POST_ITEM) {}
|
|
|
|
virtual ~RsGxsPostedPostItem() {}
|
2012-10-17 17:20:57 -04:00
|
|
|
|
2013-03-11 16:40:28 -04:00
|
|
|
void clear();
|
2017-04-27 08:41:31 -04:00
|
|
|
virtual void serial_process(RsGenericSerializer::SerializeJob j,RsGenericSerializer::SerializeContext& ctx);
|
2012-10-17 17:20:57 -04:00
|
|
|
|
2013-03-11 16:40:28 -04:00
|
|
|
RsPostedPost mPost;
|
2012-10-17 17:20:57 -04:00
|
|
|
};
|
|
|
|
|
2013-03-11 16:40:28 -04:00
|
|
|
class RsGxsPostedSerialiser : public RsGxsCommentSerialiser
|
2012-10-17 17:20:57 -04:00
|
|
|
{
|
2012-10-29 18:41:41 -04:00
|
|
|
public:
|
|
|
|
|
2017-04-27 08:41:31 -04:00
|
|
|
RsGxsPostedSerialiser() :RsGxsCommentSerialiser(RS_SERVICE_GXS_TYPE_POSTED) {}
|
2012-10-17 17:20:57 -04:00
|
|
|
|
2017-04-27 08:41:31 -04:00
|
|
|
virtual ~RsGxsPostedSerialiser() {}
|
2012-10-17 17:20:57 -04:00
|
|
|
|
2017-04-27 08:41:31 -04:00
|
|
|
virtual RsItem *create_item(uint16_t service_id,uint8_t item_subtype) const ;
|
2012-10-17 17:20:57 -04:00
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
#endif // RSPOSTEDITEMS_H
|