moved UI notification for turtle FT search results into ftServer, in order to allow easier libresAPI calls

This commit is contained in:
csoler 2018-08-24 16:12:05 +02:00
parent 7bdc61e3e3
commit 8eebe53d75
No known key found for this signature in database
GPG Key ID: 7BCA522266C0804C
3 changed files with 18 additions and 2 deletions

View File

@ -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)

View File

@ -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 ; }

View File

@ -1191,7 +1191,16 @@ void p3turtle::handleSearchResult(RsTurtleSearchResultItem *item)
if(ftsr!=NULL)
{
RsServer::notify()->notifyTurtleSearchResult(ftsr->request_id,ftsr->result) ;
ftServer *client = dynamic_cast<ftServer*>((*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 ;
}