本文整理汇总了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("%","@");
}
示例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();
}
}
示例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);
}
示例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);
}
示例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());
}
}
示例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();
}
示例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);
}
}
示例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);
}
示例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);
}
示例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);
}
示例11: QObject
YaProfile::YaProfile(PsiAccount* account, const XMPP::Jid& jid)
: QObject(account)
, account_(account)
, jid_(jid.bare())
, lastMessage_(QDateTime::currentDateTime().addDays(-1))
{
init();
}
示例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();
}
示例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: 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");
}
示例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);
}