Ejemplo n.º 1
0
CompressFeature::~CompressFeature()
{
	stopZlib();
	FXmppStream->removeXmppDataHandler(XDHO_FEATURE_COMPRESS,this);
	FXmppStream->removeXmppStanzaHandler(XSHO_XMPP_FEATURE,this);
	emit featureDestroyed();
}
void IqAuthFeatureFactory::onFeatureDestroyed()
{
	IXmppFeature *feature = qobject_cast<IXmppFeature *>(sender());
	if (feature)
	{
		LOG_STRM_INFO(feature->xmppStream()->streamJid(),"Iq-Auth XMPP stream feature destroyed");
		emit featureDestroyed(feature);
	}
}
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;
}
Ejemplo n.º 4
0
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;
}
Ejemplo n.º 5
0
IXmppFeature *Registration::newXmppFeature(const QString &AFeatureNS, IXmppStream *AXmppStream)
{
	if (AFeatureNS==NS_FEATURE_REGISTER && FStreamRegisterId.contains(AXmppStream) && !FStreamFeatures.contains(AXmppStream))
	{
		LOG_INFO(QString("XMPP account registration feature created, server=%1").arg(AXmppStream->streamJid().pDomain()));

		RegisterFeature *feature = new RegisterFeature(AXmppStream);
		connect(feature->instance(),SIGNAL(registerFields(const IRegisterFields &)),SLOT(onXmppFeatureFields(const IRegisterFields &)));
		connect(feature->instance(),SIGNAL(finished(bool)),SLOT(onXmppFeatureFinished(bool)));
		connect(feature->instance(),SIGNAL(featureDestroyed()),SLOT(onXmppFeatureDestroyed()));

		FStreamFeatures.insert(AXmppStream,feature);
		emit featureCreated(feature);

		return feature;
	}
Ejemplo n.º 6
0
SASLBind::~SASLBind()
{
	FXmppStream->removeXmppStanzaHandler(this, XSHO_XMPP_FEATURE);
	emit featureDestroyed();
}
Ejemplo n.º 7
0
SASLSessionFeature::~SASLSessionFeature()
{
	FXmppStream->removeXmppStanzaHandler(XSHO_XMPP_FEATURE,this);
	emit featureDestroyed();
}
Ejemplo n.º 8
0
RegisterStream::~RegisterStream()
{
	FXmppStream->removeXmppStanzaHandler(XSHO_XMPP_FEATURE,this);
	emit featureDestroyed();
}