From a556965813bc1fa0968e12405331299d879c00cf Mon Sep 17 00:00:00 2001 From: sehraf Date: Fri, 3 Aug 2018 19:10:09 +0200 Subject: [PATCH] further conversion to new wrapper function --- libretroshare/src/gxs/rsgenexchange.h | 2 +- libretroshare/src/pqi/p3servicecontrol.cc | 5 +---- libretroshare/src/services/p3service.h | 4 ++-- 3 files changed, 4 insertions(+), 7 deletions(-) diff --git a/libretroshare/src/gxs/rsgenexchange.h b/libretroshare/src/gxs/rsgenexchange.h index e4dd074eb..6a5a11851 100644 --- a/libretroshare/src/gxs/rsgenexchange.h +++ b/libretroshare/src/gxs/rsgenexchange.h @@ -685,7 +685,7 @@ public: virtual bool getGroupNetworkStats(const RsGxsGroupId& grpId,RsGroupNetworkStats& stats); uint16_t serviceType() const { return mServType ; } - uint32_t serviceFullType() const { return ((uint32_t)mServType << 8) + (((uint32_t) RS_PKT_VERSION_SERVICE) << 24); } + uint32_t serviceFullType() const { return RsServiceInfo::RsServiceInfoUIn16ToFullServiceId(mServType); } virtual RsReputations::ReputationLevel minReputationForForwardingMessages(uint32_t group_sign_flags,uint32_t identity_flags); protected: diff --git a/libretroshare/src/pqi/p3servicecontrol.cc b/libretroshare/src/pqi/p3servicecontrol.cc index 5207b9829..d111e27ac 100644 --- a/libretroshare/src/pqi/p3servicecontrol.cc +++ b/libretroshare/src/pqi/p3servicecontrol.cc @@ -459,10 +459,7 @@ bool p3ServiceControl::checkFilter(uint32_t serviceId, const RsPeerId &peerId) #endif // must allow ServiceInfo through, or we have nothing! -#define FULLID_SERVICEINFO ((((uint32_t) RS_PKT_VERSION_SERVICE) << 24) + ((RS_SERVICE_TYPE_SERVICEINFO) << 8)) - - //if (serviceId == RS_SERVICE_TYPE_SERVICEINFO) - if (serviceId == FULLID_SERVICEINFO) + if (serviceId == RsServiceInfo::RsServiceInfoUIn16ToFullServiceId(RS_SERVICE_TYPE_SERVICEINFO)) { #ifdef SERVICECONTROL_DEBUG std::cerr << "p3ServiceControl::checkFilter() Allowed SERVICEINFO"; diff --git a/libretroshare/src/services/p3service.h b/libretroshare/src/services/p3service.h index 4eb66c470..a394b1094 100644 --- a/libretroshare/src/services/p3service.h +++ b/libretroshare/src/services/p3service.h @@ -49,8 +49,8 @@ std::string generateRandomServiceId(); //TODO : encryption and upload / download rate implementation -// p3FastService(uint16_t type) -// :pqiService((((uint32_t) RS_PKT_VERSION_SERVICE) << 24) + (((uint32_t) type) << 8)), +// p3FastService(uint16_t type) +// :pqiService((RsServiceInfo::RsServiceInfoUIn16ToFullServiceId(type)), class p3FastService: public pqiService