diff --git a/libretroshare/src/services/p3idservice.cc b/libretroshare/src/services/p3idservice.cc index b09f2b883..dc2d53cb3 100644 --- a/libretroshare/src/services/p3idservice.cc +++ b/libretroshare/src/services/p3idservice.cc @@ -810,9 +810,15 @@ bool p3IdService::getOwnIds(std::list &ownIds,bool signed_only) return true ; } +bool p3IdService::isKnownId(const RsGxsId& id) +{ + RS_STACK_MUTEX(mIdMtx); + return mKeyCache.is_cached(id) || + std::find(mOwnIds.begin(), mOwnIds.end(),id) != mOwnIds.end(); +} bool p3IdService::identityToBase64( const RsGxsId& id, - std::string& base64String ) + std::string& base64String ) { return serialiseIdentityToMemory(id, base64String); } bool p3IdService::serialiseIdentityToMemory( const RsGxsId& id, diff --git a/libretroshare/src/services/p3idservice.h b/libretroshare/src/services/p3idservice.h index 64e335ef5..0b8f433b6 100644 --- a/libretroshare/src/services/p3idservice.h +++ b/libretroshare/src/services/p3idservice.h @@ -293,12 +293,10 @@ public: /// @see RsIdentity bool getOwnPseudonimousIds(std::vector& ids) override; - virtual bool getOwnIds(std::list &ownIds, bool signed_only = false); + bool getOwnIds( + std::list &ownIds, bool signed_only = false ) override; - //virtual bool getPublicKey(const RsGxsId &id, RsTlvSecurityKey &key) ; - //virtual void networkRequestPublicKey(const RsGxsId& key_id,const std::list& peer_ids) ; - - inline bool isKnownId(const RsGxsId& id) override { return haveKey(id); } + bool isKnownId(const RsGxsId& id) override; bool isOwnId(const RsGxsId& key_id) override;