mirror of
https://github.com/RetroShare/RetroShare.git
synced 2025-02-17 13:24:15 -05:00
Bits and pieces to get forums compiled.
- Added some MACROS - could be moved to GXS headers? - fixed some GXS compile warnings. - added MsgReadStatus to forums interface git-svn-id: http://svn.code.sf.net/p/retroshare/code/branches/v0.5-gxs-b1@5806 b45a01b8-16f6-495d-af2f-9b41ad6348cc
This commit is contained in:
parent
c9831b7bea
commit
6906f47fa7
@ -33,6 +33,13 @@
|
||||
#include "gxs/rstokenservice.h"
|
||||
#include "gxs/rsgxsifaceimpl.h"
|
||||
|
||||
|
||||
#define IS_MSG_UNREAD(status) (status & GXS_SERV::GXS_MSG_STATUS_UNREAD)
|
||||
#define IS_GROUP_ADMIN(subscribeFlags) (subscribeFlags & GXS_SERV::GROUP_SUBSCRIBE_ADMIN)
|
||||
#define IS_GROUP_SUBSCRIBED(subscribeFlags) (subscribeFlags & (GXS_SERV::GROUP_SUBSCRIBE_ADMIN | GXS_SERV::GROUP_SUBSCRIBE_SUBSCRIBED))
|
||||
|
||||
|
||||
|
||||
/* The Main Interface Class - for information about your Peers */
|
||||
class RsGxsForums;
|
||||
extern RsGxsForums *rsGxsForums;
|
||||
@ -70,6 +77,8 @@ virtual bool getGroupData(const uint32_t &token, std::vector<RsGxsForumGroup> &g
|
||||
virtual bool getMsgData(const uint32_t &token, std::vector<RsGxsForumMsg> &msgs) = 0;
|
||||
|
||||
//////////////////////////////////////////////////////////////////////////////
|
||||
virtual void setMessageReadStatus(uint32_t& token, const RsGxsGrpMsgIdPair& msgId, bool read) = 0;
|
||||
|
||||
//virtual bool setMessageStatus(const std::string &msgId, const uint32_t status, const uint32_t statusMask);
|
||||
//virtual bool setGroupSubscribeFlags(const std::string &groupId, uint32_t subscribeFlags, uint32_t subscribeMask);
|
||||
|
||||
|
@ -206,9 +206,10 @@ class RsTokReqOptionsVEG
|
||||
|
||||
|
||||
// Some MACROS for EASE OF USE. (USED BY FORUMSV2 At the moment.
|
||||
#define IS_MSG_UNREAD(status) ((status & RSGXS_MSG_STATUS_READ) == 0 || (status & RSGXS_MSG_STATUS_UNREAD_BY_USER))
|
||||
#define IS_GROUP_ADMIN(subscribeFlags) (subscribeFlags & RSGXS_GROUP_SUBSCRIBE_ADMIN)
|
||||
#define IS_GROUP_SUBSCRIBED(subscribeFlags) (subscribeFlags & (RSGXS_GROUP_SUBSCRIBE_ADMIN | RSGXS_GROUP_SUBSCRIBE_SUBSCRIBED))
|
||||
// MOVED TO REAL GXS STUFF
|
||||
//#define IS_MSG_UNREAD(status) ((status & RSGXS_MSG_STATUS_READ) == 0 || (status & RSGXS_MSG_STATUS_UNREAD_BY_USER))
|
||||
//#define IS_GROUP_ADMIN(subscribeFlags) (subscribeFlags & RSGXS_GROUP_SUBSCRIBE_ADMIN)
|
||||
//#define IS_GROUP_SUBSCRIBED(subscribeFlags) (subscribeFlags & (RSGXS_GROUP_SUBSCRIBE_ADMIN | RSGXS_GROUP_SUBSCRIBE_SUBSCRIBED))
|
||||
|
||||
|
||||
|
||||
|
@ -262,7 +262,7 @@ class RsNxsMsg : public RsNxsItem
|
||||
{
|
||||
public:
|
||||
|
||||
RsNxsMsg(uint16_t servtype) : RsNxsItem(servtype, RS_PKT_SUBTYPE_NXS_MSG), msg(servtype), meta(servtype),
|
||||
RsNxsMsg(uint16_t servtype) : RsNxsItem(servtype, RS_PKT_SUBTYPE_NXS_MSG), meta(servtype), msg(servtype),
|
||||
metaData(NULL) { clear(); return; }
|
||||
~RsNxsMsg() { if(metaData) delete metaData; }
|
||||
|
||||
@ -299,7 +299,7 @@ public:
|
||||
virtual ~RsNxsSearchReq() { return;}
|
||||
|
||||
virtual void clear() { return;}
|
||||
virtual std::ostream &print(std::ostream &out, uint16_t indent) { return out; }
|
||||
virtual std::ostream &print(std::ostream &out, uint16_t /*indent*/) { return out; }
|
||||
|
||||
uint8_t nHops; /// how many peers to jump to
|
||||
uint32_t token; // search token
|
||||
@ -337,7 +337,7 @@ public:
|
||||
|
||||
RsNxsSearchResultMsg() : context(0) { return;}
|
||||
void clear() {}
|
||||
std::ostream &print(std::ostream &out, uint16_t indent) { return out; }
|
||||
std::ostream &print(std::ostream &out, uint16_t /*indent*/) { return out; }
|
||||
|
||||
uint32_t token; // search token to be redeemed
|
||||
RsTlvBinaryData context; // used by client service
|
||||
@ -358,7 +358,7 @@ public:
|
||||
|
||||
RsNxsSearchResultGrp();
|
||||
void clear() {}
|
||||
std::ostream &print(std::ostream &out, uint16_t indent) { return out; }
|
||||
std::ostream &print(std::ostream &out, uint16_t /*indent*/) { return out; }
|
||||
|
||||
uint32_t token; // search token to be redeemed
|
||||
|
||||
|
@ -27,6 +27,7 @@
|
||||
#include "serialiser/rsgxsforumitems.h"
|
||||
|
||||
#include "util/rsrandom.h"
|
||||
#include "gxs/rsgxsflags.h"
|
||||
#include <stdio.h>
|
||||
|
||||
/****
|
||||
@ -150,6 +151,23 @@ bool p3GxsForums::createMsg(uint32_t &token, RsGxsForumMsg &msg)
|
||||
}
|
||||
|
||||
|
||||
/********************************************************************************************/
|
||||
/********************************************************************************************/
|
||||
|
||||
void p3GxsForums::setMessageReadStatus(uint32_t& token, const RsGxsGrpMsgIdPair& msgId, bool read)
|
||||
{
|
||||
uint32_t mask = GXS_SERV::GXS_MSG_STATUS_UNREAD;
|
||||
uint32_t status = GXS_SERV::GXS_MSG_STATUS_UNREAD;
|
||||
if (read)
|
||||
{
|
||||
status = 0;
|
||||
}
|
||||
|
||||
setMsgStatusFlags(token, msgId, status, mask);
|
||||
|
||||
}
|
||||
|
||||
/********************************************************************************************/
|
||||
/********************************************************************************************/
|
||||
|
||||
|
||||
|
@ -54,6 +54,8 @@ virtual bool getGroupData(const uint32_t &token, std::vector<RsGxsForumGroup> &g
|
||||
virtual bool getMsgData(const uint32_t &token, std::vector<RsGxsForumMsg> &msgs);
|
||||
|
||||
//////////////////////////////////////////////////////////////////////////////
|
||||
virtual void setMessageReadStatus(uint32_t& token, const RsGxsGrpMsgIdPair& msgId, bool read);
|
||||
|
||||
//virtual bool setMessageStatus(const std::string &msgId, const uint32_t status, const uint32_t statusMask);
|
||||
//virtual bool setGroupSubscribeFlags(const std::string &groupId, uint32_t subscribeFlags, uint32_t subscribeMask);
|
||||
|
||||
|
@ -198,6 +198,9 @@ bool p3Wiki::submitCollection(uint32_t &token, RsWikiCollection &collection)
|
||||
|
||||
bool p3Wiki::submitSnapshot(uint32_t &token, RsWikiSnapshot &snapshot)
|
||||
{
|
||||
std::cerr << "p3Wiki::submitSnapshot(): " << snapshot;
|
||||
std::cerr << std::endl;
|
||||
|
||||
RsGxsWikiSnapshotItem* snapshotItem = new RsGxsWikiSnapshotItem();
|
||||
snapshotItem->snapshot = snapshot;
|
||||
snapshotItem->meta = snapshot.mMeta;
|
||||
|
Loading…
x
Reference in New Issue
Block a user