17 #include "clientbase.h"
35 if( !m_parent || !directory || !sh )
38 const std::string&
id = m_parent->
getID();
44 Tag *q =
new Tag( iq,
"query" );
48 m_parent->
trackID(
this,
id, FetchSearchFields );
54 if( !m_parent || !directory || !sh )
57 const std::string&
id = m_parent->
getID();
63 Tag *q =
new Tag( iq,
"query" );
68 m_parent->
trackID(
this,
id, DoSearch );
74 if( !m_parent || !directory || !sh )
77 const std::string&
id = m_parent->
getID();
83 Tag *q =
new Tag( iq,
"query" );
89 new Tag( q,
"last", values.
last );
91 new Tag( q,
"nick", values.
nick );
96 m_parent->
trackID(
this,
id, DoSearch );
102 TrackMap::iterator it = m_track.find( stanza->
id() );
103 if( it != m_track.end() )
110 case FetchSearchFields:
119 (*it).second->handleSearchFields( stanza->
from(), df );
124 std::string instructions;
137 (*it).second->handleSearchFields( stanza->
from(), fields, instructions );
151 (*it).second->handleSearchResult( stanza->
from(), df );
158 Tag::TagList::const_iterator itl = l.begin();
159 for( ; itl != l.end(); ++itl )
161 if( (*itl)->name() ==
"item" )
163 s.
jid.
setJID( (*itl)->findAttribute(
"jid" ) );
165 if( ( t = (*itl)->
findChild(
"first" ) ) != 0 )
167 if( ( t = (*itl)->
findChild(
"last" ) ) != 0 )
169 if( ( t = (*itl)->
findChild(
"nick" ) ) != 0 )
171 if( ( t = (*itl)->
findChild(
"email" ) ) != 0 )
177 (*it).second->handleSearchResult( stanza->
from(), e );
185 (*it).second->handleSearchError( stanza->
from(), stanza );