diff --git a/libretroshare/src/libretroshare.pro b/libretroshare/src/libretroshare.pro index e9e7470a0..06e2f8265 100644 --- a/libretroshare/src/libretroshare.pro +++ b/libretroshare/src/libretroshare.pro @@ -560,9 +560,7 @@ SOURCES += pqi/authgpg.cc \ pqi/pqiqosstreamer.cc \ pqi/sslfns.cc \ pqi/pqinetstatebox.cc \ - pqi/p3servicecontrol.cc \ - -# pqi/p3dhtmgr.cc \ + pqi/p3servicecontrol.cc SOURCES += rsserver/p3face-config.cc \ rsserver/p3face-server.cc \ @@ -574,7 +572,6 @@ SOURCES += rsserver/p3face-config.cc \ rsserver/rsinit.cc \ rsserver/rsaccounts.cc \ rsserver/rsloginhandler.cc \ - rsserver/rstypes.cc \ rsserver/p3serverconfig.cc SOURCES += grouter/p3grouter.cc \ @@ -625,11 +622,7 @@ SOURCES += services/autoproxy/rsautoproxymonitor.cc \ services/p3serviceinfo.cc \ SOURCES += turtle/p3turtle.cc \ - turtle/rsturtleitem.cc -# turtle/turtlerouting.cc \ -# turtle/turtlesearch.cc \ -# turtle/turtletunnels.cc - + turtle/rsturtleitem.cc SOURCES += util/folderiterator.cc \ util/rsdebug.cc \ diff --git a/libretroshare/src/pqi/p3servicecontrol.cc b/libretroshare/src/pqi/p3servicecontrol.cc index a8e3292ac..23dcaf747 100644 --- a/libretroshare/src/pqi/p3servicecontrol.cc +++ b/libretroshare/src/pqi/p3servicecontrol.cc @@ -1392,29 +1392,6 @@ RsServiceInfo::RsServiceInfo() return; } -std::ostream &operator<<(std::ostream &out, const RsPeerServiceInfo &info) -{ - out << "RsPeerServiceInfo(" << info.mPeerId << ")"; - out << std::endl; - std::map::const_iterator it; - for(it = info.mServiceList.begin(); it != info.mServiceList.end(); ++it) - { - out << "\t Service:" << it->first << " : "; - out << it->second; - out << std::endl; - } - return out; -} - - -std::ostream &operator<<(std::ostream &out, const RsServiceInfo &info) -{ - out << "RsServiceInfo(" << info.mServiceType << "): " << info.mServiceName; - out << " Version(" << info.mVersionMajor << "," << info.mVersionMinor << ")"; - out << " MinVersion(" << info.mMinVersionMajor << "," << info.mMinVersionMinor << ")"; - return out; -} - std::ostream &operator<<(std::ostream &out, const ServicePeerFilter &filter) { out << "ServicePeerFilter DenyAll: " << filter.mDenyAll; diff --git a/libretroshare/src/retroshare/rsgxsiface.h b/libretroshare/src/retroshare/rsgxsiface.h index 268c8cc75..1b504cb8b 100644 --- a/libretroshare/src/retroshare/rsgxsiface.h +++ b/libretroshare/src/retroshare/rsgxsiface.h @@ -75,7 +75,7 @@ struct RsGxsGroupSummary : RsSerializable */ struct RsGxsChanges { - RsGxsChanges(): mService(0){} + RsGxsChanges(): mService(nullptr){} RsTokenService *mService; std::map > mMsgs; std::map > mMsgsMeta; diff --git a/libretroshare/src/retroshare/rsidentity.h b/libretroshare/src/retroshare/rsidentity.h index 8be685d24..354c6272e 100644 --- a/libretroshare/src/retroshare/rsidentity.h +++ b/libretroshare/src/retroshare/rsidentity.h @@ -151,11 +151,9 @@ struct RsGxsIdGroup : RsSerializable RsGenericSerializer::SerializeContext& ctx ) override; }; -std::ostream &operator<<(std::ostream &out, const RsGxsIdGroup &group); - // DATA TYPE FOR EXTERNAL INTERFACE. -struct RsRecognTag +struct RS_DEPRECATED RsRecognTag { RsRecognTag(uint16_t tc, uint16_t tt, bool v) : tag_class(tc), tag_type(tt), valid(v) {} @@ -166,7 +164,7 @@ struct RsRecognTag }; -struct RsRecognTagDetails +struct RS_DEPRECATED RsRecognTagDetails { RsRecognTagDetails() : valid_from(0), valid_to(0), tag_class(0), tag_type(0), is_valid(false), diff --git a/libretroshare/src/retroshare/rsmsgs.h b/libretroshare/src/retroshare/rsmsgs.h index f1e42c4c3..562a3ebaf 100644 --- a/libretroshare/src/retroshare/rsmsgs.h +++ b/libretroshare/src/retroshare/rsmsgs.h @@ -485,14 +485,13 @@ public: } }; -std::ostream &operator<<(std::ostream &out, const Rs::Msgs::MessageInfo &info); class RsMsgs; /** * @brief Pointer to retroshare's message service * @jsonapi{development} */ -extern RsMsgs *rsMsgs; +extern RsMsgs* rsMsgs; class RsMsgs { diff --git a/libretroshare/src/retroshare/rsnotify.h b/libretroshare/src/retroshare/rsnotify.h index d2077e7f0..fc9cb8e08 100644 --- a/libretroshare/src/retroshare/rsnotify.h +++ b/libretroshare/src/retroshare/rsnotify.h @@ -19,8 +19,7 @@ * along with this program. If not, see . * * * *******************************************************************************/ -#ifndef RS_NOTIFY_GUI_INTERFACE_H -#define RS_NOTIFY_GUI_INTERFACE_H +#pragma once #include #include @@ -30,6 +29,7 @@ #include "rsturtle.h" #include "rsgxsifacetypes.h" +#include "util/rsdeprecate.h" class ChatId; class ChatMessage; @@ -148,7 +148,7 @@ const uint32_t NOTIFY_HASHTYPE_FINISH = 2; /* Finish */ const uint32_t NOTIFY_HASHTYPE_HASH_FILE = 3; /* Hashing file */ const uint32_t NOTIFY_HASHTYPE_SAVE_FILE_INDEX = 4; /* Hashing file */ -class RsFeedItem +class RS_DEPRECATED RsFeedItem { public: RsFeedItem(uint32_t type, const std::string& id1, const std::string& id2, const std::string& id3, const std::string& id4, uint32_t result1) @@ -181,9 +181,9 @@ class RsFeedItem // This mechanism can be used in plugins, new services, etc. // -class NotifyClient; +class RS_DEPRECATED NotifyClient; -class RsNotify +class RS_DEPRECATED_FOR(RsEvents) RsNotify { public: /* registration of notifies clients */ @@ -206,7 +206,7 @@ class RsNotify virtual bool setDisableAskPassword (const bool /*bValue*/) { return false ; } }; -class NotifyClient +class RS_DEPRECATED NotifyClient { public: NotifyClient() {} @@ -223,8 +223,6 @@ public: virtual void notifyCustomState (const std::string& /* peer_id */, const std::string& /* status_string */) {} virtual void notifyHashingInfo (uint32_t /* type */, const std::string& /* fileinfo */) {} virtual void notifyTurtleSearchResult (const RsPeerId& /* pid */, uint32_t /* search_id */, const std::list& /* files */) {} -#warning MISSING CODE HERE - // virtual void notifyTurtleSearchResult (uint32_t /* search_id */, const std::list& /* groups */) {} virtual void notifyPeerHasNewAvatar (std::string /* peer_id */) {} virtual void notifyOwnAvatarChanged () {} virtual void notifyOwnStatusMessageChanged () {} @@ -245,4 +243,3 @@ public: virtual bool askForPassword (const std::string& /* title */, const std::string& /* key_details */, bool /* prev_is_bad */, std::string& /* password */,bool& /* cancelled */ ) { return false ;} virtual bool askForPluginConfirmation (const std::string& /* plugin_filename */, const std::string& /* plugin_file_hash */,bool /* first_time */) { return false ;} }; -#endif diff --git a/libretroshare/src/retroshare/rspeers.h b/libretroshare/src/retroshare/rspeers.h index 2d1263043..ab5404859 100644 --- a/libretroshare/src/retroshare/rspeers.h +++ b/libretroshare/src/retroshare/rspeers.h @@ -358,8 +358,6 @@ struct RsGroupInfo : RsSerializable } }; -std::ostream &operator<<(std::ostream &out, const RsPeerDetails &detail); - /** The Main Interface Class - for information about your Peers * A peer is another RS instance, means associated with an SSL certificate * A same GPG person can have multiple peer running with different SSL certs diff --git a/libretroshare/src/retroshare/rsservicecontrol.h b/libretroshare/src/retroshare/rsservicecontrol.h index f588e9719..4946f5247 100644 --- a/libretroshare/src/retroshare/rsservicecontrol.h +++ b/libretroshare/src/retroshare/rsservicecontrol.h @@ -88,10 +88,6 @@ struct RsPeerServiceInfo : RsSerializable } }; -std::ostream &operator<<(std::ostream &out, const RsPeerServiceInfo &info); -std::ostream &operator<<(std::ostream &out, const RsServiceInfo &info); - - struct RsServicePermissions : RsSerializable { RsServicePermissions(); diff --git a/libretroshare/src/retroshare/rstokenservice.h b/libretroshare/src/retroshare/rstokenservice.h index 515579a07..bea291e25 100644 --- a/libretroshare/src/retroshare/rstokenservice.h +++ b/libretroshare/src/retroshare/rstokenservice.h @@ -107,9 +107,6 @@ struct RsTokReqOptions rstime_t mAfter; }; -std::ostream &operator<<(std::ostream &out, const RsGroupMetaData &meta); -std::ostream &operator<<(std::ostream &out, const RsMsgMetaData &meta); - /*! * A proxy class for requesting generic service data for GXS * This seperates the request mechanism from the actual retrieval of data diff --git a/libretroshare/src/retroshare/rstypes.h b/libretroshare/src/retroshare/rstypes.h index 2dc092306..52495b664 100644 --- a/libretroshare/src/retroshare/rstypes.h +++ b/libretroshare/src/retroshare/rstypes.h @@ -248,8 +248,6 @@ struct FileInfo : RsSerializable } }; -std::ostream &operator<<(std::ostream &out, const FileInfo& info); - /** * Pointers in this class have no real meaning as pointers, they are used as * indexes, internally by retroshare. @@ -370,8 +368,6 @@ struct DirDetails : RsSerializable } }; -std::ostream &operator<<(std::ostream &out, const DirDetails& details); - class FileDetail { public: diff --git a/libretroshare/src/rsitems/rsgxsiditems.h b/libretroshare/src/rsitems/rsgxsiditems.h index bfcca0946..440247403 100644 --- a/libretroshare/src/rsitems/rsgxsiditems.h +++ b/libretroshare/src/rsitems/rsgxsiditems.h @@ -67,11 +67,9 @@ public: // Avatar RsTlvImage mImage ; }; -class RsGxsIdLocalInfoItem : public RsGxsIdItem + +struct RsGxsIdLocalInfoItem : public RsGxsIdItem { - -public: - RsGxsIdLocalInfoItem(): RsGxsIdItem(RS_PKT_SUBTYPE_GXSID_LOCAL_INFO_ITEM) {} virtual ~RsGxsIdLocalInfoItem() {} @@ -83,39 +81,6 @@ public: std::set mContacts ; }; -#if 0 -class RsGxsIdOpinionItem : public RsGxsMsgItem -{ -public: - - RsGxsIdOpinionItem(): RsGxsMsgItem(RS_SERVICE_GXS_TYPE_GXSID, - RS_PKT_SUBTYPE_GXSID_OPINION_ITEM) {return; } - virtual ~RsGxsIdOpinionItem() { return;} - void clear(); - virtual bool serialise(void *data,uint32_t& size) = 0 ; - virtual uint32_t serial_size() = 0 ; - - std::ostream &print(std::ostream &out, uint16_t indent = 0); - RsGxsIdOpinion opinion; -}; - -class RsGxsIdCommentItem : public RsGxsMsgItem -{ -public: - - RsGxsIdCommentItem(): RsGxsMsgItem(RS_SERVICE_GXS_TYPE_GXSID, - RS_PKT_SUBTYPE_GXSID_COMMENT_ITEM) { return; } - virtual ~RsGxsIdCommentItem() { return; } - void clear(); - virtual bool serialise(void *data,uint32_t& size) = 0 ; - virtual uint32_t serial_size() = 0 ; - - std::ostream &print(std::ostream &out, uint16_t indent = 0); - RsGxsIdComment comment; - -}; -#endif - class RsGxsIdSerialiser : public RsServiceSerializer { public: diff --git a/libretroshare/src/rsitems/rsgxsitems.cc b/libretroshare/src/rsitems/rsgxsitems.cc index d8f96555b..22c379f9e 100644 --- a/libretroshare/src/rsitems/rsgxsitems.cc +++ b/libretroshare/src/rsitems/rsgxsitems.cc @@ -61,31 +61,10 @@ this->mCircleType = rGxsMeta.mCircleType; this->mInternalCircle = rGxsMeta.mInternalCircle; this->mOriginator = rGxsMeta.mOriginator; - this->mAuthenFlags = rGxsMeta.mAuthenFlags; - // std::cout << "rGxsMeta.mParentGrpId= " <mParentGrpId= " <mParentGrpId<<"\n"; + this->mAuthenFlags = rGxsMeta.mAuthenFlags; this->mParentGrpId = rGxsMeta.mParentGrpId; } -std::ostream &operator<<(std::ostream &out, const RsGroupMetaData &meta) -{ - out << "[ GroupId: " << meta.mGroupId << " Name: " << meta.mGroupName << " ]"; - return out; -} - -std::ostream &operator<<(std::ostream &out, const RsMsgMetaData &meta) -{ - out << "[ GroupId: " << meta.mGroupId << " MsgId: " << meta.mMsgId; - out << " Name: " << meta.mMsgName; - out << " OrigMsgId: " << meta.mOrigMsgId; - out << " ThreadId: " << meta.mThreadId; - out << " ParentId: " << meta.mParentId; - out << " AuthorId: " << meta.mAuthorId; - out << " Name: " << meta.mMsgName << " ]"; - return out; -} - template<> uint32_t RsTypeSerializer::serial_size(const TurtleGxsInfo& i) { uint32_t s = 0 ; diff --git a/libretroshare/src/rsitems/rsgxsitems.h b/libretroshare/src/rsitems/rsgxsitems.h index efc11afbb..9b47d5d6d 100644 --- a/libretroshare/src/rsitems/rsgxsitems.h +++ b/libretroshare/src/rsitems/rsgxsitems.h @@ -28,9 +28,6 @@ #include "util/rstime.h" #include "retroshare/rsgxsifacetypes.h" -std::ostream &operator<<(std::ostream &out, const RsGroupMetaData &meta); -std::ostream &operator<<(std::ostream &out, const RsMsgMetaData &meta); - class RsGxsGrpItem : public RsItem { diff --git a/libretroshare/src/rsserver/p3peers.cc b/libretroshare/src/rsserver/p3peers.cc index ae319998b..ddab5fabf 100644 --- a/libretroshare/src/rsserver/p3peers.cc +++ b/libretroshare/src/rsserver/p3peers.cc @@ -1486,63 +1486,9 @@ RsPeerDetails::RsPeerDetails() lastConnect(0),lastUsed(0),connectState(0),connectStateString(""), connectPeriod(0), foundDHT(false), wasDeniedConnection(false), deniedTS(0), - linkType ( RS_NET_CONN_TRANS_TCP_UNKNOWN) -{ -} + linkType ( RS_NET_CONN_TRANS_TCP_UNKNOWN) {} -std::ostream &operator<<(std::ostream &out, const RsPeerDetails &detail) -{ - out << "RsPeerDetail: " << detail.name << " <" << detail.id << ">"; - out << std::endl; - - out << " email: " << detail.email; - out << " location:" << detail.location; - out << " org: " << detail.org; - out << std::endl; - - out << " fpr: " << detail.fpr; - out << " authcode:" << detail.authcode; - out << std::endl; - - out << " signers:"; - out << std::endl; - - std::list::const_iterator it; - for(it = detail.gpgSigners.begin(); - it != detail.gpgSigners.end(); ++it) - { - out << "\t" << *it; - out << std::endl; - } - out << std::endl; - - out << " trustLvl: " << detail.trustLvl; - out << " ownSign: " << detail.ownsign; - out << std::endl; - - out << " state: " << detail.state; - out << " netMode: " << detail.netMode; - out << std::endl; - - out << " localAddr: " << detail.localAddr; - out << ":" << detail.localPort; - out << std::endl; - out << " extAddr: " << detail.extAddr; - out << ":" << detail.extPort; - out << std::endl; - - - out << " lastConnect: " << detail.lastConnect; - out << " connectPeriod: " << detail.connectPeriod; - out << std::endl; - - return out; -} - -RsGroupInfo::RsGroupInfo() -{ - flag = 0; -} +RsGroupInfo::RsGroupInfo() : flag(0) {} ServicePermissionFlags p3Peers::servicePermissionFlags(const RsPeerId& ssl_id) { diff --git a/libretroshare/src/rsserver/rstypes.cc b/libretroshare/src/rsserver/rstypes.cc deleted file mode 100644 index 0dd06b956..000000000 --- a/libretroshare/src/rsserver/rstypes.cc +++ /dev/null @@ -1,72 +0,0 @@ -/******************************************************************************* - * libretroshare/src/rsserver: rstypes.cc * - * * - * libretroshare: retroshare core library * - * * - * Copyright 2004-2006 by Robert Fernie * - * * - * This program is free software: you can redistribute it and/or modify * - * it under the terms of the GNU Lesser General Public License as * - * published by the Free Software Foundation, either version 3 of the * - * License, or (at your option) any later version. * - * * - * This program is distributed in the hope that it will be useful, * - * but WITHOUT ANY WARRANTY; without even the implied warranty of * - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * - * GNU Lesser General Public License for more details. * - * * - * You should have received a copy of the GNU Lesser General Public License * - * along with this program. If not, see . * - * * - *******************************************************************************/ - -/* Insides of RetroShare interface. - * only prints stuff out at the moment - */ - -#include "retroshare/rstypes.h" -#include -#include -#include "util/rstime.h" - - -/********************************************************************** - * NOTE NOTE NOTE ...... XXX - * BUG in MinGW .... %hhx in sscanf overwrites 32bits, instead of 8bits. - * this means that scanf(.... &(data[15])) is running off the - * end of the buffer, and hitting data[15-18]... - * To work around this bug we are reading into proper int32s - * and then copying the data over... - * -**********************************************************************/ - -std::ostream &operator<<(std::ostream &out, const DirDetails& d) -{ - std::cerr << "====DIR DETAILS====" << std::endl; - std::cerr << " parent pointer: " << d.parent << std::endl; - std::cerr << " current pointer: " << d.ref << std::endl; - std::cerr << " parent row : " << d.prow << std::endl; - std::cerr << " type : " << (int)d.type << std::endl; - std::cerr << " PeerId : " << d.id << std::endl; - std::cerr << " Name : " << d.name << std::endl; - std::cerr << " Hash : " << d.hash << std::endl; - std::cerr << " Path : " << d.path << std::endl; - std::cerr << " Count : " << d.count << std::endl; - std::cerr << " Age : " << time(NULL) - (int)d.mtime << std::endl; - std::cerr << " Min age : " << time(NULL) - (int)d.max_mtime << std::endl; - std::cerr << " Flags : " << d.flags << std::endl; - std::cerr << " Parent groups : " ; for(std::list::const_iterator it(d.parent_groups.begin());it!=d.parent_groups.end();++it) std::cerr << (*it) << " "; std::cerr << std::endl; - std::cerr << " Children : " ; for(uint32_t i=0;i::const_iterator it; - std::set::const_iterator sit; - for(it = grp.mInvitedMembers.begin(); - it != grp.mInvitedMembers.begin(); ++it) - { - out << "\t" << *it; - out << std::endl; - } - - for(sit = grp.mSubCircles.begin(); - sit != grp.mSubCircles.begin(); ++sit) - { - out << "\t" << *it; - out << std::endl; - } - return out; -} - -std::ostream &operator<<(std::ostream &out, const RsGxsCircleMsg &msg) -{ - out << "RsGxsCircleMsg: Meta: " << msg.mMeta; - out << std::endl; - - return out; -} - - - // Overloaded from GxsTokenQueue for Request callbacks. void p3GxsCircles::handleResponse(uint32_t token, uint32_t req_type) { @@ -1921,22 +1880,13 @@ void p3GxsCircles::handleResponse(uint32_t token, uint32_t req_type) case CIRCLEREQ_CACHELOAD: cache_load_for_token(token); break; - -#if 0 - case CIRCLEREQ_CACHETEST: - cachetest_handlerequest(token); - break; -#endif - - default: - /* error */ - std::cerr << "p3GxsCircles::handleResponse() Unknown Request Type: " << req_type; - std::cerr << std::endl; - break; + default: + RsErr() << __PRETTY_FUNCTION__ << " Unknown Request Type: " + << req_type << std::endl; + break; } } - // Overloaded from RsTickEvent for Event callbacks. void p3GxsCircles::handle_event(uint32_t event_type, const std::string &elabel) { @@ -1960,14 +1910,7 @@ void p3GxsCircles::handle_event(uint32_t event_type, const std::string &elabel) cache_reloadids(RsGxsCircleId(elabel)); break; -#if 0 - case CIRCLE_EVENT_CACHETEST: - cachetest_getlist(); - break; -#endif - - - case CIRCLE_EVENT_DUMMYSTART: + case CIRCLE_EVENT_DUMMYSTART: generateDummyData(); break; @@ -1979,11 +1922,10 @@ void p3GxsCircles::handle_event(uint32_t event_type, const std::string &elabel) generateDummyCircle(); break; - default: - /* error */ - std::cerr << "p3GxsCircles::handle_event() Unknown Event Type: " << event_type; - std::cerr << std::endl; - break; + default: + RsErr() << __PRETTY_FUNCTION__ << " Unknown Event Type: " << event_type + << std::endl; + break; } } diff --git a/libretroshare/src/services/p3idservice.cc b/libretroshare/src/services/p3idservice.cc index e6f820b89..0e8fa55f3 100644 --- a/libretroshare/src/services/p3idservice.cc +++ b/libretroshare/src/services/p3idservice.cc @@ -4542,65 +4542,6 @@ std::string rsIdTypeToString(uint32_t idtype) * */ - -/************************************************************************************/ -/* - * Scoring system. - * -100 to 100 is expected range. - * - * - * Each Lobby has a publish threshold. - * - As part of Lobby definition. ??? - * - Locally Set. - * - * Threshold: - * 50 VIP List. - * 20 Dress Code - * 10 Limit Riffraff. - * 0 Accept All. - * - * Implicit Scores: - * +50 for known PGP - * +10 for unknown PGP (want to encourage usage). - * +5 for Anon ID. - * - * Own Scores: - * +1000 Accepted - * +50 Friend - * +10 Interesting - * 0 Mostly Harmless - * -10 Annoying. - * -50 Troll - * -1000 Total Banned - * - * - * - - - -Processing Algorithm: - * - Grab all Groups which have received messages. - * (opt 1)-> grab latest msgs for each of these and process => score. - * (opt 2)-> try incremental system (people probably won't change opinions often -> just set them once) - * --> if not possible, fallback to full calculation. - * - * - */ - - - - -std::ostream &operator<<(std::ostream &out, const RsGxsIdGroup &grp) -{ - out << "RsGxsIdGroup: Meta: " << grp.mMeta; - out << " PgpIdHash: " << grp.mPgpIdHash; - out << " PgpIdSign: [binary]"; // << grp.mPgpIdSign; - out << std::endl; - - return out; -} - - void p3IdService::checkPeerForIdentities() { RsStackMutex stack(mIdMtx);