mirror of
https://github.com/RetroShare/RetroShare.git
synced 2025-05-17 13:30:36 -04:00
Added RecognTags.
- items are described in serialiser. - util functions in util/rsrecogn.cc are used to manipulate it. - these are attached to GxsIds, with new interface fns. - Associated Signing Code is in a separate program. Other Tweaks. - Added RsMemCache::erase() - Added RsTlvStringSetRef - Fix for rsturtleitem (already added to trunk). - Formatting and debugging. Status: There is a bug in RsGenExchange::updateGroup which prevents full testing, The basic generation, parsing and validation functions have been tested and are ok. The processing as part of p3IdService still needs to be fully debugged. git-svn-id: http://svn.code.sf.net/p/retroshare/code/branches/v0.5-gxs_finale@6854 b45a01b8-16f6-495d-af2f-9b41ad6348cc
This commit is contained in:
parent
19d7faa572
commit
fc58861447
19 changed files with 2645 additions and 101 deletions
|
@ -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