void FlexibleOffline::handleDiscoItems( const JID& /*from*/, const Disco::Items& items, int context ) { if( context == FORequestHeaders && m_flexibleOfflineHandler ) { if( items.node() == XMLNS_OFFLINE ) m_flexibleOfflineHandler->handleFlexibleOfflineMessageHeaders( items.items() ); } }
void Adhoc::handleDiscoItems( const JID& from, const Disco::Items& items, int context ) { if( context != FetchAdhocCommands ) return; util::MutexGuard m( m_adhocTrackMapMutex ); AdhocTrackMap::iterator it = m_adhocTrackMap.begin(); for( ; it != m_adhocTrackMap.end(); ++it ) { if( (*it).second.context == context && (*it).second.remote == from ) { StringMap commands; const Disco::ItemList& l = items.items(); Disco::ItemList::const_iterator it2 = l.begin(); for( ; it2 != l.end(); ++it2 ) { commands[(*it2)->node()] = (*it2)->name(); } (*it).second.ah->handleAdhocCommands( from, commands, (*it).second.handlerContext ); m_adhocTrackMap.erase( it ); break; } } }
void DiscoItemsFactory::serialize(Payload *extension, QXmlStreamWriter *writer) { Disco::Items *items = se_cast<Disco::Items*>(extension); writer->writeStartElement(QLatin1String("query")); writer->writeDefaultNamespace(NS_DISCO_ITEMS); if (!items->node().isEmpty()) writer->writeAttribute(QLatin1String("node"), items->node()); foreach(const Disco::Item &item, items->items()) { writer->writeEmptyElement(QLatin1String("item")); writer->writeAttribute(QLatin1String("jid"), item.jid()); if (!item.node().isEmpty()) writer->writeAttribute(QLatin1String("node"), item.node()); writer->writeAttribute(QLatin1String("name"), item.name()); } writer->writeEndElement(); }
void TalkDiscoHandler::handleDiscoItems(const JID& from, const Disco::Items& items, int context) { const Disco::ItemList& list = items.items(); Disco::ItemList::const_iterator iter = list.begin(); ServerDiscoWindow* discowindow = Bodies::Get_Bodies().get_main_window().get_disco_window(); if (NULL == discowindow) return ; for (; iter != list.end(); ++iter) { //PBUG("jid = %s\n", (*iter)->jid().full().c_str()); discowindow->addAgent((*iter)->jid().full()); } discowindow->final_progress(); }
virtual void handleDiscoItems( const JID& /*from*/, const Disco::Items& items, int /*context*/ ) { if( m_test == 9 && items.node() == "foonode" && items.items().size() == 2 ) m_result = true; }