当前位置: 首页>>代码示例>>C++>>正文


C++ xmpp::Jid类代码示例

本文整理汇总了C++中xmpp::Jid的典型用法代码示例。如果您正苦于以下问题:C++ Jid类的具体用法?C++ Jid怎么用?C++ Jid使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。


在下文中一共展示了Jid类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: legacyId

QString JabberTransport::legacyId( const XMPP::Jid & jid )
{
	if(jid.node().isEmpty())
		return QString();
	QString node = jid.node();
	return node.replace("%","@");
}
开发者ID:serghei,项目名称:kde3-kdenetwork,代码行数:7,代码来源:jabbertransport.cpp

示例2: slotGroupChatPresence

void KMessageJabber::slotGroupChatPresence(const XMPP::Jid& jid, const XMPP::Status& status)
{
  kDebug() << jid.full() << status.status();
  if (jid.full() == mPeerJid && !status.isAvailable())
  {
    emit connectionBroken();
  }
}
开发者ID:KDE,项目名称:ksirk,代码行数:8,代码来源:kmessagejabber.cpp

示例3: processUnregister

/**
 * Process unregister actions with database and close the legacy connection.
 */
void GatewayTask::processUnregister(const XMPP::Jid& user)
{
    ICQ::Session *conn = d->jidIcqTable.value(user.bare());
    if ( conn ) {
        d->icqJidTable.remove(conn);
        d->jidIcqTable.remove(user.bare());
        d->jidResources.remove(user.bare());
        delete conn;
    }
    UserManager::instance()->del(user);
}
开发者ID:holycheater,项目名称:qt-icq-transport,代码行数:14,代码来源:GatewayTask.cpp

示例4: processVCardRequest

void GatewayTask::processVCardRequest(const XMPP::Jid& user, const QString& uin, const QString& requestID)
{
    ICQ::Session *session = d->jidIcqTable.value( user.bare() );
    if ( !session ) {
        emit incomingVCard(user, uin, requestID, XMPP::vCard() );
        return;
    }
    QString key = user.bare()+"-"+uin;
    Private::vCardRequestInfo info;
    info.requestID = requestID;
    info.resource = user.resource();
    d->vCardRequests.insert(key, info);
    session->requestShortUserDetails(uin);
}
开发者ID:holycheater,项目名称:qt-icq-transport,代码行数:14,代码来源:GatewayTask.cpp

示例5: avatarMetadataQueryFinished

void JabberAvatarPepFetcher::avatarMetadataQueryFinished(const XMPP::Jid &jid, const QString &node, const XMPP::PubSubItem &item)
{
	if (jid.bare() != MyContact.id() || node != XMLNS_AVATAR_METADATA)
		return; // not our data :(

	AvatarId = item.id();
	if (AvatarId == "current")
	{
		Avatar contactAvatar = AvatarManager::instance()->byContact(MyContact, ActionCreateAndAdd);
		contactAvatar.setLastUpdated(QDateTime::currentDateTime());
		contactAvatar.setNextUpdate(QDateTime::fromTime_t(QDateTime::currentDateTime().toTime_t() + 7200));
		contactAvatar.setPixmap(QPixmap());

		done();
		deleteLater();
		return;
	}

	JabberProtocol *jabberProtocol = qobject_cast<JabberProtocol *>(MyContact.contactAccount().protocolHandler());
	if (jabberProtocol)
	{
		disconnect(jabberProtocol->client()->pepManager(), SIGNAL(itemPublished(XMPP::Jid,QString,XMPP::PubSubItem)), this, SLOT(avatarMetadataQueryFinished(XMPP::Jid,QString,XMPP::PubSubItem)));
		connect(jabberProtocol->client()->pepManager(), SIGNAL(itemPublished(XMPP::Jid,QString,XMPP::PubSubItem)), this, SLOT(avatarDataQueryFinished(XMPP::Jid,QString,XMPP::PubSubItem)));
		jabberProtocol->client()->pepManager()->get(MyContact.id(), XMLNS_AVATAR_DATA, item.id());
	}
}
开发者ID:partition,项目名称:kadu,代码行数:26,代码来源:jabber-avatar-pep-fetcher.cpp

示例6: avatarDataQueryFinished

void JabberAvatarPepFetcher::avatarDataQueryFinished(const XMPP::Jid &jid, const QString &node, const XMPP::PubSubItem &item)
{
	if (jid.bare() != MyContact.id() || node != XMLNS_AVATAR_DATA || item.id() != AvatarId)
		return; // not our data :(

	JabberProtocol *jabberProtocol = qobject_cast<JabberProtocol *>(MyContact.contactAccount().protocolHandler());
	if (jabberProtocol)
		disconnect(jabberProtocol->client()->pepManager(), SIGNAL(itemPublished(XMPP::Jid,QString,XMPP::PubSubItem)), this, SLOT(avatarDataQueryFinished(XMPP::Jid,QString,XMPP::PubSubItem)));

	XMPP::Base64 base64;
	QByteArray imageData = base64.decode(item.payload().text());

	Avatar contactAvatar = AvatarManager::instance()->byContact(MyContact, ActionCreateAndAdd);
	contactAvatar.setLastUpdated(QDateTime::currentDateTime());
	contactAvatar.setNextUpdate(QDateTime::fromTime_t(QDateTime::currentDateTime().toTime_t() + 7200));

	QPixmap pixmap;

	if (!imageData.isEmpty())
		pixmap.loadFromData(imageData);

	contactAvatar.setPixmap(pixmap);

	done();
	deleteLater();
}
开发者ID:partition,项目名称:kadu,代码行数:26,代码来源:jabber-avatar-pep-fetcher.cpp

示例7: processUserStatusRequest

void GatewayTask::processUserStatusRequest(const XMPP::Jid& user)
{
    ICQ::Session *session = d->jidIcqTable.value( user.bare() );
    if ( !session ) {
        return;
    }
    if ( session->onlineStatus() == ICQ::Session::Offline ) {
        emit offlineNotifyFor(user);
    } else {
        int show;
        switch ( session->onlineStatus() ) {
            case ICQ::Session::Away:
                show = XMPP::Presence::Away;
                break;
            case ICQ::Session::NotAvailable:
                show = XMPP::Presence::NotAvailable;
                break;
            case ICQ::Session::FreeForChat:
                show = XMPP::Presence::Chat;
                break;
            case ICQ::Session::DoNotDisturb:
                show = XMPP::Presence::DoNotDisturb;
                break;
            default:
                show = XMPP::Presence::None;
                break;
        }
        emit onlineNotifyFor(user, show);
    }
}
开发者ID:holycheater,项目名称:qt-icq-transport,代码行数:30,代码来源:GatewayTask.cpp

示例8: processSendMessage

/**
 * Sends @a message from jabber-user @a user to ICQ user with specified @a uin
 */
void GatewayTask::processSendMessage(const XMPP::Jid& user, const QString& uin, const QString& message)
{
    ICQ::Session *conn = d->jidIcqTable.value( user.bare() );
    if ( !conn ) {
        return;
    }
    conn->sendMessage(uin, message);
}
开发者ID:holycheater,项目名称:qt-icq-transport,代码行数:11,代码来源:GatewayTask.cpp

示例9: processAuthDeny

void GatewayTask::processAuthDeny(const XMPP::Jid& user, const QString& uin)
{
    ICQ::Session *conn = d->jidIcqTable.value( user.bare() );
    if ( !conn ) {
        return;
    }
    conn->authDeny(uin);
}
开发者ID:holycheater,项目名称:qt-icq-transport,代码行数:8,代码来源:GatewayTask.cpp

示例10: processUnsubscribeRequest

/**
 * This slot is triggered when jabber user @a user requests to remove a contact @a uin from server.
 */
void GatewayTask::processUnsubscribeRequest(const XMPP::Jid& user, const QString& uin)
{
    ICQ::Session *conn = d->jidIcqTable.value( user.bare() );
    if ( !conn ) {
        return;
    }
    conn->contactDel(uin);
}
开发者ID:holycheater,项目名称:qt-icq-transport,代码行数:11,代码来源:GatewayTask.cpp

示例11: QObject

YaProfile::YaProfile(PsiAccount* account, const XMPP::Jid& jid)
	: QObject(account)
	, account_(account)
	, jid_(jid.bare())
	, lastMessage_(QDateTime::currentDateTime().addDays(-1))
{
	init();
}
开发者ID:AlekSi,项目名称:Jabbin,代码行数:8,代码来源:yaprofile.cpp

示例12: processUserOffline

/**
 * This slot is triggered when jabber user @a user goes offline.
 */
void GatewayTask::processUserOffline(const XMPP::Jid& user)
{
    ICQ::Session *conn = d->jidIcqTable.value( user.bare() );
    emit offlineNotifyFor(user);
    if ( !conn ) {
        return;
    }

    QStringListIterator ci(conn->contactList());
    while ( ci.hasNext() ) {
        emit contactOffline( user, ci.next() );
    }

    d->jidIcqTable.remove( user.bare() );
    d->icqJidTable.remove(conn);
    d->jidResources.remove( user.bare() );
    conn->disconnect();
    conn->deleteLater();
}
开发者ID:holycheater,项目名称:qt-icq-transport,代码行数:22,代码来源:GatewayTask.cpp

示例13: SIGNAL

HistoryDlg::HistoryDlg(const XMPP::Jid& j, PsiAccount* pa)
: pa_(pa), jidFull_(j), from_(0), count_(30)
{
	setupUi(this);
	setModal(false);
	setAttribute(Qt::WA_DeleteOnClose);
	pa_->dialogRegister(this, jidFull_);
	setWindowTitle(tr("History for ") + j.full());
#ifndef Q_WS_MAC
	setWindowIcon(IconsetFactory::icon("psi/history").icon());
#endif


	DateTree->setHeaderLabel(tr("Date"));
	DateTree->setSortingEnabled(true);
	DateTree->setColumnHidden(1,true);
	connect(DateTree, SIGNAL(customContextMenuRequested(const QPoint &)), SLOT(doDateContextMenu(const QPoint &)));

	EventsTree->setColumnCount(4);
	QStringList headers;
	headers << tr("Type") << tr("Time") << tr("Origin") << tr("Text");
	EventsTree->setHeaderLabels(headers);
	EventsTree->sortItems(1,Qt::AscendingOrder);
	EventsTree->setSortingEnabled(true);
	EventsTree->setWordWrap(true);
	EventsTree->hideColumn(2);

	connect(EventsTree, SIGNAL(itemDoubleClicked(QTreeWidgetItem *, int)), SLOT(actionOpenEvent(QTreeWidgetItem *, int)));
	connect(EventsTree, SIGNAL(customContextMenuRequested(const QPoint &)), SLOT(doEventContextMenu(const QPoint &)));
	connect(tb_previousMonth, SIGNAL(clicked()), SLOT(doPrev()));
	connect(tb_latest, SIGNAL(clicked()), SLOT(doLatest()));
	connect(tb_nextMonth, SIGNAL(clicked()), SLOT(doNext()));
	connect(pb_find, SIGNAL(clicked()), SLOT(doFind()));
	connect(pb_export, SIGNAL(clicked()), SLOT(doExport()));
	connect(pb_close, SIGNAL(clicked()), SLOT(close()));

	jid_ = j.bare();
	doLatest();

	X11WM_CLASS("history");
}
开发者ID:BackupTheBerlios,项目名称:synapse-xmpp-svn,代码行数:41,代码来源:historydlg.cpp

示例14: m

ArchiveDlg::ArchiveDlg(const XMPP::Jid &jid, PsiAccount *pa)
{
	max = 30;
	page_ = 0;
	setupUi(this);
	tw_log->setColumnCount(3);
	QStringList headers;
	headers << tr("Time") << tr("") << tr("Message");
	tw_log->setHeaderLabels(headers);
	setAttribute(Qt::WA_DeleteOnClose);
	setWindowTitle(tr("Archive for ") + jid.full());
#ifndef Q_WS_MAC
	setWindowIcon(IconsetFactory::icon("psi/history").icon());
#endif

	gct_ = NULL;

	pa_ = pa;
	jid_ = jid;

	last_ =  QDateTime::currentDateTime();

	connect(pb_close, SIGNAL(clicked()), this, SLOT(hide()));

	connect(calendar, SIGNAL(selectionChanged()), this, SLOT(dateSelected()));
	connect(calendar, SIGNAL(currentPageChanged(int, int)), this, SLOT(dateChanged(int, int)));

	connect(lw_conversations, SIGNAL(itemSelectionChanged()), this, SLOT(collectionSelected()));
	connect(lw_conversations, SIGNAL(customContextMenuRequested(const QPoint&)), this, SLOT(doCollectionContextMenu(const QPoint&)));
	lw_conversations->

	connect(tb_prevPage, SIGNAL(clicked()), this, SLOT(prevPage()));	connect(tb_nextPage, SIGNAL(clicked()), this, SLOT(nextPage()));

	gclt_ = new GetCollectionListTask(pa->client()->rootTask());
	connect(gclt_, SIGNAL(busy()), this, SLOT(busy()));
	connect(gclt_, SIGNAL(done()), this, SLOT(collectionListRetrieved()));
	connect(gclt_, SIGNAL(error()), this, SLOT(error()));

	gct_ = new GetCollectionTask(pa_->client()->rootTask());
	connect(gct_, SIGNAL(busy()), this, SLOT(busy()));
	connect(gct_, SIGNAL(done(int)), this, SLOT(collectionRetrieved(int)));
	connect(gct_, SIGNAL(msg(int, bool, const QString&)), this, SLOT(collectionMsg(int, bool, const QString&)));
	connect(gct_, SIGNAL(error()), this, SLOT(error()));
	
	QDate m(last_.date().year(), last_.date().month(), 1);
	gclt_->get(jid, m, 50);
//	X11WM_CLASS("history");
}
开发者ID:BackupTheBerlios,项目名称:synapse-xmpp-svn,代码行数:48,代码来源:archivedlg.cpp

示例15: processCmd_RosterRequest

/**
 * Process legacy roster request from jabber user @a user.
 */
void GatewayTask::processCmd_RosterRequest(const XMPP::Jid& user)
{
    ICQ::Session *session = d->jidIcqTable.value( user.bare() );
    if ( !session ) {
        return;
    }

    QStringList contacts = session->contactList();
    QStringListIterator i(contacts);
    QList<XMPP::RosterXItem> items;
    while ( i.hasNext() ) {
        QString uin = i.next();
        QString name = session->contactName(uin);
        XMPP::RosterXItem item(uin, XMPP::RosterXItem::Add, name);
        items << item;
    }
    emit rosterAdd(user, items);
}
开发者ID:holycheater,项目名称:qt-icq-transport,代码行数:21,代码来源:GatewayTask.cpp


注:本文中的xmpp::Jid类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。