mirror of
https://github.com/RetroShare/RetroShare.git
synced 2024-10-01 02:35:48 -04:00
Merge branch 'csoler/v0.6-FT' into jsonapi
Needed to exopse JSON API for file search
This commit is contained in:
commit
31f0a42b86
@ -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)
|
||||
|
@ -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 ; }
|
||||
|
||||
|
@ -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 ;
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user