本文整理汇总了C++中xmpp::Jid::bare方法的典型用法代码示例。如果您正苦于以下问题:C++ Jid::bare方法的具体用法?C++ Jid::bare怎么用?C++ Jid::bare使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类xmpp::Jid
的用法示例。
在下文中一共展示了Jid::bare方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: 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);
}
示例2: 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);
}
示例3: 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();
}
示例4: 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());
}
}
示例5: 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);
}
}
示例6: QObject
YaProfile::YaProfile(PsiAccount* account, const XMPP::Jid& jid)
: QObject(account)
, account_(account)
, jid_(jid.bare())
, lastMessage_(QDateTime::currentDateTime().addDays(-1))
{
init();
}
示例7: 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);
}
示例8: 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);
}
示例9: 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);
}
示例10: 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();
}
示例11: 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);
}
示例12: processRegister
void GatewayTask::processRegister(const XMPP::Jid& user, const QString& uin, const QString& password)
{
if ( d->jidIcqTable.contains(user.bare()) ) {
ICQ::Session *conn = d->jidIcqTable.value(user.bare());
d->jidIcqTable.remove(user.bare());
d->jidResources.remove(user.bare());
d->icqJidTable.remove(conn);
delete conn;
}
UserManager::instance()->add(user.bare(), uin, password);
UserManager::instance()->setOption(user.bare(), "first_login", QVariant(true));
emit gatewayMessage( user, tr("You have been successfully registered") );
}
示例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");
}
示例14: get
void PEPManager::get(const XMPP::Jid &jid, const QString &node, const QString &id)
{
PEPGetTask* g = new PEPGetTask(client_->rootTask(), jid.bare(), node, id);
connect(g, SIGNAL(finished()), SLOT(getFinished()));
g->go(true);
}
示例15: connect
void JabberClient::connect(const XMPP::Jid &jid, const QString &password, bool auth)
{
/*
* Close any existing connection.
*/
if (jabberClient)
jabberClient->close();
MyJid = jid;
Password = password;
/*
* Return an error if we should force TLS but it's not available.
*/
if ((forceTLS() || useSSL() || probeSSL()) && !QCA::isSupported("tls"))
{
qDebug("no TLS");
// no SSL support, at the connecting stage this means the problem is client-side
QMessageBox *m = new QMessageBox(QMessageBox::Critical, tr("Jabber SSL Error"), tr("SSL support could not be initialized for account %1. This is most likely because the QCA TLS plugin is not installed on your system.").arg(jid.bare()), QMessageBox::Ok, 0, Qt::Popup);
m->setModal(true);
m->show();
return;
}
/*
* Instantiate connector, responsible for dealing with the socket.
* This class uses KDE's socket code, which in turn makes use of
* the global proxy settings.
*/
JabberClientConnector = new XMPP::AdvancedConnector;
JabberClientConnector->setOptSSL(useSSL());
if (useXMPP09())
{
if (overrideHost())
JabberClientConnector->setOptHostPort(Server, Port);
JabberClientConnector->setOptProbe(probeSSL());
}
/*
* Setup authentication layer
*/
if ((forceTLS() || useSSL()) && QCA::isSupported("tls"))
{
JabberTLS = new QCA::TLS;
JabberTLS->setTrustedCertificates(CertificateHelpers::allCertificates(CertificateHelpers::getCertificateStoreDirs()));
JabberTLSHandler = new QCATLSHandler(JabberTLS);
JabberTLSHandler->setXMPPCertCheck(true);
QObject::connect(JabberTLSHandler, SIGNAL(tlsHandshaken()), SLOT(slotTLSHandshaken()));
}
/*
* Instantiate client stream which handles the network communication by referring
* to a connector (proxying etc.) and a TLS handler (security layer)
*/
JabberClientStream = new XMPP::ClientStream(JabberClientConnector, JabberTLSHandler);
{
using namespace XMPP;
QObject::connect(JabberClientStream, SIGNAL(needAuthParams(bool, bool, bool)),
this, SLOT(slotCSNeedAuthParams(bool, bool, bool)));
QObject::connect(JabberClientStream, SIGNAL(authenticated()),
this, SLOT(slotCSAuthenticated()));
QObject::connect(JabberClientStream, SIGNAL(connectionClosed()),
this, SLOT(slotCSDisconnected()));
QObject::connect(JabberClientStream, SIGNAL(delayedCloseFinished()),
this, SLOT(slotCSDisconnected()));
QObject::connect(JabberClientStream, SIGNAL(warning(int)),
this, SLOT(slotCSWarning(int)));
QObject::connect(JabberClientStream, SIGNAL(error(int)),
this, SLOT(slotCSError(int)));
}
JabberClientStream->setOldOnly(useXMPP09());
/*
* Initiate anti-idle timer (will be triggered every 55 seconds).
*/
JabberClientStream->setNoopTime(55000);
/*
* Allow plaintext password authentication or not?
*/
JabberClientStream->setAllowPlain(allowPlainTextPassword());
/*
* Setup client layer.
*/
jabberClient = new XMPP::Client(this);
/*
* Setup privacy manager
*/
///privacyManager = new PrivacyManager ( rootTask() );
/*
//.........这里部分代码省略.........