From b42c0410f1f5aa6ea8b86fb206d2ea6c96f2c344 Mon Sep 17 00:00:00 2001 From: Gioacchino Mazzurco Date: Tue, 31 Mar 2020 23:21:59 +0200 Subject: [PATCH] Expose pgpIdFromFingerprint to JSON API + missing explicit in one paramether costructor --- libretroshare/src/retroshare/rspeers.h | 16 +++++++++++++--- 1 file changed, 13 insertions(+), 3 deletions(-) diff --git a/libretroshare/src/retroshare/rspeers.h b/libretroshare/src/retroshare/rspeers.h index 5cac456f2..124dba357 100644 --- a/libretroshare/src/retroshare/rspeers.h +++ b/libretroshare/src/retroshare/rspeers.h @@ -3,7 +3,9 @@ * * * libretroshare: retroshare core library * * * - * Copyright 2004-2008 by Robert Fernie * + * Copyright (C) 2004-2008 by Robert Fernie * + * Copyright (C) 2018-2020 Gioacchino Mazzurco * + * Copyright (C) 2020 AsociaciĆ³n Civil Altermundi * * * * This program is free software: you can redistribute it and/or modify * * it under the terms of the GNU Lesser General Public License as * @@ -468,7 +470,7 @@ struct RsGroupInfo : RsSerializable struct RsPeerStateChangedEvent : RsEvent { /// @param[in] sslId is of the peer which changed state - RsPeerStateChangedEvent(RsPeerId sslId); + explicit RsPeerStateChangedEvent(RsPeerId sslId); /// Storage fot the id of the peer that changed state RsPeerId mSslId; @@ -605,7 +607,15 @@ public: virtual bool getAssociatedSSLIds(const RsPgpId& gpg_id, std::list& ids) = 0; virtual bool gpgSignData(const void *data, const uint32_t len, unsigned char *sign, unsigned int *signlen, std::string reason = "") = 0; - virtual RsPgpId pgpIdFromFingerprint(const RsPgpFingerprint& fpr) = 0; + /** + * @brief Convert PGP fingerprint to PGP id + * @jsonapi{development} + * Helper method useful while we port the whole RetroShare codebase from + * RsPgpId to RsPgpFingerprint + * @param[in] fpr PGP fingerprint to convert + * @return PGP id corresponding to the fingerprint + */ + virtual RsPgpId pgpIdFromFingerprint(const RsPgpFingerprint& fpr) = 0; // Note: the two methods below could be unified. The fact that one of them can take an optional RsPeerDetails struct as parameter // seems quite inconsistent.