IXmppFeature *IqAuthFeatureFactory::newXmppFeature(const QString &AFeatureNS, IXmppStream *AXmppStream) { if (AFeatureNS == NS_FEATURE_IQAUTH) { LOG_STRM_INFO(AXmppStream->streamJid(),"Iq-Auth XMPP stream feature created"); IXmppFeature *feature = new IqAuthFeature(AXmppStream); connect(feature->instance(),SIGNAL(featureDestroyed()),SLOT(onFeatureDestroyed())); emit featureCreated(feature); return feature; } return NULL; }
bool XmppStream::startFeature(const QString &AFeatureNS, const QDomElement &AFeatureElem) { IXmppFeature *feature = FXmppStreams->xmppFeaturePlugin(AFeatureNS)->newXmppFeature(AFeatureNS, this); if (feature) { FActiveFeatures.append(feature); connect(feature->instance(),SIGNAL(finished(bool)),SLOT(onFeatureFinished(bool))); connect(feature->instance(),SIGNAL(error(const QString &)),SLOT(onFeatureError(const QString &))); connect(feature->instance(),SIGNAL(featureDestroyed()),SLOT(onFeatureDestroyed())); connect(this,SIGNAL(closed()),feature->instance(),SLOT(deleteLater())); return feature->start(AFeatureElem); } return false; }