Beispiel #1
0
void JabberSearch::showSearchDialog(const Jid &AStreamJid, const Jid &AServiceJid, QWidget *AParent)
{
    IPresence *presence = FPresenceManager!=NULL ? FPresenceManager->findPresence(AStreamJid) : NULL;
    if (presence && presence->isOpen())
    {
        SearchDialog *dialog = new SearchDialog(this,AStreamJid,AServiceJid,AParent);
        connect(presence->instance(),SIGNAL(closed()),dialog,SLOT(reject()));
        dialog->show();
    }
}
Beispiel #2
0
Action *Gateways::createDiscoFeatureAction(const Jid &AStreamJid, const QString &AFeature, const IDiscoInfo &ADiscoInfo, QWidget *AParent)
{
	IPresence *presence = FPresencePlugin!=NULL ? FPresencePlugin->findPresence(AStreamJid) : NULL;
	if (presence && presence->isOpen() && AFeature==NS_JABBER_GATEWAY)
	{
		Action *action = new Action(AParent);
		action->setText(tr("Add Legacy User"));
		action->setIcon(RSR_STORAGE_MENUICONS,MNI_GATEWAYS_ADD_CONTACT);
		action->setData(ADR_STREAM_JID,AStreamJid.full());
		action->setData(ADR_SERVICE_JID,ADiscoInfo.contactJid.full());
		connect(action,SIGNAL(triggered(bool)),SLOT(onAddLegacyUserActionTriggered(bool)));
		return action;
	}
	return NULL;
}
Beispiel #3
0
void PrivateStorage::notifyDataChanged(const Jid &AStreamJid, const QString &ATagName, const QString &ANamespace)
{
	IPresence *presence = FPresenceManager!=NULL ? FPresenceManager->findPresence(AStreamJid) : NULL;
	if (FStanzaProcessor && presence && presence->isOpen())
	{
		foreach(const IPresenceItem &item, presence->findItems(AStreamJid))
		{
			if (item.itemJid != AStreamJid)
			{
				Stanza notify(STANZA_KIND_MESSAGE);
				notify.setTo(item.itemJid.full());
				QDomElement xElem = notify.addElement("x",NS_VACUUM_PRIVATESTORAGE_UPDATE);
				xElem.appendChild(notify.createElement(ATagName,ANamespace));
				if (FStanzaProcessor->sendStanzaOut(AStreamJid,notify))
					LOG_STRM_DEBUG(AStreamJid,QString("Private data updated notify sent, to=%1, ns=%2").arg(item.itemJid.full(),ANamespace));
				else
					LOG_STRM_WARNING(AStreamJid,QString("Failed to send private data updated notify, to=%1, ns=%2").arg(item.itemJid.full(),ANamespace));
			}
		}
	}
Beispiel #4
0
Action *Registration::createDiscoFeatureAction(const Jid &AStreamJid, const QString &AFeature, const IDiscoInfo &ADiscoInfo, QWidget *AParent)
{
	IPresence *presence = FPresenceManager!=NULL ? FPresenceManager->findPresence(AStreamJid) : NULL;
	if (presence && presence->isOpen() && AFeature==NS_JABBER_REGISTER)
	{
		Menu *regMenu = new Menu(AParent);
		regMenu->setTitle(tr("Registration"));
		regMenu->setIcon(RSR_STORAGE_MENUICONS,MNI_REGISTRATION);

		Action *action = new Action(regMenu);
		action->setText(tr("Register"));
		action->setIcon(RSR_STORAGE_MENUICONS,MNI_REGISTRATION);
		action->setData(ADR_STREAM_JID,AStreamJid.full());
		action->setData(ADR_SERVICE_JID,ADiscoInfo.contactJid.full());
		action->setData(ADR_OPERATION,IRegistration::Register);
		connect(action,SIGNAL(triggered(bool)),SLOT(onRegisterActionTriggered(bool)));
		regMenu->addAction(action,AG_DEFAULT,false);

		action = new Action(regMenu);
		action->setText(tr("Unregister"));
		action->setIcon(RSR_STORAGE_MENUICONS,MNI_REGISTRATION_REMOVE);
		action->setData(ADR_STREAM_JID,AStreamJid.full());
		action->setData(ADR_SERVICE_JID,ADiscoInfo.contactJid.full());
		action->setData(ADR_OPERATION,IRegistration::Unregister);
		connect(action,SIGNAL(triggered(bool)),SLOT(onRegisterActionTriggered(bool)));
		regMenu->addAction(action,AG_DEFAULT,false);

		action = new Action(regMenu);
		action->setText(tr("Change password"));
		action->setIcon(RSR_STORAGE_MENUICONS,MNI_REGISTRATION_CHANGE);
		action->setData(ADR_STREAM_JID,AStreamJid.full());
		action->setData(ADR_SERVICE_JID,ADiscoInfo.contactJid.full());
		action->setData(ADR_OPERATION,IRegistration::ChangePassword);
		connect(action,SIGNAL(triggered(bool)),SLOT(onRegisterActionTriggered(bool)));
		regMenu->addAction(action,AG_DEFAULT,false);

		return regMenu->menuAction();
	}
	return NULL;
}
Action *ClientInfo::createDiscoFeatureAction(const Jid &AStreamJid, const QString &AFeature, const IDiscoInfo &ADiscoInfo, QWidget *AParent)
{
	IPresence *presence = FPresenceManager!=NULL ? FPresenceManager->findPresence(AStreamJid) : NULL;
	if (presence && presence->isOpen())
	{
		if (AFeature == NS_JABBER_VERSION)
		{
			Action *action = createInfoAction(AStreamJid,ADiscoInfo.contactJid,AFeature,AParent);
			return action;
		}
		else if (AFeature == NS_JABBER_LAST)
		{
			Action *action = createInfoAction(AStreamJid,ADiscoInfo.contactJid,AFeature,AParent);
			return action;
		}
		else if (AFeature == NS_XMPP_TIME)
		{
			Action *action = createInfoAction(AStreamJid,ADiscoInfo.contactJid,AFeature,AParent);
			return action;
		}
	}
	return NULL;
}