14 #include "siprofileft.h"
16 #include "clientbase.h"
17 #include "siprofilefthandler.h"
18 #include "simanager.h"
20 #include "inbandbytestream.h"
22 #include "socks5bytestream.h"
23 #include "socks5bytestreammanager.h"
33 : m_parent( parent ), m_manager( manager ), m_handler( sipfth ),
34 m_socks5Manager( s5Manager ), m_delManager( false ),
35 m_delS5Manager( false )
45 if( !m_socks5Manager )
48 m_delS5Manager =
true;
59 if( m_socks5Manager && m_delS5Manager )
60 delete m_socks5Manager;
64 const std::string& hash,
const std::string& desc,
65 const std::string& date,
const std::string& mimetype,
66 int streamTypes,
const JID& from,
67 const std::string& sid )
69 if( name.empty() || size <= 0 || !m_manager )
80 new Tag( file,
"desc", desc );
89 sm.insert( std::make_pair(
"ibb",
XMLNS_IBB ) );
103 if( m_id2sid.find( sid ) == m_id2sid.end() )
106 const std::string&
id = m_id2sid[sid];
121 from ? from : m_parent->
jid(), sid );
133 m_manager->
acceptSI( to,
id, 0, feature, from );
137 const std::string& text )
139 if( m_id2sid.find( sid ) == m_id2sid.end() || !m_manager )
142 m_manager->
declineSI( to, m_id2sid[sid], reason, text );
150 m_socks5Manager->
dispose( static_cast<SOCKS5Bytestream*>( bs ) );
161 if( m_id2sid.find( bs->
sid() ) == m_id2sid.end() || !m_manager )
172 if( m_socks5Manager )
178 if( m_socks5Manager )
183 const SIManager::SI& si )
193 const std::string& mt = si.mimetype();
204 StringMultiMap::const_iterator it = options.begin();
205 for( ; it != options.end(); ++it )
217 const std::string& sid = si.id();
219 m_handler->
handleFTRequest( from, to, sid, si.tag1()->findAttribute(
"name" ),
220 atol( si.tag1()->findAttribute(
"size" ).c_str() ),
221 si.tag1()->findAttribute(
"hash" ),
222 si.tag1()->findAttribute(
"date" ),
223 mt.empty() ?
"binary/octet-stream" : mt,
229 const SIManager::SI& si )
248 to ? to : m_parent->
jid(), from, sid );
257 const std::string&
id = m_parent->
getID();
263 m_parent->
send( iq,
this, OOBSent );