From c61ccda4313c3b48990be367a21681ad060bde68 Mon Sep 17 00:00:00 2001 From: csoler Date: Tue, 7 Feb 2017 22:04:07 +0100 Subject: [PATCH] fixed compilation problem caused by a bug in qtcreator global replace. Warning: always check the result of qtcreator global replace --- libresapi/src/api/IdentityHandler.cpp | 3 ++- libretroshare/src/retroshare/rsidentity.h | 4 ++-- libretroshare/src/services/p3idservice.cc | 14 +++++++------- .../src/gui/Identity/IdDetailsDialog.cpp | 8 ++++++-- 4 files changed, 17 insertions(+), 12 deletions(-) diff --git a/libresapi/src/api/IdentityHandler.cpp b/libresapi/src/api/IdentityHandler.cpp index bfaecfc72..4d3f0ff80 100644 --- a/libresapi/src/api/IdentityHandler.cpp +++ b/libresapi/src/api/IdentityHandler.cpp @@ -156,7 +156,8 @@ void IdentityHandler::handleWildcard(Request & /*req*/, Response &resp) RsGxsIdGroup& grp = *vit; //electron: not very happy about this, i think the flags should stay hidden in rsidentities bool own = (grp.mMeta.mSubscribeFlags & GXS_SERV::GROUP_SUBSCRIBE_ADMIN); - bool pgp_linked = (grp.mMeta.mGroupFlags & RSGXSID_GROUPFLAG_REALID_deprecateRSGXSID_GROUPFLAG_REALID_kept_for_compatibilityMember() + bool pgp_linked = (grp.mMeta.mGroupFlags & RSGXSID_GROUPFLAG_REALID_kept_for_compatibility ) ; + resp.mDataStream.getStreamToMember() << makeKeyValueReference("id", grp.mMeta.mGroupId) /// @deprecated using "id" as key can cause problems in some JS based languages like Qml @see gxs_id instead << makeKeyValueReference("gxs_id", grp.mMeta.mGroupId) << makeKeyValueReference("pgp_id",grp.mPgpId ) diff --git a/libretroshare/src/retroshare/rsidentity.h b/libretroshare/src/retroshare/rsidentity.h index 143f39d2a..82f4932a3 100644 --- a/libretroshare/src/retroshare/rsidentity.h +++ b/libretroshare/src/retroshare/rsidentity.h @@ -47,8 +47,8 @@ extern RsIdentity *rsIdentity; // The deprecated flag overlaps the privacy flags for mGroupFlags. This is an error that should be fixed. For the sake of keeping some // backward compatibility, we need to make the change step by step. -#define RSGXSID_GROUPFLAG_REALID_deprecated 0x0001 -#define RSGXSID_GROUPFLAG_REALID 0x0100 +#define RSGXSID_GROUPFLAG_REALID_kept_for_compatibility 0x0001 +#define RSGXSID_GROUPFLAG_REALID 0x0100 // THESE ARE FLAGS FOR INTERFACE. #define RSID_TYPE_MASK 0xff00 diff --git a/libretroshare/src/services/p3idservice.cc b/libretroshare/src/services/p3idservice.cc index 35971f62a..a81d9ccf9 100644 --- a/libretroshare/src/services/p3idservice.cc +++ b/libretroshare/src/services/p3idservice.cc @@ -1274,7 +1274,7 @@ bool p3IdService::opinion_handlerequest(uint32_t token) } // update IdScore too. - bool pgpId = (meta.mGroupFlags & RSGXSID_GROUPFLAG_REALID_deprecated); + bool pgpId = (meta.mGroupFlags & RSGXSID_GROUPFLAG_REALID_kept_for_compatibility); ssdata.score.rep.updateIdScore(pgpId, ssdata.pgp.validatedSignature); ssdata.score.rep.update(); @@ -1890,7 +1890,7 @@ void RsGxsIdCache::init(const RsGxsIdGroupItem *item, const RsTlvPublicRSAKey& i details.mFlags = 0 ; if(item->meta.mSubscribeFlags & GXS_SERV::GROUP_SUBSCRIBE_ADMIN) details.mFlags |= RS_IDENTITY_FLAGS_IS_OWN_ID; - if(item->meta.mGroupFlags & RSGXSID_GROUPFLAG_REALID_deprecated) details.mFlags |= RS_IDENTITY_FLAGS_PGP_LINKED; + if(item->meta.mGroupFlags & RSGXSID_GROUPFLAG_REALID_kept_for_compatibility) details.mFlags |= RS_IDENTITY_FLAGS_PGP_LINKED; // do some tests if(details.mFlags & RS_IDENTITY_FLAGS_IS_OWN_ID) @@ -2844,7 +2844,7 @@ RsGenExchange::ServiceCreate_Return p3IdService::service_CreateGroup(RsGxsGrpIte ServiceCreate_Return createStatus; - if (item->meta.mGroupFlags & RSGXSID_GROUPFLAG_REALID_deprecated) + if (item->meta.mGroupFlags & RSGXSID_GROUPFLAG_REALID_kept_for_compatibility) { /* create the hash */ Sha1CheckSum hash; @@ -3047,7 +3047,7 @@ bool p3IdService::pgphash_handlerequest(uint32_t token) #endif // DEBUG_IDS /* Filter based on IdType */ - if (!(vit->mMeta.mGroupFlags & RSGXSID_GROUPFLAG_REALID_deprecated)) + if (!(vit->mMeta.mGroupFlags & RSGXSID_GROUPFLAG_REALID_kept_for_compatibility)) { #ifdef DEBUG_IDS std::cerr << "p3IdService::pgphash_request() discarding AnonID"; @@ -3623,7 +3623,7 @@ bool p3IdService::recogn_process() ssdata.recogntags.publishTs = item->meta.mPublishTs; // update IdScore too. - bool pgpId = (item->meta.mGroupFlags & RSGXSID_GROUPFLAG_REALID_deprecated); + bool pgpId = (item->meta.mGroupFlags & RSGXSID_GROUPFLAG_REALID_kept_for_compatibility); ssdata.score.rep.updateIdScore(pgpId, ssdata.pgp.validatedSignature); ssdata.score.rep.update(); @@ -3844,7 +3844,7 @@ void p3IdService::generateDummy_FriendPGP() RsGxsIdGroup id; - id.mMeta.mGroupFlags = RSGXSID_GROUPFLAG_REALID_deprecated; + id.mMeta.mGroupFlags = RSGXSID_GROUPFLAG_REALID_kept_for_compatibility; int idx = RSRandom::random_f32() * (gpgids.size() - 1); it = gpgids.begin(); @@ -3881,7 +3881,7 @@ void p3IdService::generateDummy_UnknownPGP() RsGxsIdGroup id; // FAKE DATA. - id.mMeta.mGroupFlags = RSGXSID_GROUPFLAG_REALID_deprecated; + id.mMeta.mGroupFlags = RSGXSID_GROUPFLAG_REALID_kept_for_compatibility; id.mPgpIdHash = Sha1CheckSum::random() ; id.mPgpIdSign = RSRandom::random_alphaNumericString(20) ; id.mMeta.mGroupName = RSRandom::random_alphaNumericString(10) ; diff --git a/retroshare-gui/src/gui/Identity/IdDetailsDialog.cpp b/retroshare-gui/src/gui/Identity/IdDetailsDialog.cpp index e70243126..92b607d8f 100644 --- a/retroshare-gui/src/gui/Identity/IdDetailsDialog.cpp +++ b/retroshare-gui/src/gui/Identity/IdDetailsDialog.cpp @@ -204,7 +204,7 @@ void IdDetailsDialog::insertIdDetails(uint32_t token) } else { -RSGXSID_GROUPFLAG_REALID_kept_for_compatibilitySID_GROUPFLAG_REALID_deprecated) + if(data.mMeta.mGroupFlags & RSGXSID_GROUPFLAG_REALID_kept_for_compatibility) { ui->lineEdit_GpgName->setText(tr("Unknown real name")); } @@ -232,11 +232,15 @@ RSGXSID_GROUPFLAG_REALID_kept_for_compatibilitySID_GROUPFLAG_REALID_deprecated) bool isOwnId = (data.mPgpKnown && (data.mPgpId == ownPgpId)) || (data.mMeta.mSubscribeFlags & GXS_SERV::GROUP_SUBSCRIBE_ADMIN); if (isOwnId) + { if (data.mPgpKnown) ui->lineEdit_Type->setText(tr("Identity owned by you, linked to your Retroshare node")) ; else ui->lineEdit_Type->setText(tr("Anonymous identity, owned by you")) ; - else if (data.mMeta.mGroupFlags & RSGXSID_GROUPFLRSGXSID_GROUPFLAG_REALID_kept_for_compatibility.mPgpKnown) + } + else if (data.mMeta.mGroupFlags & RSGXSID_GROUPFLAG_REALID_kept_for_compatibility) + { + if(data.mPgpKnown) if (rsPeers->isGPGAccepted(data.mPgpId)) ui->lineEdit_Type->setText(tr("Owned by a friend Retroshare node")) ; else