diff --git a/libretroshare/src/retroshare/rsgxschannels.h b/libretroshare/src/retroshare/rsgxschannels.h index 9cc4bd33e..901d4c4ef 100644 --- a/libretroshare/src/retroshare/rsgxschannels.h +++ b/libretroshare/src/retroshare/rsgxschannels.h @@ -4,7 +4,8 @@ * libretroshare: retroshare core library * * * * Copyright (C) 2012 Robert Fernie * - * Copyright (C) 2018-2019 Gioacchino Mazzurco * + * Copyright (C) 2018-2020 Gioacchino Mazzurco * + * Copyright (C) 2019-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 * @@ -283,26 +284,6 @@ public: */ virtual bool ExtraFileRemove(const RsFileHash& hash) = 0; - /** - * @brief Get auto-download option value for given channel - * @jsonapi{development} - * @param[in] channelId channel id - * @param[out] enabled storage for the auto-download option value - * @return false if something failed, true otherwhise - */ - virtual bool getChannelAutoDownload( - const RsGxsGroupId& channelId, bool& enabled ) = 0; - - /** - * @brief Get download directory for the given channel - * @jsonapi{development} - * @param[in] channelId id of the channel - * @param[out] directory reference to string where to store the path - * @return false on error, true otherwise - */ - virtual bool getChannelDownloadDirectory( const RsGxsGroupId& channelId, - std::string& directory ) = 0; - /** * @brief Get channels summaries list. Blocking API. * @jsonapi{development} @@ -369,16 +350,6 @@ public: */ virtual bool markRead(const RsGxsGrpMsgIdPair& postId, bool read) = 0; - /** - * @brief Enable or disable auto-download for given channel. Blocking API - * @jsonapi{development} - * @param[in] channelId channel id - * @param[in] enable true to enable, false to disable - * @return false if something failed, true otherwhise - */ - virtual bool setChannelAutoDownload( - const RsGxsGroupId& channelId, bool enable ) = 0; - /** * @brief Share channel publishing key * This can be used to authorize other peers to post on the channel @@ -390,16 +361,6 @@ public: virtual bool shareChannelKeys( const RsGxsGroupId& channelId, const std::set& peers ) = 0; - /** - * @brief Set download directory for the given channel. Blocking API. - * @jsonapi{development} - * @param[in] channelId id of the channel - * @param[in] directory path - * @return false on error, true otherwise - */ - virtual bool setChannelDownloadDirectory( - const RsGxsGroupId& channelId, const std::string& directory) = 0; - /** * @brief Subscrbe to a channel. Blocking API * @jsonapi{development} @@ -525,8 +486,62 @@ public: std::string& errMsg = RS_DEFAULT_STORAGE_PARAM(std::string) ) = 0; - /* Following functions are deprecated as they expose internal functioning - * semantic, instead of a safe to use API */ + /* Following functions are deprecated and should not be considered a safe to + * use API */ + + /** + * @brief Get auto-download option value for given channel + * @jsonapi{development} + * @deprecated This feature rely on very buggy code, the returned value is + * not reliable @see setChannelAutoDownload(). + * @param[in] channelId channel id + * @param[out] enabled storage for the auto-download option value + * @return false if something failed, true otherwhise + */ + RS_DEPRECATED + virtual bool getChannelAutoDownload( + const RsGxsGroupId& channelId, bool& enabled ) = 0; + + /** + * @brief Enable or disable auto-download for given channel. Blocking API + * @jsonapi{development} + * @deprecated This feature rely on very buggy code, when enabled the + * channel service start flooding erratically log with error messages, + * apparently without more dangerous consequences. Still those messages + * hints that something out of control is happening under the hood, use at + * your own risk. A safe alternative to this method can easly implemented + * at API client level instead. + * @param[in] channelId channel id + * @param[in] enable true to enable, false to disable + * @return false if something failed, true otherwhise + */ + RS_DEPRECATED + virtual bool setChannelAutoDownload( + const RsGxsGroupId& channelId, bool enable ) = 0; + + /** + * @brief Get download directory for the given channel + * @jsonapi{development} + * @deprecated @see setChannelAutoDownload() + * @param[in] channelId id of the channel + * @param[out] directory reference to string where to store the path + * @return false on error, true otherwise + */ + RS_DEPRECATED + virtual bool getChannelDownloadDirectory( const RsGxsGroupId& channelId, + std::string& directory ) = 0; + + /** + * @brief Set download directory for the given channel. Blocking API. + * @jsonapi{development} + * @deprecated @see setChannelAutoDownload() + * @param[in] channelId id of the channel + * @param[in] directory path + * @return false on error, true otherwise + */ + RS_DEPRECATED + virtual bool setChannelDownloadDirectory( + const RsGxsGroupId& channelId, const std::string& directory) = 0; /** * @brief Create channel. Blocking API. diff --git a/libretroshare/src/util/rsdir.cc b/libretroshare/src/util/rsdir.cc index be327bb3d..fe9907d2d 100644 --- a/libretroshare/src/util/rsdir.cc +++ b/libretroshare/src/util/rsdir.cc @@ -3,7 +3,9 @@ * * * libretroshare: retroshare core library * * * - * Copyright 2004-2007 by Robert Fernie * + * Copyright (C) 2004-2007 Robert Fernie * + * Copyright (C) 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 * diff --git a/libretroshare/src/util/rsdir.h b/libretroshare/src/util/rsdir.h index e8ff09943..50e636541 100644 --- a/libretroshare/src/util/rsdir.h +++ b/libretroshare/src/util/rsdir.h @@ -3,7 +3,9 @@ * * * libretroshare: retroshare core library * * * - * Copyright 2004-2007 by Robert Fernie * + * Copyright (C) 2004-2007 Robert Fernie * + * Copyright (C) 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 * @@ -20,8 +22,7 @@ * * *******************************************************************************/ -#ifndef RSUTIL_DIRFNS_H -#define RSUTIL_DIRFNS_H +#pragma once #include #include @@ -161,6 +162,3 @@ bool create_directories(const std::string& path); } } #endif // __cplusplus < 201703L - - -#endif