diff --git a/libretroshare/src/ft/ftserver.cc b/libretroshare/src/ft/ftserver.cc index 28516cede..044380e81 100644 --- a/libretroshare/src/ft/ftserver.cc +++ b/libretroshare/src/ft/ftserver.cc @@ -1820,6 +1820,13 @@ int ftServer::handleIncoming() ********************************** *********************************/ +void ftServer::receiveSearchResult(RsTurtleFTSearchResultItem *item) +{ + // @Gio: add your thing here + + RsServer::notify()->notifyTurtleSearchResult(item->request_id,item->result) ; +} + /***************************** CONFIG ****************************/ bool ftServer::addConfiguration(p3ConfigMgr *cfgmgr) diff --git a/libretroshare/src/ft/ftserver.h b/libretroshare/src/ft/ftserver.h index c952ea54a..f79ffe8b5 100644 --- a/libretroshare/src/ft/ftserver.h +++ b/libretroshare/src/ft/ftserver.h @@ -96,7 +96,7 @@ public: uint16_t serviceId() const { return RS_SERVICE_TYPE_FILE_TRANSFER ; } virtual bool handleTunnelRequest(const RsFileHash& hash,const RsPeerId& peer_id) ; virtual void receiveTurtleData(const RsTurtleGenericTunnelItem *item,const RsFileHash& hash,const RsPeerId& virtual_peer_id,RsTurtleGenericTunnelItem::Direction direction) ; - //virtual void receiveSearchResult(RsTurtleSearchResultItem *item);// TODO + virtual void receiveSearchResult(RsTurtleFTSearchResultItem *item); virtual RsItem *create_item(uint16_t service,uint8_t item_type) const ; virtual RsServiceSerializer *serializer() { return this ; } diff --git a/libretroshare/src/turtle/p3turtle.cc b/libretroshare/src/turtle/p3turtle.cc index f5ff375ce..e66d5f662 100644 --- a/libretroshare/src/turtle/p3turtle.cc +++ b/libretroshare/src/turtle/p3turtle.cc @@ -1191,7 +1191,16 @@ void p3turtle::handleSearchResult(RsTurtleSearchResultItem *item) if(ftsr!=NULL) { - RsServer::notify()->notifyTurtleSearchResult(ftsr->request_id,ftsr->result) ; + ftServer *client = dynamic_cast((*it).second) ; + + if(!client) + { + std::cerr << "(EE) received turtle FT search result but the service is not a ftServer!!" << std::endl; + continue; + } + //RsServer::notify()->notifyTurtleSearchResult(ftsr->request_id,ftsr->result) ; + + client->receiveSearchResult(ftsr); continue ; }