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:
drbob 2013-10-20 09:43:30 +00:00
parent 19d7faa572
commit fc58861447
19 changed files with 2645 additions and 101 deletions

View file

@ -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 &params) = 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.