mirror of
https://github.com/RetroShare/RetroShare.git
synced 2025-06-07 06:02:41 -04:00
merging rs_gxs-finale to v0.6 branch
git-svn-id: http://svn.code.sf.net/p/retroshare/code/branches/v0.6-initdev@6953 b45a01b8-16f6-495d-af2f-9b41ad6348cc
This commit is contained in:
commit
39909b705f
67 changed files with 5686 additions and 488 deletions
|
@ -84,6 +84,14 @@ virtual void setMessageReadStatus(uint32_t& token, const RsGxsGrpMsgIdPair& msgI
|
|||
virtual bool createGroup(uint32_t &token, RsGxsForumGroup &group) = 0;
|
||||
virtual bool createMsg(uint32_t &token, RsGxsForumMsg &msg) = 0;
|
||||
|
||||
/*!
|
||||
* To update forum group with new information
|
||||
* @param token the token used to check completion status of update
|
||||
* @param group group to be updated, groupId element must be set or will be rejected
|
||||
* @return false groupId not set, true if set and accepted (still check token for completion)
|
||||
*/
|
||||
virtual bool updateGroup(uint32_t &token, RsGxsGroupUpdateMeta&, RsGxsForumGroup &group) = 0;
|
||||
|
||||
};
|
||||
|
||||
|
||||
|
|
|
@ -46,8 +46,9 @@ public:
|
|||
|
||||
mGroupStatus = 0;
|
||||
mCircleType = 0;
|
||||
mAuthenFlags = 0;
|
||||
|
||||
//mPublishTs = 0;
|
||||
mPublishTs = 0;
|
||||
}
|
||||
|
||||
void operator =(const RsGxsGrpMetaData& rGxsMeta);
|
||||
|
@ -128,7 +129,6 @@ public:
|
|||
class GxsGroupStatistic
|
||||
{
|
||||
public:
|
||||
|
||||
/// number of message
|
||||
RsGxsGroupId mGrpId;
|
||||
uint32_t mNumMsgs;
|
||||
|
@ -147,4 +147,56 @@ public:
|
|||
uint32_t mSizeStore;
|
||||
};
|
||||
|
||||
class UpdateItem
|
||||
{
|
||||
public:
|
||||
virtual ~UpdateItem() { }
|
||||
};
|
||||
|
||||
class StringUpdateItem : public UpdateItem
|
||||
{
|
||||
public:
|
||||
StringUpdateItem(const std::string update) : mUpdate(update) {}
|
||||
const std::string& getUpdate() const { return mUpdate; }
|
||||
|
||||
private:
|
||||
std::string mUpdate;
|
||||
};
|
||||
|
||||
class RsGxsGroupUpdateMeta
|
||||
{
|
||||
public:
|
||||
|
||||
// expand as support is added for other utypes
|
||||
enum UpdateType { DESCRIPTION, NAME };
|
||||
|
||||
RsGxsGroupUpdateMeta(const std::string& groupId) : mGroupId(groupId) {}
|
||||
|
||||
typedef std::map<UpdateType, std::string> GxsMetaUpdate;
|
||||
|
||||
/*!
|
||||
* Only one item of a utype can exist
|
||||
* @param utype the type of meta update
|
||||
* @param item update item containing the change value
|
||||
*/
|
||||
void setMetaUpdate(UpdateType utype, const std::string& update)
|
||||
{
|
||||
mUpdates[utype] = update;
|
||||
}
|
||||
|
||||
/*!
|
||||
* @param utype update type to remove
|
||||
* @return false if update did not exist, true if update successfully removed
|
||||
*/
|
||||
bool removeUpdateType(UpdateType utype){ return mUpdates.erase(utype) == 1; }
|
||||
|
||||
const GxsMetaUpdate* getUpdates() const { return &mUpdates; }
|
||||
const std::string& getGroupId() const { return mGroupId; }
|
||||
|
||||
private:
|
||||
|
||||
GxsMetaUpdate mUpdates;
|
||||
std::string mGroupId;
|
||||
};
|
||||
|
||||
#endif /* RSGXSIFACETYPES_H_ */
|
||||
|
|
|
@ -55,6 +55,8 @@ extern RsIdentity *rsIdentity;
|
|||
#define RSID_RELATION_OTHER 0x0008
|
||||
#define RSID_RELATION_UNKNOWN 0x0010
|
||||
|
||||
#define RSRECOGN_MAX_TAGINFO 5
|
||||
|
||||
std::string rsIdTypeToString(uint32_t idtype);
|
||||
|
||||
class RsGxsIdGroup
|
||||
|
@ -82,6 +84,9 @@ class RsGxsIdGroup
|
|||
std::string mPgpIdHash;
|
||||
std::string mPgpIdSign; // Need a signature as proof - otherwise anyone could add others Hashes.
|
||||
|
||||
// Recognition Strings. MAX# defined above.
|
||||
std::list<std::string> mRecognTags;
|
||||
|
||||
// Not Serialised - for GUI's benefit.
|
||||
bool mPgpKnown;
|
||||
std::string mPgpId;
|
||||
|
@ -163,6 +168,36 @@ class RsIdOpinion
|
|||
|
||||
typedef std::string RsGxsId; // TMP. =>
|
||||
|
||||
class RsRecognTag
|
||||
{
|
||||
public:
|
||||
RsRecognTag(uint16_t tc, uint16_t tt, bool v)
|
||||
:tag_class(tc), tag_type(tt), valid(v) { return; }
|
||||
uint16_t tag_class;
|
||||
uint16_t tag_type;
|
||||
bool valid;
|
||||
};
|
||||
|
||||
|
||||
class RsRecognTagDetails
|
||||
{
|
||||
public:
|
||||
RsRecognTagDetails()
|
||||
:valid_from(0), valid_to(0), tag_class(0), tag_type(0),
|
||||
is_valid(false), is_pending(false) { return; }
|
||||
|
||||
time_t valid_from;
|
||||
time_t valid_to;
|
||||
uint16_t tag_class;
|
||||
uint16_t tag_type;
|
||||
|
||||
std::string signer;
|
||||
|
||||
bool is_valid;
|
||||
bool is_pending;
|
||||
};
|
||||
|
||||
|
||||
class RsIdentityDetails
|
||||
{
|
||||
public:
|
||||
|
@ -181,6 +216,9 @@ class RsIdentityDetails
|
|||
bool mPgpKnown;
|
||||
std::string mPgpId;
|
||||
|
||||
// Recogn details.
|
||||
std::list<RsRecognTag> mRecognTags;
|
||||
|
||||
// reputation details.
|
||||
double mOpinion;
|
||||
double mReputation;
|
||||
|
@ -230,6 +268,13 @@ virtual bool getOwnIds(std::list<RsGxsId> &ownIds) = 0;
|
|||
virtual bool submitOpinion(uint32_t& token, RsIdOpinion &opinion) = 0;
|
||||
virtual bool createIdentity(uint32_t& token, RsIdentityParameters ¶ms) = 0;
|
||||
|
||||
virtual bool updateIdentity(uint32_t& token, RsGxsIdGroup &group) = 0;
|
||||
|
||||
virtual bool parseRecognTag(const RsGxsId &id, const std::string &nickname,
|
||||
const std::string &tag, RsRecognTagDetails &details) = 0;
|
||||
virtual bool getRecognTagRequest(const RsGxsId &id, const std::string &comment,
|
||||
uint16_t tag_class, uint16_t tag_type, std::string &tag) = 0;
|
||||
|
||||
// Specific RsIdentity Functions....
|
||||
/* Specific Service Data */
|
||||
/* We expose these initially for testing / GUI purposes.
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue