25 FlexibleOffline::Offline::Offline(
const Tag* )
31 FlexibleOffline::Offline::Offline(
int context,
const StringList& msgs )
32 : StanzaExtension(
ExtFlexOffline ), m_context( context ), m_msgs( msgs )
36 FlexibleOffline::Offline::~Offline()
40 const std::string& FlexibleOffline::Offline::filterString()
const
42 static const std::string filter =
"/iq/offline[@xmlns='" +
XMLNS_OFFLINE +
"']";
46 Tag* FlexibleOffline::Offline::tag()
const
48 Tag* t =
new Tag(
"offline" );
52 new Tag( t, m_context == FORequestMsgs ?
"fetch" :
"purge" );
55 const std::string action = m_context == FORequestMsgs ?
"view" :
"remove";
56 StringList::const_iterator it = m_msgs.begin();
57 for( ; it != m_msgs.end(); ++it )
59 Tag* i =
new Tag( t,
"item",
"action", action );
60 i->addAttribute(
"node", (*it) );
69 : m_parent( parent ), m_flexibleOfflineHandler( 0 )
96 void FlexibleOffline::messageOperation(
int context,
const StringList& msgs )
98 const std::string&
id = m_parent->
getID();
100 IQ iq( iqType,
JID(),
id );
101 iq.addExtension(
new Offline( context, msgs ) );
102 m_parent->
send( iq,
this, context );
107 m_flexibleOfflineHandler = foh;
112 m_flexibleOfflineHandler = 0;
117 if( !m_flexibleOfflineHandler )
129 num = atoi( info.
form()->
field(
"number_of_messages" )->
value().c_str() );
138 if( context == FORequestHeaders && m_flexibleOfflineHandler )
151 if( !m_flexibleOfflineHandler )